NginxProxyManager / nginx-proxy-manager

Docker container for managing Nginx proxy hosts with a simple, powerful interface
https://nginxproxymanager.com
MIT License
22.99k stars 2.66k forks source link

[emerg] cannot load certificate #3969

Open Bluscream opened 2 months ago

Bluscream commented 2 months ago

Checklist

Describe the bug can be seen in the log below

Nginx Proxy Manager Version

2.11.3

To Reproduce Steps to reproduce the behavior:

  1. Go to certs
  2. Click on new cert
  3. use cloudflare
  4. click ok

Expected behavior new cert

Screenshots

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

    at /app/lib/utils.js:16:13
    at ChildProcess.exithandler (node:child_process:430:5)
    at ChildProcess.emit (node:events:519:28)
    at maybeClose (node:internal/child_process:1105:16)
    at Socket. (node:internal/child_process:457:11)
    at Socket.emit (node:events:519:28)
    at Pipe. (node:net:338:12)

Operating System raspbian latest

Additional context

totorus commented 1 month ago

Same bug, same errors.

biscottiman commented 1 month ago

Had the same issue. Turns out this is caused by proxy hosts I had which were still trying to load the SSL which was deleted. Was able to resolve it with:

  1. entered the container for nginx-app-1 docker exec -it nginx-app-1 bash
  2. recreated the folder in /etc/letsencrypt/live that was missing (in my case /npm3) mkdir /etc/letsencrypt/live/npm-3
  3. copied files from another live SSL cp /etc/letsencrypt/live/npm-5/fullchain.pem /etc/letsencrypt/live/npm-3/fullchain.pem cp /etc/letsencrypt/live/npm-5/privkey.pem /etc/letsencrypt/live/npm-3/privkey.pem
  4. Exit container exit
  5. Restart your container docker compose restart (if using docker compose and currently in the directory containing your docker compose file)

After that I was able to access the webui and remove the proxy hosts that were causing the issue. Remember to go back and clean up the files you created previously.