Cannot renew Let's encrypt certificate (Did I mess up the virtual host config?)


I use Nextcloudpi in the latest version. I cannot renew my Let’s encrypt certificate, it fails with the following error

Launching letsencrypt
Saving debug log to /var/log/letsencrypt/letsencrypt.log
Plugins selected: Authenticator webroot, Installer None
Cert is due for renewal, auto-renewing...
Renewing an existing certificate
Performing the following challenges:
http-01 challenge for
Using the webroot path /var/www/nextcloud for all unmatched domains.
Waiting for verification...
Cleaning up challenges
Failed authorization procedure. (http-01): urn:acme:error:connection :: The server could not connect to the client to verify the domain :: Fetching Timeout
 - The following errors were reported by the server:

   Type:   connection
   Detail: Fetching

   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.
Done. Press any key...

Actual domain is name replaced in the error message.
The nextcloud instance is still available from the internet and port-forwarding is configured and unchanged from previous successful renewals. It may be possible that i messed up the apache2 virtual hosts configuration. What’s the best way to check?

Any help is appreciated :slight_smile:

Can you actually access that file manually? I mean, can you browse to and find those directories and file? It could be that a permissions issue is stopping the file from being created.

The Let’s Encrypt forum might also be a good place to find suggestions. They’ve helped me sort out a few issues renewing as well :slight_smile:

…and specifically, can you browse to that URL from outside your network? The timeout doesn’t suggest a problem with virtualhosts so much as that the server isn’t responding on port 80 at all–as would be the case if that port were blocked by an ISP.