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

Unable to start after update: address already in use

Open jubiman opened this issue 6 months ago • 7 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

After watchtowerr updated nginx proxy manager overnight to the latest version, npm has been unable to start. I get the following logs:

app-1  | ❯ Starting nginx ...
app-1  | nginx: [emerg] bind() to 0.0.0.0:443 failed (98: Address already in use)
app-1  | nginx: [emerg] bind() to [::]:443 failed (98: Address already in use)
app-1  | nginx: [emerg] bind() to 0.0.0.0:443 failed (98: Address already in use)
app-1  | nginx: [emerg] bind() to [::]:443 failed (98: Address already in use)
app-1  | nginx: [emerg] bind() to 0.0.0.0:443 failed (98: Address already in use)
app-1  | nginx: [emerg] bind() to [::]:443 failed (98: Address already in use)
app-1  | nginx: [emerg] bind() to 0.0.0.0:443 failed (98: Address already in use)
app-1  | nginx: [emerg] bind() to [::]:443 failed (98: Address already in use)
app-1  | nginx: [emerg] bind() to 0.0.0.0:443 failed (98: Address already in use)
app-1  | nginx: [emerg] bind() to [::]:443 failed (98: Address already in use)
app-1  | nginx: [emerg] still could not bind()

I've been using npm for a while now. At first I got some deprecation warnings, but removing those didn't solve the issue. I can assure you that the output of sudo netstat -tulpn | grep 443 returns nothing so the port is not in use. I also cannot find it in use using other methods of checking ports.

Nginx Proxy Manager Version

I have no login page, but I can see in the watchtowerr logs that it updated today (June 1st). It is thus probably v2.15.0. watchtowerr logs

time="2026-06-01T01:01:54+00:00" level=info msg="Found new jc21/nginx-proxy-manager:latest image (31837cb7369e)"
time="2026-06-01T01:01:55+00:00" level=info msg="Stopping /npm-app-1 (736162eea118) with SIGTERM"
time="2026-06-01T01:02:01+00:00" level=info msg="Creating /npm-app-1"
time="2026-06-01T01:02:03+00:00" level=info msg="Removing image e3f9fd85ccab"
time="2026-06-01T01:02:12+00:00" level=info msg="Session done" Failed=0 Scanned=13 Updated=1 notify=no

I have also tried rebooting the vps but that hasn't solved the issue

To Reproduce Steps to reproduce the behavior:

  1. Have watchtowerr update npm
  2. Be unable to restart the

Expected behavior

Npm starting up as normal.

Operating System

Ubuntu 22.04.5 LTS with 5.15.0-179-generic I use docker compose to run npm:

services:
  app:
    image: 'jc21/nginx-proxy-manager:latest'
    restart: always
    ports:
      - '80:80'
      - '81:81'
      - '443:443'
    volumes:
      - ./data:/data
      - ./letsencrypt:/etc/letsencrypt
      - /var:/var
    networks:
      npm_network:
        ipv4_address: 172.29.0.32

networks:
  npm_network:
    external: true
    name: npm_network

Additional context

I've tried downgrading to v2.14.0 (which I am guessing was my previous version), but this also starts with the same bind error.

Edit: I expected downgrading to fix the issue, but forgot to change the text when it turned out it didn't.

jubiman avatar Jun 01 '26 10:06 jubiman

Same. Just updated to 2.15.0. Start-up fails. Here's docker logs output:

❯ Configuring npm user ...
useradd warning: npm's uid 0 outside of the UID_MIN 1000 and UID_MAX 60000 range.
❯ Configuring npm group ...
❯ Checking paths ...
❯ Setting ownership ...
- /data ...
    SKIPPED
- /etc/letsencrypt ...
    SKIPPED
- /run/nginx ...
    SKIPPED
- /tmp/nginx ...
    SKIPPED
- /var/cache/nginx ...
    SKIPPED
- /var/lib/logrotate ...
    SKIPPED
- /var/lib/nginx ...
    SKIPPED
- /var/log/nginx ...
    SKIPPED
- /etc/nginx/nginx ...
    SKIPPED
- /etc/nginx/nginx.conf ...
    SKIPPED
- /etc/nginx/conf.d ...
    SKIPPED
❯ Changing ownership of certbot directories, this may take some time ...
- /opt/certbot ...
    SKIPPED
- /opt/certbot/bin ...
    SKIPPED
- /opt/certbot/lib/python3.13/site-packages ...
    SKIPPED
❯ Dynamic resolvers ...
❯ IPv6 ...
Enabling IPV6 in hosts in: /etc/nginx/conf.d
- /etc/nginx/conf.d/include/force-ssl.conf
mv: cannot move '/etc/nginx/conf.d/include/force-ssl.conf.tmp' to '/etc/nginx/conf.d/include/force-ssl.conf': Device or resource busy
s6-rc: warning: unable to start service prepare: command exited 1
/run/s6/basedir/scripts/rc.init: warning: s6-rc failed to properly bring all the services up! Check your logs (in /run/uncaught-logs/current if you have in-container logging) for more information.

