hassio-addons/addon-nginx-proxy-manager

Crash after deleting certificate

Silther opened this issue · 10 comments

Problem/Motivation

Container is only crashing

Expected behavior

It shouldn't crash

Actual behavior

it crashes

Steps to reproduce

delete a SSL certificate

Logs

You are running the latest version of this add-on.
 System: Home Assistant OS 11.5  (aarch64 / raspberrypi4-64)
 Home Assistant Core: 2024.1.6
 Home Assistant Supervisor: 2024.01.1
-----------------------------------------------------------
 Please, share the above information when looking for help
 or support in, e.g., GitHub, forums or the Discord chat.
-----------------------------------------------------------
s6-rc: info: service base-addon-banner successfully started
s6-rc: info: service fix-attrs: starting
s6-rc: info: service base-addon-log-level: starting
s6-rc: info: service fix-attrs successfully started
s6-rc: info: service base-addon-log-level successfully started
s6-rc: info: service legacy-cont-init: starting
s6-rc: info: service legacy-cont-init successfully started
s6-rc: info: service init-npm: starting
s6-rc: info: service init-nginx: starting
s6-rc: info: service init-npm successfully started
s6-rc: info: service npm: starting
s6-rc: info: service npm successfully started
[23:35:54] INFO: Starting the Manager...
s6-rc: info: service init-nginx successfully started
s6-rc: info: service nginx: starting
s6-rc: info: service nginx successfully started
s6-rc: info: service legacy-services: starting
[23:35:54] INFO: Starting NGinx...
s6-rc: info: service legacy-services successfully started
nginx: [warn] protocol options redefined for 0.0.0.0:443 in /config/nginx/proxy_host/10.conf:14
nginx: [emerg] cannot load certificate "/etc/letsencrypt/live/npm-25/fullchain.pem": BIO_new_file() failed (SSL: error:80000002:system library::No such file or directory:calling fopen(/etc/letsencrypt/live/npm-25/fullchain.pem, r) error:10000080:BIO routines::no such file)
[23:35:54] INFO: Service NGINX exited with code 1 (by signal 0)
s6-rc: info: service legacy-services: stopping
s6-rc: info: service legacy-services successfully stopped
s6-rc: info: service nginx: stopping
s6-rc: info: service nginx successfully stopped
s6-rc: info: service init-nginx: stopping
s6-rc: info: service npm: stopping
s6-rc: info: service init-nginx successfully stopped
[23:35:55] INFO: Service Nginx Proxy Manager exited with code 256 (by signal 15)
s6-rc: info: service npm successfully stopped
s6-rc: info: service init-npm: stopping
s6-rc: info: service init-npm successfully stopped
s6-rc: info: service legacy-cont-init: stopping
s6-rc: info: service legacy-cont-init successfully stopped
s6-rc: info: service fix-attrs: stopping
s6-rc: info: service base-addon-log-level: stopping
s6-rc: info: service fix-attrs successfully stopped
s6-rc: info: service base-addon-log-level successfully stopped
s6-rc: info: service base-addon-banner: stopping
s6-rc: info: service base-addon-banner successfully stopped
s6-rc: info: service s6rc-oneshot-runner: stopping
s6-rc: info: service s6rc-oneshot-runner successfully stopped

not even reinstalling helps

How did you delete the certificate? If you want to start clean, make sure to delete the add-on config folder.

How did you delete the certificate?

Via the UI

delete the add-on config folder.

How do I do that?

not even reinstalling helps

An backup to the 0.x version and than an update did the trick, but it's still pretty strange.

delete a SSL certificate

maybe it happened because I closed the website while let's encrypt was downloading an certificate

I have the same behaviour, I cleaned up some old certs using the npm UI delete functionality. A restart later now wont start because its missing a certificate.

nginx: [emerg] cannot load certificate "/etc/letsencrypt/live/npm-11/fullchain.pem": BIO_new_file() failed (SSL: error:80000002:system library::No such file or directory:calling fopen(/etc/letsencrypt/live/npm-11/fullchain.pem, r) error:10000080:BIO routines::no such file)

The certs were still referened in the config files so I went through the addon_configs/a0d7b954_nginxproxymanger/nginx/ subdirectories to update the configs to the updated path.

I then also edited it in sqlite, where the proxy_host table still had entries using the old certificate id. Both of these together, to me suggest that I had forgotten to update the hosts in the UI to use the new certificate before deleting the old one.

When npm was starting, it was trying to load a cert that didnt exist but was still in configs

How did you delete the certificate? If you want to start clean, make sure to delete the add-on config folder.

Starting clean helped me, i.e.

cd /addon_configs
ls -la
rm -r [hash]_nginxproxymanager

Kind of a bummer to start from scratch again but hoping someone figures out a better solution to this

today I had the problem again, looks like you cannot delete a certificate without this addon crashing, luckily I had an old backup, but this has to be fixed

and even with the old backup I still get error 400 (#545)

There hasn't been any activity on this issue recently, so we clean up some of the older and inactive issues.
Please make sure to update to the latest version and check if that solves the issue. Let us know if that works for you by leaving a comment 👍
This issue has now been marked as stale and will be closed if no further activity occurs. Thanks!