Cannot install uwsgi-plugin-python on Ubuntu 16.04 beta2

Bug #1562237 reported by Zhang Huangbin
70
This bug affects 15 people
Affects Status Importance Assigned to Milestone
uwsgi (Debian)
Fix Released
Unknown
uwsgi (Ubuntu)
Confirmed
Undecided
Unassigned

Bug Description

Cannot install uwsgi-plugin-python on Ubuntu 16.04 beta2. Steps to reproduce this issue:

*) Install a new, fresh Ubuntu 16.04 beta2 (amd64, server).
*) Install 'uwsgi-plugin-python':

# apt-get update
Get:1 http://mirrors.aliyun.com/ubuntu xenial InRelease [116 kB]
Hit:2 http://mirrors.aliyun.com/ubuntu xenial-updates InRelease
Hit:3 http://mirrors.aliyun.com/ubuntu xenial-backports InRelease
Hit:4 http://mirrors.aliyun.com/ubuntu xenial-security InRelease
Get:5 http://mirrors.aliyun.com/ubuntu xenial/main amd64 Packages [1,436 kB]
Get:6 http://mirrors.aliyun.com/ubuntu xenial/main i386 Packages [1,431 kB]
Get:7 http://mirrors.aliyun.com/ubuntu xenial/universe amd64 Packages [7,249 kB]
Get:8 http://mirrors.aliyun.com/ubuntu xenial/universe i386 Packages [7,229 kB]
Get:9 http://mirrors.aliyun.com/ubuntu xenial/universe Translation-en [4,187 kB]
Fetched 21.6 MB in 30s (721 kB/s)
apt-get install uwsgi-plugin-python
Reading package lists... Done
root@u16:~# apt-get install uwsgi-plugin-python
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following additional packages will be installed:
  libjansson4 libmatheval1 libpython2.7 libpython2.7-minimal libpython2.7-stdlib libsodium18 libyaml-0-2 libzmq5 uwsgi-core
Suggested packages:
  nginx-full | cherokee | libapache2-mod-proxy-uwsgi | libapache2-mod-uwsgi | libapache2-mod-ruwsgi uwsgi-plugins-all
  uwsgi-extra python-uwsgidecorators
The following NEW packages will be installed:
  libjansson4 libmatheval1 libpython2.7 libpython2.7-minimal libpython2.7-stdlib libsodium18 libyaml-0-2 libzmq5 uwsgi-core
  uwsgi-plugin-python
0 upgraded, 10 newly installed, 0 to remove and 6 not upgraded.
Need to get 4,228 kB of archives.
After this operation, 18.6 MB of additional disk space will be used.
Do you want to continue? [Y/n] y
Get:1 http://mirrors.aliyun.com/ubuntu xenial/universe amd64 libmatheval1 amd64 1.1.11+dfsg-2 [21.2 kB]
Get:2 http://mirrors.aliyun.com/ubuntu xenial/main amd64 libyaml-0-2 amd64 0.1.6-3 [47.6 kB]
Get:3 http://mirrors.aliyun.com/ubuntu xenial/main amd64 libjansson4 amd64 2.7-3 [26.9 kB]
Get:4 http://mirrors.aliyun.com/ubuntu xenial/main amd64 libpython2.7-minimal amd64 2.7.11-6 [336 kB]
Get:5 http://mirrors.aliyun.com/ubuntu xenial/main amd64 libpython2.7-stdlib amd64 2.7.11-6 [1,852 kB]
Get:6 http://mirrors.aliyun.com/ubuntu xenial/main amd64 libpython2.7 amd64 2.7.11-6 [1,067 kB]
Get:7 http://mirrors.aliyun.com/ubuntu xenial/universe amd64 libsodium18 amd64 1.0.8-5 [144 kB]
Get:8 http://mirrors.aliyun.com/ubuntu xenial/universe amd64 libzmq5 amd64 4.1.4-7 [149 kB]
Get:9 http://mirrors.aliyun.com/ubuntu xenial/universe amd64 uwsgi-core amd64 2.0.12-4ubuntu2 [511 kB]
Get:10 http://mirrors.aliyun.com/ubuntu xenial/universe amd64 uwsgi-plugin-python amd64 2.0.12-4ubuntu2 [72.8 kB]
Fetched 4,228 kB in 3s (1,186 kB/s)
Selecting previously unselected package libmatheval1:amd64.
(Reading database ... 59763 files and directories currently installed.)
Preparing to unpack .../libmatheval1_1.1.11+dfsg-2_amd64.deb ...
Unpacking libmatheval1:amd64 (1.1.11+dfsg-2) ...
Selecting previously unselected package libyaml-0-2:amd64.
Preparing to unpack .../libyaml-0-2_0.1.6-3_amd64.deb ...
Unpacking libyaml-0-2:amd64 (0.1.6-3) ...
Selecting previously unselected package libjansson4:amd64.
Preparing to unpack .../libjansson4_2.7-3_amd64.deb ...
Unpacking libjansson4:amd64 (2.7-3) ...
Selecting previously unselected package libpython2.7-minimal:amd64.
Preparing to unpack .../libpython2.7-minimal_2.7.11-6_amd64.deb ...
Unpacking libpython2.7-minimal:amd64 (2.7.11-6) ...
Selecting previously unselected package libpython2.7-stdlib:amd64.
Preparing to unpack .../libpython2.7-stdlib_2.7.11-6_amd64.deb ...
Unpacking libpython2.7-stdlib:amd64 (2.7.11-6) ...
Selecting previously unselected package libpython2.7:amd64.
Preparing to unpack .../libpython2.7_2.7.11-6_amd64.deb ...
Unpacking libpython2.7:amd64 (2.7.11-6) ...
Selecting previously unselected package libsodium18:amd64.
Preparing to unpack .../libsodium18_1.0.8-5_amd64.deb ...
Unpacking libsodium18:amd64 (1.0.8-5) ...
Selecting previously unselected package libzmq5:amd64.
Preparing to unpack .../libzmq5_4.1.4-7_amd64.deb ...
Unpacking libzmq5:amd64 (4.1.4-7) ...
Selecting previously unselected package uwsgi-core.
Preparing to unpack .../uwsgi-core_2.0.12-4ubuntu2_amd64.deb ...
Unpacking uwsgi-core (2.0.12-4ubuntu2) ...
Selecting previously unselected package uwsgi-plugin-python.
Preparing to unpack .../uwsgi-plugin-python_2.0.12-4ubuntu2_amd64.deb ...
Unpacking uwsgi-plugin-python (2.0.12-4ubuntu2) ...
Processing triggers for libc-bin (2.23-0ubuntu2) ...
Processing triggers for man-db (2.7.5-1) ...
Setting up libmatheval1:amd64 (1.1.11+dfsg-2) ...
Setting up libyaml-0-2:amd64 (0.1.6-3) ...
Setting up libjansson4:amd64 (2.7-3) ...
Setting up libpython2.7-minimal:amd64 (2.7.11-6) ...
Setting up libpython2.7-stdlib:amd64 (2.7.11-6) ...
Setting up libpython2.7:amd64 (2.7.11-6) ...
Setting up libsodium18:amd64 (1.0.8-5) ...
Setting up libzmq5:amd64 (4.1.4-7) ...
Setting up uwsgi-core (2.0.12-4ubuntu2) ...
Setting up uwsgi-plugin-python (2.0.12-4ubuntu2) ...
dpkg: error processing package uwsgi-plugin-python (--configure):
 subprocess installed post-installation script returned error exit status 1
