[Master Bug] Package nginx-* failed to install/upgrade: subprocess installed post-installation script returned error exit status 1 (due to "Address in Use" issue)

Bug #1512344 reported by Thomas Ward
172
This bug affects 37 people
Affects Status Importance Assigned to Milestone
Nginx
Invalid
Undecided
Thomas Ward
nginx (Ubuntu)
Invalid
Undecided
Thomas Ward

Bug Description

This is a master bug for all package-type nginx bugs with install/upgrade failures as a result of port 80 being already used by another process. It was created to be a 'master' for all the bugs which are caused by some other service being bound to *:80 (both IPv4 and IPv6) when any of the nginx flavors or server-binary packages are installed, and all subsequent bugs which match this type of issue will be marked as a duplicate of this one.

A purposely-generated 'package' bug of this type was created, and is located at https://bugs.launchpad.net/ubuntu/+source/nginx/+bug/1512484. Bugs of a nature matching that one (an "Address In Use" error) should point to here.

------

The issue observed is not in and of itself a bug - this is an issue in which the system you are installing NGINX on already has something else listening on port 80.

To fix this issue, you need to first find what is listening on Port 80, and turn it off. At that time, either install NGINX or use 'apt-get install -f' to try and finish configuration.

An example of the error logs of this can be seen in Vivid and later with `systemctl -l status nginx.service` which will return something like the attached "systemctl_output.txt" file that is attached to this bug.

Thomas Ward (teward)
summary: - Package nginx-* failed to install/upgrade due to Port 80 not being able
- to be bound to.
+ [Master Bug] Package nginx-* failed to install/upgrade due to Port 80
+ not being able to be bound to.
Changed in nginx (Ubuntu):
status: New → Invalid
Revision history for this message
Thomas Ward (teward) wrote : Re: [Master Bug] Package nginx-* failed to install/upgrade due to Port 80 not being able to be bound to.

When trying to fix this yourself...

(1) Check the output of one of these two commands:

'sudo netstat -tulpn | grep :80' OR 'sudo ss -tulpn | grep :80'

This will indicate what processes are listening on IP/Port combination *:80

(2) Once you know the process/pid that is listening on Port 80, kill it. Either stop the service (for example, if Apache is the one causing the conflict, use `sudo service apache2 stop`), or kill the process itself.

If you intend to use things side by side, such as Apache *and* nginx, temporarily stop one service while installing the other. Then modify your configurations so neither service is listening on the same ports as each other, and start up the services. This will resolve the issues.

summary: [Master Bug] Package nginx-* failed to install/upgrade due to Port 80
- not being able to be bound to.
+ not being able to be bound to, due to "Address In Use" errors.
description: updated
Revision history for this message
Thomas Ward (teward) wrote : Re: [Master Bug] Package nginx-* failed to install/upgrade due to Port 80 not being able to be bound to, due to "Address In Use" errors.
description: updated
Thomas Ward (teward)
summary: - [Master Bug] Package nginx-* failed to install/upgrade due to Port 80
- not being able to be bound to, due to "Address In Use" errors.
+ [Master Bug] Package nginx-* failed to install/upgrade: subprocess
+ installed post-installation script returned error exit status 1 (due to
+ Port 80 being in use)
Thomas Ward (teward)
summary: - [Master Bug] Package nginx-* failed to install/upgrade: subprocess
- installed post-installation script returned error exit status 1 (due to
- Port 80 being in use)
+ Package nginx-* failed to install/upgrade: subprocess installed post-
+ installation script returned error exit status 1
summary: - Package nginx-* failed to install/upgrade: subprocess installed post-
- installation script returned error exit status 1
+ [Master Bug] Package nginx-* failed to install/upgrade: subprocess
+ installed post-installation script returned error exit status 1 (due to
+ "Address in Use" issue)
Thomas Ward (teward)
description: updated
Alex (alekskich)
Changed in nginx (Ubuntu):
status: Invalid → Confirmed
Thomas Ward (teward)
Changed in nginx (Ubuntu):
status: Confirmed → Invalid
Revision history for this message
Sardinoux (sardin56) wrote :