Reverting to 2.14.0 does work though.

abesnier avatar Jun 01 '26 10:06 abesnier

Also reverted to 2.14.0, same bug as @abesnier

gagnfra avatar Jun 01 '26 13:06 gagnfra

Sort of same issue (i.e. cannot start) however my logs are failing in a differnt place:

npm | - /data/nginx/proxy_host/18.conf npm | - /data/nginx/proxy_host/29.conf npm | - /data/nginx/proxy_host/7.conf npm | - /data/nginx/custom/server_proxy.conf npm | mv: cannot move '/data/nginx/custom/server_proxy.conf.tmp' to '/data/nginx/custom/server_proxy.conf': Device or resource busy npm | s6-rc: warning: unable to start service prepare: command exited 1 npm | /run/s6/basedir/scripts/rc.init: warning: s6-rc failed to properly bring all the services up! Check your logs (in /run/uncaught-logs/current if you have in-container logging) for more information.

classicspam avatar Jun 01 '26 13:06 classicspam

Same here, still witha different error. It feels as it's was trying to setup a new database rather than use the existing

STDOUT
❯ Configuring npm user ...
06/01/2026, 05:47:59 PM app-1 STDOUT
useradd warning: npm's uid 0 outside of the UID_MIN 1000 and UID_MAX 60000 range.
06/01/2026, 05:48:00 PM app-1 STDOUT
❯ Configuring npm group ...
06/01/2026, 05:48:00 PM app-1 STDOUT
❯ Checking paths ...
06/01/2026, 05:48:00 PM app-1 STDOUT
❯ Setting ownership ...
06/01/2026, 05:48:00 PM app-1 STDOUT
- /data ...
06/01/2026, 05:48:00 PM app-1 STDOUT
    SKIPPED
06/01/2026, 05:48:00 PM app-1 STDOUT
- /etc/letsencrypt ...
06/01/2026, 05:48:00 PM app-1 STDOUT
    SKIPPED
06/01/2026, 05:48:00 PM app-1 STDOUT
- /run/nginx ...
06/01/2026, 05:48:00 PM app-1 STDOUT
    SKIPPED
06/01/2026, 05:48:00 PM app-1 STDOUT
- /tmp/nginx ...
06/01/2026, 05:48:00 PM app-1 STDOUT
    SKIPPED
06/01/2026, 05:48:00 PM app-1 STDOUT
- /var/cache/nginx ...
06/01/2026, 05:48:00 PM app-1 STDOUT
    SKIPPED
06/01/2026, 05:48:00 PM app-1 STDOUT
- /var/lib/logrotate ...
06/01/2026, 05:48:00 PM app-1 STDOUT
    SKIPPED
06/01/2026, 05:48:00 PM app-1 STDOUT
- /var/lib/nginx ...
06/01/2026, 05:48:00 PM app-1 STDOUT
    SKIPPED
06/01/2026, 05:48:00 PM app-1 STDOUT
- /var/log/nginx ...
06/01/2026, 05:48:00 PM app-1 STDOUT
    SKIPPED
06/01/2026, 05:48:00 PM app-1 STDOUT
- /etc/nginx/nginx ...
06/01/2026, 05:48:00 PM app-1 STDOUT
    SKIPPED
06/01/2026, 05:48:00 PM app-1 STDOUT
- /etc/nginx/nginx.conf ...
06/01/2026, 05:48:00 PM app-1 STDOUT
    SKIPPED
06/01/2026, 05:48:00 PM app-1 STDOUT
- /etc/nginx/conf.d ...
06/01/2026, 05:48:00 PM app-1 STDOUT
    SKIPPED
06/01/2026, 05:48:00 PM app-1 STDOUT
❯ Changing ownership of certbot directories, this may take some time ...
06/01/2026, 05:48:00 PM app-1 STDOUT
- /opt/certbot ...
06/01/2026, 05:48:00 PM app-1 STDOUT
    SKIPPED
06/01/2026, 05:48:00 PM app-1 STDOUT
- /opt/certbot/bin ...
06/01/2026, 05:48:00 PM app-1 STDOUT
    SKIPPED
06/01/2026, 05:48:00 PM app-1 STDOUT
- /opt/certbot/lib/python3.13/site-packages ...
06/01/2026, 05:48:00 PM app-1 STDOUT
    SKIPPED
