MisconfigurationError: How to start a new clean renewal?

I made a mistake.

I first successfully renewed the certificate:

(base) marco@pc01:~$ sudo certbot --nginx
[sudo] password for marco: 
Saving debug log to /var/log/letsencrypt/letsencrypt.log
Plugins selected: Authenticator nginx, Installer nginx

Which names would you like to activate HTTPS for?
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
1: ggc.world
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Select the appropriate numbers separated by commas and/or spaces, or leave input
blank to select all options shown (Enter 'c' to cancel): 
Obtaining a new certificate
Deploying Certificate to VirtualHost /etc/nginx/conf.d/default.conf

Please choose whether or not to redirect HTTP traffic to HTTPS, removing HTTP access.
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
1: No redirect - Make no further changes to the webserver configuration.
2: Redirect - Make all requests redirect to secure HTTPS access. Choose this for
new sites, or if you're confident your site works on HTTPS. You can undo this
change by editing your web server's configuration.
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Select the appropriate number [1-2] then [enter] (press 'c' to cancel): 2
Redirecting all traffic on port 80 to ssl in /etc/nginx/conf.d/default.conf

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Congratulations! You have successfully enabled https://ggc.world

You should test your configuration at:
https://www.ssllabs.com/ssltest/analyze.html?d=ggc.world
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

IMPORTANT NOTES:
 - Congratulations! Your certificate and chain have been saved at:
   /etc/letsencrypt/live/ggc.world-0001/fullchain.pem
   Your key file has been saved at:
   /etc/letsencrypt/live/ggc.world-0001/privkey.pem
   Your cert will expire on 2020-08-05. To obtain a new or tweaked
   version of this certificate in the future, simply run certbot again
   with the "certonly" option. To non-interactively renew *all* of
   your certificates, run "certbot renew"

certbot --version
certbot 0.31.0

But, seeing that there were two folders ggc.world and ggc.world-0001 , I decided to remove them all and start again the process.
And now, due to this mistake, I’m getting this error:

(base) marco@pc01:~$ sudo certbot --nginx
Saving debug log to /var/log/letsencrypt/letsencrypt.log
Error while running nginx -c /etc/nginx/nginx.conf -t.

nginx: [emerg] BIO_new_file("/etc/letsencrypt/live/ggc.world-0001/fullchain.pem") failed (SSL:    
error:02001002:system library:fopen:No such file or directory:fopen('/etc/letsencrypt/live/ggc.world- 
0001/fullchain.pem','r') error:2006D080:BIO routines:BIO_new_file:no such file)
nginx: configuration file /etc/nginx/nginx.conf test failed

The nginx plugin is not working; there may be problems with your existing configuration.
The error was: MisconfigurationError('Error while running nginx -c /etc/nginx/nginx.conf -t.\n\nnginx:   
[emerg] BIO_new_file("/etc/letsencrypt/live/ggc.world-0001/fullchain.pem") failed (SSL:  
error:02001002:system library:fopen:No such file or directory:fopen(\'/etc/letsencrypt/live/ggc.world-
0001/fullchain.pem\',\'r\') error:2006D080:BIO routines:BIO_new_file:no such file)\nnginx:   
configuration file /etc/nginx/nginx.conf test failed\n',)
(base) marco@pc01:~$ 

How to solve the problem?
Looking forward to your kind help.
Marco

1 Like

I solved it by removing these lines from /etc/nginx/conf.d/default.conf file

ssl_certificate /etc/letsencrypt/live/ggc.world-0001/fullchain.pem; # managed by Certbot
ssl_certificate_key /etc/letsencrypt/live/ggc.world-0001/privkey.pem; # managed by Certbot
1 Like

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