Nginx dependancies are broken when I try to install it on a fresh xenial install.

Revision history for this message
Thomas Ward (teward) wrote :

@Sardinoux

That needs its own bug, with its own set of debug information - I tested yesterday usin a fresh Xenial copy and nginx installed without issue (using nginx as the package name). What you stated is NOT related to this bug.

Revision history for this message
Javier Arias (javierarias) wrote :

The problem, in my case, was due to having apache2 running at the time of the upgrade. Stopping the apache2 service and trying to configure nginx again solved the issue.

Revision history for this message
Thomas Ward (teward) wrote :

Javier: Note that that is actually covered under https://wiki.ubuntu.com/ServerTeam/NGINX#TriageAddressInUse which shows that such issues are not actually bugs in the packaging but end-user-side of things, as well as this bug here. Both cases are "not bugs" in the packaging.

Revision history for this message
Noel McLoughlin (noelmcloughlin) wrote :

Are't we confusing package management with service management? The purpose of packaging is to bundle software into a deployable unit for consumption by a package manager. RFC1340 is an internet standard saying "World Wide Web HTTP" can be served from port 80, and is neutral on service vendor. Until an RFC is published stating nginx, a service vendor, owns port 80 this remains a bug.

Keep package management and service management separate. Package nginx into a deployable unit consumed by package managers and measure packaging success/failure in those terms.

Do not package nginx into a deployable service unit for consumption by a service manager, because this is beyond the scope of packaging. packages and services are different concepts. If nginx.service subprocess fails, why is this a concern for nginx packaging? Just print a message and get the package installed, that is the expectation. There are frameworks for service management/availability which can handle service stuff. Bottom line, this is a really really bad bug and not fixing goes against principles of choice, FOSS, etc.

Revision history for this message
Thomas Ward (teward) wrote :

Noel: Ask apt and dpkg how they work, and part of the installation post-install *tests* is that it installs and starts with a default config. This has always been a part of how Debian works.

We also get ***many*** bugs filed for this master process here - that's why this master bug exists so we can close newer bugs as a duplicate of this one here to *show* that it's a "Won't Fix" and "Not our concern" bug.

(Sometimes we discover huge issues with these kinds of bugs, but that's usually rare).

Rakib Hasan (rkb)
Changed in nginx:
assignee: nobody → Rakib Hasan (rkb)
status: New → Invalid
Thomas Ward (teward)
Changed in nginx:
assignee: Rakib Hasan (rkb) → Thomas Ward (teward)
Revision history for this message
Eglefino (ruudino-k) wrote :

Every time I come here it's a crime (time), something isn't working well. My English (translating from Dutch) isn't not well enough to correspond with you, but the problems I have too are difficult to see over. I tried to set up QEMU/KVM, Virtelbox, e.s.o. and every-time there were some problems and I had to delete it before to start a new one. Every new program brings a new installation process (& read a lot documentation) to understand how it's working. I started with Ubuntu with the terminal (CLI) but in VM I like to work with some GUI,

But working with an OS what is talking and saying (in terminal) I'm not the owner of parts of my own 'Home' is a little crazy. than it's especially difficult to install software.
Launchpad said during my installation..... and the errors, maybe I can help you with the nginx-bugs. I tried to install https://serenity-networks.com/how-to-install-kvm-the-kimchi-graphical-web-interface-on-ubuntu-15-04/ in my 16.04 after installing KVM/QEMO, but there came a lot of red text words so I stopted the installation of WOK via Git-depencies. you can write to me to <email address hidden> (if you have a reaction)

Revision history for this message
Noel McLoughlin (noelmcloughlin) wrote :

This is bullshit and irresponsible - please fix nginx package and stop breaking users Linux OS.

The nginx service is responsibility of systemd/upstart not APT/ZYPPER/YUM/PACMAN etc.

This needs to be escalated if package is not fixed.

Revision history for this message
Noel McLoughlin (noelmcloughlin) wrote :

here is another Ubuntu package breaking OS: https://bugs.launchpad.net/ubuntu/+source/samba/+bug/1818431

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.