Nginx: [emerg] open() "/etc/letsencrypt/le_http_01_cert_challenge.conf" failed (2: No such file or directory) in /etc/nginx/nginx.conf:12

I had to unplug my server in the middle of a TLS certification renewal and now I’m getting this error, I’m not sure what I can do to fix it…

Waiting for verification...
Cleaning up challenges
nginx: [emerg] open() "/etc/letsencrypt/le_http_01_cert_challenge.conf" failed (2: No such file or directory) in /etc/nginx/nginx.conf:12
Encountered exception during recovery:
Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/certbot/error_handler.py", line 108, in _call_registered
    self.funcs[-1]()
  File "/usr/lib/python3/dist-packages/certbot/auth_handler.py", line 323, in _cleanup_challenges
    self.auth.cleanup(achalls)
  File "/usr/lib/python3/dist-packages/certbot_nginx/configurator.py", line 1090, in cleanup
    self.restart()
  File "/usr/lib/python3/dist-packages/certbot_nginx/configurator.py", line 881, in restart
    nginx_restart(self.conf('ctl'), self.nginx_conf)
  File "/usr/lib/python3/dist-packages/certbot_nginx/configurator.py", line 1141, in nginx_restart
    "nginx restart failed:\n%s\n%s" % (out.read(), err.read()))
certbot.errors.MisconfigurationError: nginx restart failed:
b''
b''
Using default addresses 80 and [::]:80 ipv6only=on for authentication.
nginx: [warn] conflicting server name "games.4evergaming.com" on 0.0.0.0:80, ignored
nginx: [warn] conflicting server name "games.4evergaming.com" on [::]:80, ignored
Waiting for verification...
1 Like

Hi @martinszeltins

checking that domain:

4everGaming.com is for sale

Looks like you aren't the domain owner, so you can't create a certificate.

1 Like

@JuergenAuer I didn’t want to expose my actual domain, so I used an example domain instead.

You should probably correct any errors in your nginx config. I assume certbot wrote something there and it stayed there after you powered the machine back on. There should be lockfiles too...

certbot --nginx rollback can be an option

@9peppe I tried the rollback and it showed this…

Error while running nginx -c /etc/nginx/nginx.conf -t.

nginx: [emerg] open() "/etc/letsencrypt/le_http_01_cert_challenge.conf" failed (2: No such file or directory) in /etc/nginx/nginx.conf:12
nginx: configuration file /etc/nginx/nginx.conf test failed

edit this file, comment out the offending lines.

1 Like

@9peppe Thanks, I removed the include lines from /etc/nginx/nginx.conf that it couldn’t find and it seems like it solved the problem, it’s working now!

1 Like

there can be other similar leftovers, check your config

1 Like

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