jlesage / docker-nginx-proxy-manager

Docker container for Nginx Proxy Manager
MIT License
770 stars 173 forks source link

Impossible to start container #224

Closed ohmaxx closed 2 years ago

ohmaxx commented 2 years ago

Hello,

I was refreshing all my certificates on my nginx-proxy-manager docker the first one was ok and then the second get me an error.

So i decide to reboot my docker to see if it was just a little "bug" but now i cant access to my docker webui i have these error in logs :

[nginx] starting... nginx: [emerg] cannot load certificate "/etc/letsencrypt/live/npm-31/fullchain.pem": BIO_new_file() failed (SSL: error:02001002:system library:fopen:No such file or directory:fopen('/etc/letsencrypt/live/npm-31/fullchain.pem','r') error:2006D080:BIO routines:BIO_new_file:no such file)

If someone can help me with these :)

thank you !

ch4ox commented 2 years ago

You probably deleted a certificate manually and had still attached the certificate in one of your proxy hosts. After restarting NPM the nginx configuration will still have links to the old cert but these files are now gone and that's what is causing your problem.

I had a similar problem once and I think I resolved it by temporarily copying another set of certificates to the folder where nginx is missing the certs.

Try something like this:

Try if that temporarily fixes things so you can restart NPM properly.

If you can login to NPM you should immediately find out which of your proxy hosts is npm-31 and unselect/remove SSL from that host. Then delete the temporary folder you copied: rm -R letsencrypt/live/npm-31

Now you should be ready to create a new certificate and attach it back to your proxy host. And remember: Don't delete certificates you still have attached to a proxy host in the future :)

Hope that helps!

ohmaxx commented 2 years ago

Hello @ch4ox !

Thanks for your asnwer, yes i thinks i have delete a certificate still attached to a proxy host so i will know for the future thanks.

I have try your solution to copy an archive folder into a new npm-31 folder in /live but when i reboot the docker i still have excatly the same message even if i have correctly copy and have the same file as an archive folder.

It's looks like the file in live are a link to the /archive/npm-x/files Capture

But i don't know how to create these link, do you have an idea ?

Thanks for your precious help

ch4ox commented 2 years ago

Ah sorry, you're right, the filenames are different. You could just rename those files so they don't have the "1" in their name anymore: mv cert1.pem cert.pem etc.

Another way would be to create those symbolic links but then you'd have to copy the folder in archive and link them manually with ln -s. I would go with the easy method first, so just rename those files :)

ohmaxx commented 2 years ago

Thanks a lot for your help !! Capture2

I did go the "hard way" with the ln -s config, know it's working again i have access to my gui !

Thanks a lot for your help couldn't have done it without you !

gregdotelphotography commented 1 year ago

You probably deleted a certificate manually and had still attached the certificate in one of your proxy hosts. After restarting NPM the nginx configuration will still have links to the old cert but these files are now gone and that's what is causing your problem.

I had a similar problem once and I think I resolved it by temporarily copying another set of certificates to the folder where nginx is missing the certs.

Try something like this:

  • go to ./letsencrypt/archive/ and hopefully you still have folders there with valid certs.
  • temporarily copy one of those folders to the now missing folder npm-31: cd letsencrypt/archive rm -R ../live/npm-31 cp [any folder] ../live/npm-31

Try if that temporarily fixes things so you can restart NPM properly.

If you can login to NPM you should immediately find out which of your proxy hosts is npm-31 and unselect/remove SSL from that host. Then delete the temporary folder you copied: rm -R letsencrypt/live/npm-31

Now you should be ready to create a new certificate and attach it back to your proxy host. And remember: Don't delete certificates you still have attached to a proxy host in the future :)

Hope that helps!

I was having this same issue and this answer worked for me.

This was my error: npm | ❯ Starting nginx ... npm | nginx: [emerg] cannot load certificate "/etc/letsencrypt/live/npm-33/fullchain.pem": BIO_new_file() failed (SSL: error:02001002:system library:fopen:No such file or directory:fopen('/etc/letsencrypt/live/npm-33/fullchain.pem','r') error:2006D080:BIO routines:BIO_new_file:no such file)

After copying the folder everything started running again.