Installing ideascube and uWSGI in the same operation fails
On a machine where uWSGI wasn't already installed, installing Ideascube will install uWSGI as a dependency.
$ apt install ideascube
...
Setting up uwsgi (2.0.7-1) ...
Job for uwsgi.service failed. See 'systemctl status uwsgi.service' and 'journalctl -xn' for details.
invoke-rc.d: initscript uwsgi, action "start" failed.
dpkg: error processing package uwsgi (--configure):
subprocess installed post-installation script returned error exit status 1
Setting up uwsgi-plugin-python3 (2.0.7-1) ...
dpkg: dependency problems prevent configuration of ideascube:
ideascube depends on uwsgi; however:
Package uwsgi is not configured yet.
dpkg: error processing package ideascube (--configure):
dependency problems - leaving unconfigured
Setting up file (1:5.22+15-2+deb8u1) ...
Setting up python3.4 (3.4.2-1) ...
Processing triggers for libc-bin (2.19-18+deb8u3) ...
Processing triggers for systemd (215-17+deb8u3) ...
Errors were encountered while processing:
uwsgi
ideascube
E: Sub-process /usr/bin/dpkg returned an error code (1)
What happens is as follows:
- apt unpacks the
uwsgi
package - apt unpacks the
ideascube
package- this installs the
uwsgi.service
systemd unit, and the drop-in configuration to make uWSGI run as the ideascube user
- this installs the
- dpkg configures the
uwsgi
package- this means starting the
uwsgi.service
unit
- this means starting the
- dpkg configures the
ideascube
package- among other things, this creates the
ideascube
user
- among other things, this creates the
Clearly, step 3 fails because we can't ask uWSGI to run as the ideascube
user if it hasn't been created yet.
A short-term workaround is to install uWSGI first, then install Ideascube as a separate operation.
A better long-term solution would be to create the ideascube
user earlier, maybe as part of a pre-installation script (if such a thing exists in the Debian packaging world, I honestly have no idea).