06/01/2026, 05:48:00 PM app-1 STDOUT
❯ Dynamic resolvers ...
06/01/2026, 05:48:00 PM app-1 STDOUT
❯ IPv6 ...
06/01/2026, 05:48:00 PM app-1 STDOUT
Enabling IPV6 in hosts in: /etc/nginx/conf.d
06/01/2026, 05:48:00 PM app-1 STDOUT
- /etc/nginx/conf.d/production.conf
06/01/2026, 05:48:00 PM app-1 STDOUT
- /etc/nginx/conf.d/include/log-proxy.conf
06/01/2026, 05:48:00 PM app-1 STDOUT
- /etc/nginx/conf.d/include/letsencrypt-acme-challenge.conf
06/01/2026, 05:48:00 PM app-1 STDOUT
- /etc/nginx/conf.d/include/log-stream.conf
06/01/2026, 05:48:00 PM app-1 STDOUT
- /etc/nginx/conf.d/include/force-ssl.conf
06/01/2026, 05:48:00 PM app-1 STDOUT
- /etc/nginx/conf.d/include/ssl-cache.conf
06/01/2026, 05:48:00 PM app-1 STDOUT
- /etc/nginx/conf.d/include/block-exploits.conf
06/01/2026, 05:48:00 PM app-1 STDOUT
- /etc/nginx/conf.d/include/ssl-ciphers.conf
06/01/2026, 05:48:00 PM app-1 STDOUT
- /etc/nginx/conf.d/include/proxy.conf
06/01/2026, 05:48:00 PM app-1 STDOUT
- /etc/nginx/conf.d/include/ssl-cache-stream.conf
06/01/2026, 05:48:00 PM app-1 STDOUT
- /etc/nginx/conf.d/include/assets.conf
06/01/2026, 05:48:00 PM app-1 STDOUT
- /etc/nginx/conf.d/include/ip_ranges.conf
06/01/2026, 05:48:00 PM app-1 STDOUT
- /etc/nginx/conf.d/include/resolvers.conf
06/01/2026, 05:48:00 PM app-1 STDOUT
- /etc/nginx/conf.d/default.conf
06/01/2026, 05:48:00 PM app-1 STDOUT
Enabling IPV6 in hosts in: /data/nginx
06/01/2026, 05:48:00 PM app-1 STDOUT
- /data/nginx/default_host/site.conf
06/01/2026, 05:48:00 PM app-1 STDOUT
- /data/nginx/proxy_host/9
06/01/2026, 05:48:00 PM app-1 STDOUT
- -
06/01/2026, 05:48:00 PM app-1 STDOUT
WARNING: skipping - — sed produced empty output
06/01/2026, 05:48:00 PM app-1 STDOUT
rm: invalid option -- '.'
06/01/2026, 05:48:00 PM app-1 STDOUT
Try 'rm ./-.tmp' to remove the file '-.tmp'.
06/01/2026, 05:48:00 PM app-1 STDOUT
Try 'rm --help' for more information.
06/01/2026, 05:48:00 PM app-1 STDOUT
s6-rc: warning: unable to start service prepare: command exited 1
06/01/2026, 05:48:00 PM app-1 STDOUT
/run/s6/basedir/scripts/rc.init: warning: s6-rc failed to properly bring all the services up! Check your logs (in /run/uncaught-logs/current if you have in-container logging) for more information.

yannou38 avatar Jun 01 '26 15:06 yannou38

Can we stop clogging this issue with unrelated errors? Unless a maintainer says it's okay, it makes no sense. I'll update the title to make it a bit more concise to prevent these general "its not working" comments. My bad on the title

jubiman avatar Jun 01 '26 16:06 jubiman

  1. With the address in use errors, that's something you'll need to debug yourself.
  • Stop the npm container
  • See what's running on those ports

FWIW I've deployed 2.15.0 in multiple places both fresh and existing instances without this issue. The only yellow flag is ipv4_address: 172.29.0.32 in your docker compose file 🤷‍♂️ And if you said 2.14.0 doesn't work anymore, likely not a issue with NPM

  1. For tmp move errors, this is introduced in #5334 and @yannou38 has found a bug, but I cannot reproduce Device or resource busy errors. And yes, creating a different Issue for these would be nice thanks

jc21 avatar Jun 01 '26 22:06 jc21

I have tried debugging this myself, and my first thought was indeed "something must be using the port". However, when I stop the container and run sudo netstat -tulpn | grep 443 I get nothing. The closes thing I can find on the internet is this stackoverflow post, which has some iffy information (about the ipv6only=on thing), but even in a hail mary attempt this didn't help.

The ip address is on a docker network because some containers need to know a trusted proxy (and can't use docker's hostname resolver), and you can't 'reserve' an ip on a docker network to my knowledge. This has not caused any issues so far.

The fact that 2.14.0 doesn't work either is indeed odd. It worked before I went to bed... okay I fixed it


I will explain briefly what was the issue and thanks for being my rubber ducky :) Before I went to bed I played around a bit with proxy hosts and streams. I had some trouble redirecting a mixed-content webpage and played around a little. I then made a tcp stream on port 443 to see if that would work. It didn't work, but there were also no errors or anything so I shelved it for the night and went to bed. During the night, watchtowerr updated the container, and thus restarted it. Now there was some conflict between the stream on port 443 and npm's nginx trying to bind to 443. Simply removing the stream config file from data/nginx/stream/ fixed it.

jubiman avatar Jun 01 '26 23:06 jubiman