Let's Encrypt Auto Renew Fails

I followed this tutorial:

I got to the part where the command is ./letsencrypt-auto and it returns this:

Failed authorization procedure. (http-01): urn:acme:error:unauthorized :: The client lacks sufficient authorization :: Invalid response from [server_ip]: 404, (http-01): urn:acme:error:unauthorized :: The client lacks sufficient authorization :: Invalid response from [server_ip]: 404

 - The following errors were reported by the server:

   Type:   unauthorized
   Detail: Invalid response from
   [server_ip]: 404

   Type:   unauthorized
   Detail: Invalid response from
   [server_ip]: 404

The site redirects to https automatically using nginx config, and this error is returned whenever i run the renewal command.

The directory .well-known exists on the server, even in the browser it returns 404, which I don’t know why.

Show comments

Submit an answer

This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

Sign In or Sign Up to Answer

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Want to learn more? Join the DigitalOcean Community!

Join our DigitalOcean community of over a million developers for free! Get help and share knowledge in Q&A, subscribe to topics of interest, and get courses and tools that will help you grow as a developer and scale your project or business.

Solve issue of the same exact error message and 404 as @mrparker had. What I did was:

  1. realized I was missing a .well-known folder for some reason, so I added an empty one with mkdir .well-known
  2. ran sudo letsencrypt certonly -a webroot --webroot-path=/var/www/html -d -d and it renewed it properly and gave me the “congrats!” message
  3. then I sudo service nginx reload and then sudo letsencrypt renew --force-renew and I no longer got the 404 error for the renew, then did sudo service nginx reload again

Hope this helps someone.

I had exactly same problem and all my attempts to renew failed. I run this and it renewed my certificate:

/root/certbot-auto renew --force-renew

The interesting part is that my certificate was expired 100% but when I run plain renew I had the following message:

/root/certbot-auto renew
Saving debug log to /var/log/letsencrypt/letsencrypt.log

Processing /etc/letsencrypt/renewal/
Cert not yet due for renewal

The following certs are not due for renewal yet:
  /etc/letsencrypt/live/ (skipped)
No renewals were attempted.

I suspect there is a bug with letsencrypt yet.

more a suggestion than an answer: It sucks if the renewal breaks and you don’t realise.

I wrote to let you monitor your SSL certificates. It warns you if they get close to expiry. That way if something goes wrong in future, you’ll be notified.

and yes, it uses Let’s Encrypt and is hosted on DO :)