Processing triggers for libc-bin (2.23-0ubuntu2) ...E: Sub-process /usr/bin/dpkg returned an error code (1)

Revision history for this message
HittingSmoke (hittingsmoke) wrote :

This also affects uwsgi-plugin-python3

Revision history for this message
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in uwsgi (Ubuntu):
status: New → Confirmed
Revision history for this message
Alexander Charykov (acharykov) wrote :

In post install section it fails in:
      BINARY_IS_UWSGI_ALTERNATIVE="$(\
        update-alternatives --list uwsgi 2>/dev/null \
        | grep -c '/uwsgi_python$' \
      )"

root@localhost:~# update-alternatives --list uwsgi
/usr/bin/uwsgi-core
/usr/bin/uwsgi_python27

Related bug in debian: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=818116

Revision history for this message
Zhang Huangbin (michaelbibby) wrote :

Another error while trying to install uwsgi-plugin-python:

Setting up uwsgi-plugin-python (2.0.12-5ubuntu1) ...
/var/lib/dpkg/info/uwsgi-plugin-python.postinst: 61: [: Illegal number:

Seems incorrect shell syntax.

Changed in uwsgi (Debian):
status: Unknown → Fix Released
no longer affects: uwsgi
Revision history for this message
Chris Hager (chris-linuxuser) wrote :

Still happening for me in a fully updated Ubuntu 16.04:

    Setting up uwsgi-plugin-python (2.0.12-5ubuntu1) ...
    /var/lib/dpkg/info/uwsgi-plugin-python.postinst: 61: [: Illegal number:

Revision history for this message
Bob Balaban (bbalaban) wrote :

Also happening to me using AWS Ubuntu 16.04 ec2

Revision history for this message
Vertex (nikolaus993) wrote :

I am running a fully updated Ubuntu Server 16.04 and I still facing this issue, please fix this bug:

    Setting up uwsgi-plugin-python (2.0.12-5ubuntu3.1) ...
    /var/lib/dpkg/info/uwsgi-plugin-python.postinst: 61: [: Illegal number:

thank you.

Revision history for this message
Andreas Hasenack (ahasenack) wrote :

Reproduced. i added -x debugging to postinst, and this is what I get:
root@xenial:~# dpkg-reconfigure uwsgi-plugin-python
+ DEFAULTFLAVOR_DOTLESS=python27
+ [ xpython27 = xpython27 ]
+ ALTERNATIVE_PRIORITY=75
+ update-alternatives --quiet --install /usr/lib/uwsgi/plugins/python_plugin.so uwsgi-plugin-python /usr/lib/uwsgi/plugins/python27_plugin.so 75 --slave /usr/bin/uwsgi_python uwsgi_python /usr/bin/uwsgi-core --slave /usr/share/man/man1/uwsgi_python.1.gz uwsgi_python.1.gz /usr/share/man/man1/uwsgi_python27.1.gz
+ update-alternatives --quiet --install /usr/bin/uwsgi uwsgi /usr/bin/uwsgi_python27 35 --slave /usr/share/man/man1/uwsgi.1.gz uwsgi.1.gz /usr/share/man/man1/uwsgi_python27.1.gz
+ update-alternatives --list uwsgi
+ grep -c /uwsgi_python$
+ true
+ BINARY_IS_UWSGI_ALTERNATIVE=
+ [ -eq 0 ]
/var/lib/dpkg/info/uwsgi-plugin-python.postinst: 61: [: Illegal number:
+ exit 0

That grep is failing to find a match:
root@xenial:~# update-alternatives --list uwsgi
/usr/bin/uwsgi-core
/usr/bin/uwsgi_python27

The error is happening because the grep fails to find a match, and "| true", it should have been "|| true".

And I now found the debian bug about it, and the fix. It's fixed since 2.0.12-6.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.