nginx-proxy-manager icon indicating copy to clipboard operation
nginx-proxy-manager copied to clipboard

nginx: [emerg] bind() to 0.0.0.0:80 failed (13: Permission denied)

Open maz1987in opened this issue 1 year ago • 79 comments

Checklist

  • Have you pulled and found the error with jc21/nginx-proxy-manager:latest docker image?
    • Yes
  • Are you sure you're not using someone else's docker image?
    • Yes
  • Have you searched for similar issues (both open and closed)?
    • Yes

Describe the bug

when I upgrade to the latest "2.10.0" I got

nginx: [emerg] bind() to 0.0.0.0:80 failed (13: Permission denied)

Nginx Proxy Manager Version

To Reproduce Run docker with option "network_mode: host"

Expected behavior

Screenshots image

Operating System QNAP NAS

Additional context

maz1987in avatar Mar 27 '23 04:03 maz1987in

Can confirm I'm seeing the exact same issue with the same configuration. Have rolled back to 2.9.22 to temporarily resolve the issue.

pmoon00 avatar Mar 27 '23 04:03 pmoon00

Same on Unraid with Host network.

kilrah avatar Mar 27 '23 04:03 kilrah

Can confirm, exact same issue. I also reverted back to 2.9.22.

(edit) Changed host network to bridge, to bypass the issue. No other configuration changed. Since NPM config I'm using does not serve high load, I'm going to stick with bridge network for now.

hdavid0510 avatar Mar 27 '23 05:03 hdavid0510

I've got the same problem since the update

jsuelwald avatar Mar 27 '23 06:03 jsuelwald

Same. Using podman on Rocky Linux.

psychogun avatar Mar 27 '23 07:03 psychogun

Same problem running docker on Synology, with portainer and watchtower.

Have been on bridge network without problems before this update.

Reverted back to 2.9.22 and problem resolved.

kahn2k avatar Mar 27 '23 07:03 kahn2k

Same issue running docker on Synology, DSM 7.1.1-42962 The container is in a bridge network

functionaldude avatar Mar 27 '23 08:03 functionaldude

Yup, same: running with podman on RHEL9

wzzrd avatar Mar 27 '23 08:03 wzzrd

Same here!!!!

[Synology DSM 7.1] npm docker log nginx: [emerg] bind() to 0.0.0.0:80 failed (13: Permission denied)

azchoi avatar Mar 27 '23 09:03 azchoi

Same here, reverted to 2.9.22 Synology, docker, portainer, watchtower.

nginx: [emerg] bind() to 0.0.0.0:80 failed (13: Permission denied)

steindorarnar avatar Mar 27 '23 11:03 steindorarnar

I used

app:
  image: 'jc21/nginx-proxy-manager:2.9.22'

to revert to 2.9.22.

zsmbrvr avatar Mar 27 '23 12:03 zsmbrvr

Please don't comment with just 'same here!'. I think it's clear that there is an issue with the latest release.

stephanvierkant avatar Mar 27 '23 12:03 stephanvierkant

Same issue here running on Synology with bridge networking. Unfortunately I spent a long time attempting to debug why it coudn’t bind to the port. Stop the container and port 80 became free, start the container at the port is in use via docker-proxy but NPM fails to bind to it.

After deleting everything and attempting to start again, I found it was still the same, permission denied when binding the port. Checked and spotted there’d been a recent update,

Rolling back to 2.9.22 fixes the issue For the time being.

Just realised @stephanvierkant had already mentioned using older release as I had :)

CelticWebSolutions avatar Mar 27 '23 14:03 CelticWebSolutions

It seems that since v2.10.0 the nginx is ran by npmuser rather than default (root maybe?), whom might don't have sufficient permissions to listen on lower ports like 80 & 443. Not sure if this is the cause. 🤔 See full changelogs here: https://github.com/NginxProxyManager/nginx-proxy-manager/compare/v2.9.22...v2.10.0

Candinya avatar Mar 27 '23 15:03 Candinya

Same isue here;running inside proxmox lcx container. my docker compose:

version: "3"
services:
  app:
    image: 'jc21/nginx-proxy-manager:latest'
    restart: unless-stopped
    network_mode: host
    volumes:
      - ./data:/data
      - ./letsencrypt:/etc/letsencrypt
  watchtower:
    container_name: watchtower
    image: containrrr/watchtower:latest
    restart: unless-stopped
    volumes:
      - /var/run/docker.sock:/var/run/docker.sock

florisdipt avatar Mar 27 '23 16:03 florisdipt

Would be good to understand what causes the issue.

Same here with Synology DSM, running latest or 2 same issue.

But running image: 'jc21/nginx-proxy-manager:2.9.22' fixed the issue for now

redtripleAAA avatar Mar 28 '23 05:03 redtripleAAA

I had this same issue when I tried to install the beta version of the 3.0. I did try to add the PUID and GUID of root but that did not solve the issue for version 3. But then I thought this is still development so.........

But now I have this same issue with version 2.10 I'm running nginx_pm on my Synology.

