Certbot interactive works non-interactive fails

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. https://crt.sh/?q=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:media.deeztek.com

I ran this command:
/usr/bin/certbot certonly --noninteractive --nginx --agree-tos --register-unsafely-without-email -d media.deeztek.com -w /var/www/html/media.deeztek.com

It produced this output: 2019-12-30 09:50:41,302:DEBUG:certbot.reporter:Reporting to user: The following errors were reported by the server:

Domain: media.deeztek.com
Type: unauthorized
Detail: Invalid response from http://media.deeztek.com/.well-known/acme-challenge/DefbL70SFvjMRnOKb4jy33zdsQaBWCPT80mqLU5SK10 [71.179.58.32]: “\r\n404 Not Found\r\n\r\n

404 Not Found

\r\n
nginx/1.16.1</ce”

To fix these errors, please make sure that your domain name was entered correctly and the DNS A/AAAA record(s) for that domain contain(s) the right IP address.
2019-12-30 09:50:41,302:DEBUG:certbot.error_handler:Encountered exception:
Traceback (most recent call last):
File “/usr/lib/python3/dist-packages/certbot/auth_handler.py”, line 82, in handle_authorizations
self._respond(aauthzrs, resp, best_effort)
File “/usr/lib/python3/dist-packages/certbot/auth_handler.py”, line 168, in _respond
self._poll_challenges(aauthzrs, chall_update, best_effort)
File “/usr/lib/python3/dist-packages/certbot/auth_handler.py”, line 239, in _poll_challenges
raise errors.FailedChallenges(all_failed_achalls)
certbot.errors.FailedChallenges: Failed authorization procedure. media.deeztek.com (http-01): urn:ietf:params:acme:error:unauthorized :: The client lacks sufficient authorization :: Invalid response from http://media.deeztek.com/.well-known/acme-challenge/DefbL70SFvjMRnOKb4jy33zdsQaBWCPT80mqLU5SK10 [71.179.58.32]: “\r\n404 Not Found\r\n\r\n

404 Not Found

\r\n
nginx/1.16.1</ce”

My web server is (include version): Nginx 1.16.1

The operating system my web server runs on is (include version): Ubuntu 18.04

My hosting provider, if applicable, is: N/A

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):

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

I’ve created /var/www/html/media.deeztek.com/.well-known/acme-challenge/ directory. I set permissions to 755 and I created a test html file in it and I was able to browse to it successfully.

If I run certbot interactively, it works fine and it issues certificate.

Hi,

Form my viewpoint, there’s always an error said “can’t find the specific file” instead of the 404 NOT FOUND error.
Can you create a dummy file in the correct path and see if the file can be opened from the link?

Thank you

Note that --nginx mode does not use the -w argument. The nginx plugin parses and modifies your Nginx configuration in order to serve the challenge. It may place a challenge file somewhere else, or it may not even create a file on disk at all.

Do you have any idea why Certbot would not be successfully understanding or modifying the configuration?

Certbot logs what it’s doing. When running interactively, you can also use the --debug-challenges option to have it pause it in the middle so you can get a look at what it did.

Exactly what interactive command are you running?

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