Improper deletion of certificates: How do i fix nginx: [emerg] cannot load certificate "/etc/letsencrypt/live/mydomain-0002/fullchain.pem

Please fill out the fields below so we can help you better. Note: you must provide your domain name to get help. Domain names for issued certificates are all made public in Certificate Transparency logs (e.g. crt.sh | example.com), so withholding your domain name here does not increase secrecy, but only makes it harder for us to provide help.

My domain is: eslpassport.com

I ran this command: certbot

It produced this output: nginx: [emerg] cannot load certificate "/etc/letsencrypt/live/eslpassport.com-0002/fullchain.pem": BIO_new_file() failed (SSL: error:02001002:system library:fopen:No such file or directory:fopen('/etc/letsencrypt/live/eslpassport.com-0002/fullchain.pem','r') error:2006D080:BIO routines:BIO_new_file:no such file)
nginx: configuration file /etc/nginx/nginx.conf test failed

My web server is (include version): nginx/1.19.8

The operating system my web server runs on is (include version): CentOS 8

My hosting provider, if applicable, is: Digital Ocean (droplet)

I can login to a root shell on my machine (yes or no, or I don't know): Yes

I'm using a control panel to manage my site (no, or provide the name and version of the control panel): no

The version of my client is (e.g. output of certbot --version or certbot-auto --version if you're using Certbot): certbot 1.24.0

Hi @chryobe and welcome to the LE community forum :slight_smile:

You can remove the vhost that's using that deleted cert OR temporarily switch the file name to an existing cert.

2 Likes

Or recover the deleted certificate from a recent backup.

3 Likes

Thanks for the response. Tried removing the vhost and it eliminated the previous errors but im now hit with this one when i try to request for a new certificate

Could not automatically find a matching server block for eslpassport.com. Set the server_name directive to use the Nginx installer.

1 Like

unfortunately i couldnt locate a recent backup

Then you may have removed more than necessary.
Note: I gave you two options [neither of which asked to remove any HTTP vhost]

2 Likes

For clarity:
One vhost config file can contain more than one vhost config (server section).

2 Likes

I see, i am really new at this but yes, thanks for the help. i was able to fix it by removing the vhost that required the deleted certificates like you said

2 Likes

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.