Error message - renewing Lets Encrypt via Terminal

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: www.twintec.com

I ran this command: $ sudo certbot renew --dry-run

It produced this output:

Waiting for verification…
Cleaning up challenges
Unable to clean up challenge directory /var/www/html/.well-known/acme-challenge
Attempting to renew cert (www.twintec.com) from /etc/letsencrypt/renewal/www.twintec.com.conf produced an unexpected error: Failed authorization procedure. sample.twintec.com (http-01): urn:acme:error:connection :: The server could not connect to the client to verify the domain :: Fetching https://sample.twintec.com/.well-known/acme-challenge/fD6j22HUG7Z-DVQ5xlakko0UhvFq23ZxKjTC2pVt7Ik: Error getting validation data. Skipping.
All renewal attempts failed. The following certs could not be renewed:
/etc/letsencrypt/live/www.twintec.com/fullchain.pem (failure)


** DRY RUN: simulating ‘certbot renew’ close to cert expiry
** (The test certificates below have not been saved.)

All renewal attempts failed. The following certs could not be renewed:
/etc/letsencrypt/live/www.twintec.com/fullchain.pem (failure)
** DRY RUN: simulating ‘certbot renew’ close to cert expiry
** (The test certificates above have not been saved.)

1 renew failure(s), 0 parse failure(s)

IMPORTANT NOTES:

  • The following errors were reported by the server:

    Domain: sample.twintec.com
    Type: connection
    Detail: Fetching
    https://sample.twintec.com/.well-known/acme-challenge/fD6j22HUG7Z-DVQ5xlakko0UhvFq23ZxKjTC2pVt7Ik:
    Error getting validation data

    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. Additionally, please check that
    your computer has a publicly routable IP address and that no
    firewalls are preventing the server from communicating with the
    client. If you’re using the webroot plugin, you should also verify
    that you are serving files from the webroot path you provided.

My web server is (include version): (GNU/Linux 4.4.0-1013-aws x86_64)

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

My hosting provider, if applicable, is: AWS

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

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

I’m seeing some redirects that may not be set correctly…
Please place a test.txt file in the challenge folder.

Afraid I am very new to CLI, is it possible to do this via terminal and if so can you please provide the commands? Thanks.

just create the challenge test file therein:
create the directories along the path (in case they have been removed):
mkdir /var/www/html/.well-known/
mkdir /var/www/html/.well-known/acme-challenge/
and then create the test file:
echo 'test file' > /var/www/html/.well-known/acme-challenge/test.txt
make sure it is there:
ls -l /var/www/html/.well-known/acme-challenge/
then test it from the Internet:
http://www.twintec.com/.well-known/acme-challenge/test.txt

The folders are there, I tried to create the file but permission was denied.

$ echo 'test file' > /var/www/html/.well-known/acme-challenge/test.txt
-bash: /var/www/html/.well-known/acme-challenge/test.txt: Permission denied

You have to create the file as root user.

Another silly question - how can I do that please?

Normally you can run individual commands as root by prefixing them with sudo.

In the specific case of the echo ‘test file’ > /var/www/html/.well-known/acme-challenge/test.txt command that @rg305 suggested, prefixing it with sudo won’t work for reasons that I suggest you look into when you have more command line background. :slight_smile:

Instead, you can get a root shell with sudo -s and then enter all of the commands into that root shell. Then they will all run as root.

At the moment, there seems to be a redirect loop:

http://sample.twintec.com/.well-known/acme-challenge/fD6j22HUG7Z-DVQ5xlakko0UhvFq23ZxKjTC2pVt7Ik redirects to https://sample.twintec.com/.well-known/acme-challenge/fD6j22HUG7Z-DVQ5xlakko0UhvFq23ZxKjTC2pVt7Ik (from an Nginx server)

https://sample.twintec.com/.well-known/acme-challenge/fD6j22HUG7Z-DVQ5xlakko0UhvFq23ZxKjTC2pVt7Ik redirects to http://sample.twintec.com/.well-known/acme-challenge/fD6j22HUG7Z-DVQ5xlakko0UhvFq23ZxKjTC2pVt7Ik (possibly from Cloudflare)

Thanks for the responses - I’ll look into this tomorrow and see what else I can find.

Hello all - here’s the latest update.

I created the test.txt in /var/www/html/.well-known/acme-challenge/test.txt

And I can hit it via https://twintec.com/.well-known/acme-challenge/test.txt

There’s something weird going on, as the errors above describe sample.twintec.com instead of twintec.com. could this be a rogue redirect somewhere?

Regarding the apparent redirect loop mnordhoff caught, could this be causing the renewal to fail?

Thanks guys.

Tried the renew dry run again this morning and it’s producing the following error:

# sudo certbot renew --dry-run
Saving debug log to /var/log/letsencrypt/letsencrypt.log

-------------------------------------------------------------------------------
Processing /etc/letsencrypt/renewal/www.twintec.com.conf
-------------------------------------------------------------------------------
Cert is due for renewal, auto-renewing…
Plugins selected: Authenticator webroot, Installer None
Renewing an existing certificate
Attempting to renew cert (www.twintec.com) from /etc/letsencrypt/renewal/www.twintec.com.conf produced an unexpected error: (4, ‘Interrupted system call’). Skipping.
All renewal attempts failed. The following certs could not be renewed:
_ /etc/letsencrypt/live/www.twintec.com/fullchain.pem (failure)_

-------------------------------------------------------------------------------
** DRY RUN: simulating ‘certbot renew’ close to cert expiry
** (The test certificates below have not been saved.)

All renewal attempts failed. The following certs could not be renewed:
_ /etc/letsencrypt/live/www.twintec.com/fullchain.pem (failure)_
** DRY RUN: simulating ‘certbot renew’ close to cert expiry
** (The test certificates above have not been saved.)
-------------------------------------------------------------------------------
1 renew failure(s), 0 parse failure(s)

Wow!
Check the log file for more details.
If it lacks good detail, try adding debug:
sudo certbot renew --dry-run -debug
and show the
/var/log/letsencrypt/letsencrypt.log

hi team

can anyone help me in this . i have configured my web on which is up and running .Now i am going to install SSL its shows error.

[root@localhost conf.d]# certbot --apache
Saving debug log to /var/log/letsencrypt/letsencrypt.log
Plugins selected: Authenticator apache, Installer apache
Starting new HTTPS connection (1): acme-v01.api.letsencrypt.org
No names were found in your configuration files. Please enter in your domain
name(s) (comma and/or space separated) (Enter ‘c’ to cancel): xxx.xxx.xxx
Obtaining a new certificate
Resetting dropped connection: acme-v01.api.letsencrypt.org
Performing the following challenges:
http-01 challenge for xxx.xxx.xxx
Cleaning up challenges
Unable to find a virtual host listening on port 80 which is currently needed for Certbot to prove to the CA that you control your domain. Please add a virtual host for port 80.

fayazlinux@gmail.com

You must use a domain that being served by apache.

i type manually my domain name.

Is your web server working on port 80?
Can you see your website from the Internet (via port 80)?

Please open a separate thread for your case.

yes i can see. its working fine.

But when ever i am going to install SSL its show me error.

open a separate thread for your specific problem please.
This thread was opened by @Techse7en