zandhaas avatar Mar 28 '23 05:03 zandhaas

problem solved please let me know thanks.

907739769 avatar Mar 28 '23 06:03 907739769

Please don't comment with just 'same here!'. I think it's clear that there is an issue with the latest release.

Perhaps you or someone else can give us an update on what is going on to solve this issue instead of giving us Thumb's down's Something like: " we see there is an error and we are looking into it. We expect to have a solutions in xx days"

And by the way: I think I added some extra information by telling the communicty that I see this exact same error in the new version 3 NGINX-PM

zandhaas avatar Mar 28 '23 06:03 zandhaas

I tried to test on CentOS 7 and Debian 10/11, this problem only happens on CentOS 7 system, not on Debian.

Maybe because of npmuser permissions, just guessing.

source: docker/rootfs/etc/s6-overlay/s6-rc.d/prepare/10-npmuser.sh

evanlabs avatar Mar 28 '23 06:03 evanlabs

I tried to test on CentOS 7 and Debian 10/11, this problem only happens on CentOS 7 system, not on Debian.

Are you talking about running directly inside the system without docker? Because i'm running debian + docker and still encountered the issue.

florisdipt avatar Mar 28 '23 08:03 florisdipt

Sorry, did not provide complete information. I use docker to do npm testing on centos and debian.

evanlabs avatar Mar 28 '23 09:03 evanlabs

The release notes mention this:

Adds support to run processes as a user/group, defined with PUID and PGID environment variables

    Detects if image is run with a user in docker command and fails if so

Users running 2.10.0 won't be able to run this container rootless apparently (as I've been doint with podman). Otherwise this message appears:

[user]$ podman logs -f nginx-test 
s6-rc: info: service s6rc-oneshot-runner: starting
s6-rc: info: service s6rc-oneshot-runner successfully started
s6-rc: info: service fix-attrs: starting
s6-rc: info: service fix-attrs successfully started
s6-rc: info: service legacy-cont-init: starting
s6-rc: info: service legacy-cont-init successfully started
s6-rc: info: service prepare: starting
--------------------------------------
ERROR: This docker container must be run as root, do not specify a user.
You can specify PUID and PGID env vars to run processes as that user and group after initialization.
--------------------------------------

And the container stops. Problem is, even when specifying PUID and PGID, the container shows the errors reported in this thread.

Maybe I don't understand well what the new configuration should be, based on the release notes. If running the container as root is now a requisite, that would be a shame for us rootless users.

Any pointers would be greatly appreciated.

Jojonintendo avatar Mar 28 '23 09:03 Jojonintendo

I tried to test on CentOS 7 and Debian 10/11, this problem only happens on CentOS 7 system, not on Debian.

Are you talking about running directly inside the system without docker? Because i'm running debian + docker and still encountered the issue.

I tried to modify the following s6 startup script, but it still didn't solve the problem

source: docker/rootfs/etc/s6-overlay/s6-rc.d/nginx/run 'exec s6-setuidgid npmuser nginx' => 'exec nginx'

evanlabs avatar Mar 28 '23 09:03 evanlabs

Same problem running docker on Synology DSM 7.1.1 with Portainer. Reverted back to 2.9.22 and problem resolved.

BobWs avatar Mar 28 '23 10:03 BobWs

nginx: [emerg] bind() to 0.0.0.0:80 failed (13: Permission denied) same ubuntu 22.x

Nazgile94 avatar Mar 28 '23 17:03 Nazgile94

Same issue

  • Synology DS918+
  • DSM 7.1.1-42962 Update 4

gabeosx avatar Mar 29 '23 01:03 gabeosx

This seems to be expected behavior. @maz1987in @Jojonintendo @Candinya @evanlabs

Release notes for 2.9.22 state: https://github.com/NginxProxyManager/nginx-proxy-manager/releases

v2.9.22

⚠️ The next release v2.10.0 will have changes that may adversely affect you, please pin your docker tag to 2.9.22 and upgrade after you conduct a full backup.

and

v2.10.0

⚠️ This release has changes that may adversely affect you, please pin your docker tag to the previous release 2.9.22 and upgrade after you conduct a full backup.

But I can't find anything about how to prevent this 'adverse affect'.

Copied my comment above from #2761 which appears to be the duplicate

Trolann avatar Mar 29 '23 05:03 Trolann

Same issue with the new image 2.10.1 I've tested the same as my previous comment, with PUID and PGID, and without them. The issue persists. I've also tried running the container with sudo, to no avail. So it doesn't seem to be only related to rootless containers.

Jojonintendo avatar Mar 29 '23 05:03 Jojonintendo

Same issue with the new image 2.10.1 I've tested the same as my previous comment, with PUID and PGID, and without them. The issue persists. I've also tried running the container with sudo, to no avail. So it doesn't seem to be only related to rootless containers.

Right, I also tried to install 2.10.1 to Synology 7.1.1, the result was same as before. Only 2.9.22 is the best way to me.

azchoi avatar Mar 29 '23 08:03 azchoi