November 26, 2026

Certbot Renewal Failed? How to Read the Errors and Fix Them

Home-lab server closet at night with a laptop showing red terminal errors beside a router

Timeout during connect (likely firewall problem). That line comes from Let’s Encrypt’s validation servers, not from Certbot, and it means something on the public internet tried to reach port 80 on the server and got nothing back. Let’s Encrypt’s validation software reports failures in a small set of fixed messages like it, and Certbot adds a few of its own. Each one points at a different pipe in the plumbing: the scheduler that should have run Certbot, the port the challenge needs, the DNS record the challenge reads, or the Certbot install itself. The commands below were run on an Ubuntu 24.04 test container with the distribution’s Certbot package, version 2.9.0, against a self-signed test certificate. The container could not reach Let’s Encrypt at all, which turned out to be useful, and where it could not show something, the post says so.

Video: ZacsTech on YouTube

Start with a dry run, then read what it says

One command that rehearses the renewal without spending anything

The Certbot user guide describes --dry-run as a way to “Test “renew” or “certonly” without saving any certificates to disk,” and notes that it uses the Let’s Encrypt staging server unless --server says otherwise. Staging matters because of rate limits. Let’s Encrypt’s rate limit page allows “Up to 5 authorization failures per identifier” per account every hour, and asks anyone testing to “please utilize our staging environment instead of the production API.” Hammering production with real renewal attempts while debugging is a good way to lock a domain out for the afternoon.

Before the dry run, list what Certbot thinks it manages. The container’s clock was set to October 16, 2026 with faketime so the dates in the output read as they would on that day:

$ sudo certbot certificates
Found the following certs:
  Certificate Name: lab.example.com
    Serial Number: 732e286b82facbf1de8ec7c470ad7a5818461e84
    Key Type: RSA
    Domains: lab.example.com
    Expiry Date: 2026-11-02 13:00:00+00:00 (VALID: 17 days)
    Certificate Path: /etc/letsencrypt/live/lab.example.com/fullchain.pem
    Private Key Path: /etc/letsencrypt/live/lab.example.com/privkey.pem

Then the rehearsal, with -v for detail:

$ sudo certbot renew --dry-run -v
Certificate is due for renewal, auto-renewing...
Non-interactive renewal: random delay of 75.37798922111232 seconds
Plugins selected: Authenticator standalone, Installer None
Failed to renew certificate lab.example.com with error: HTTPSConnectionPool(host='acme-staging-v02.api.letsencrypt.org', port=443): Max retries exceeded with url: /directory (Caused by NameResolutionError(... Failed to resolve 'acme-staging-v02.api.letsencrypt.org' ([Errno -2] Name or service not known)"))

All simulated renewals failed. The following certificates could not be renewed:
  /etc/letsencrypt/live/lab.example.com/fullchain.pem (failure)
1 renew failure(s), 0 parse failure(s)

The failure here is outbound: the server could not even look up the ACME server’s name, which on a real machine points at broken DNS resolution or an egress firewall, and dig is the tool for checking that. The summary line separates renew failures from parse failures, and those are different problems. The random delay near the top is not a hang either.

Certbot’s renewal code at version 2.9.0 adds a random sleep of 1 to 480 seconds when it runs without a terminal, to spread load on the certificate authority. A dry run started from a script or an SSH command without a TTY can sit silent for up to eight minutes. --no-random-sleep-on-renew skips it for testing.

Chained and padlocked steel door of a brick building on a wet morning sidewalk

Is anything running Certbot at all?

The scheduler is the pump; if it stops, nothing downstream gets water

The guide says “Most Certbot installations come with automatic renewals preconfigured,” and tells users to check for a certbot renew entry in the crontab or in systemctl list-timers. The Ubuntu package installed both. Its systemd timer:

[Unit]
Description=Run certbot twice daily

[Timer]
OnCalendar=*-*-* 00,12:00:00
RandomizedDelaySec=43200
Persistent=true

And its service, the command the timer actually runs:

ExecStart=/usr/bin/certbot -q renew --no-random-sleep-on-renew

The package also ships /etc/cron.d/certbot, which only runs if systemd is absent (! -d /run/systemd/system). The container had no running systemd, so systemctl list-timers could not be demonstrated here.

The most useful test of all is to run the scheduler’s exact command by hand. On this container, it failed:

$ sudo /usr/bin/certbot -q renew --no-random-sleep-on-renew
    ^^^^^^^^^^^^^^
AttributeError: module 'lib' has no attribute 'GEN_EMAIL'

The container’s default python3 had been pointed at a newer Python than the one Ubuntu’s Certbot package was built for, and the package’s crypto library broke on import. Running the same Certbot under the system’s Python 3.12 worked. On a real server this is the quiet failure: the timer fires twice a day, crashes in under a second, and nobody hears it, because -q suppresses output and Let’s Encrypt announced it would end expiration reminder emails on June 4, 2025. Any change to the system’s Python, from a manual upgrade or a stray update-alternatives, deserves a hand-run of the timer’s command afterward.

Port 80 and the HTTP-01 challenge

The validation server knocks on one door, and it has to open

Let’s Encrypt’s challenge types page is unambiguous: “The HTTP-01 challenge can only be done on port 80.” Redirects are allowed, but the same page says only to “http:” or “https:” and “only to ports 80 or 443.” A server that listens on 8080 behind a router forwarding 80 is fine; a server whose port 80 is closed is not.

The errors come from Let’s Encrypt’s validation software, Boulder, and its validation code maps network problems to a few fixed messages: “Timeout during connect (likely firewall problem)”, “Connection refused”, and “Timeout after connect (your server may be slow or overloaded)”. Roughly, a timeout means packets vanish (firewall, router, ISP), refused means the packets arrive and nothing listens, and Invalid response from ...: 404, from Boulder’s HTTP validation code, means a web server answered but the challenge file was not where it looked.

Home connections add a wrinkle. Let’s Encrypt’s port 80 guidance says “Some (mostly residential) ISPs block port 80,” and argues that opening it adds no real attack surface because “requests on port 80 are generally served by the same software that runs on port 443.”

Certbot’s standalone mode starts its own tiny web server on port 80, so it collides with nginx or Apache already holding it. The error text in Certbot’s standalone plugin reads: “Could not bind TCP port 80 because it is already in use by another process on this system (such as a web server).” The container could not get that far, since it failed at the ACME lookup first, so this message is cited from the source rather than shown. Finding the process is a job for ss -ltnp, covered in finding what is using a port. The standard fix is either a --pre-hook/--post-hook pair to stop and start the web server, or switching to the webroot plugin, which the guide says “works by creating a temporary file for each of your requested domains” under .well-known/acme-challenge and lets the existing server deliver it.

Analog pressure gauge on a basement boiler with its needle resting at zero

DNS-01: when port 80 is not an option

No inbound door needed, but a key to the DNS provider sits on the server

The DNS challenge proves control by publishing a TXT record instead of serving a file. The challenge types page notes it “also allows you to issue wildcard certificates,” and the Certbot guide says DNS validation “is the only way to obtain wildcard certificates from Let’s Encrypt.” The DNS plugins “are not included in a default Certbot installation and must be installed separately.”

The cost is stated on the same Let’s Encrypt page: “Keeping API credentials on your web server is risky.” A token that can edit DNS can, at worst, redirect the whole domain.

Two DNS-side errors appear in Boulder’s DNS validation code: “No TXT record found at” a given name, and “Incorrect TXT record … found at” a given name. The first usually means the record had not propagated to the authoritative servers before validation ran. The second often means an old TXT value from a previous attempt is still there alongside or instead of the new one.

Hand-made DNS certificates are the classic renewal trap. The guide says “Certificates created using --manual do not support automatic renewal unless combined with an authentication hook script.” A certificate issued by pasting a TXT record into a web panel will renew exactly as often as someone remembers to paste it again.

Where people get burned

Old rules baked into old packages, and configs edited by hand

Renewal timing that depends on the Certbot version. The Certbot changelog for 4.0.0 (April 7, 2025) says certificates “now renew with 1/3rd of lifetime left,” replacing “a hardcoded renewal at 30 days before expiration.” Version 4.1.0 (June 10, 2025) added ACME Renewal Information support, which for Let’s Encrypt “will typically cause renewal at around 2/3rds of the certificate’s lifetime.” The Ubuntu 24.04 package on the test container is 2.9.0, so it still uses the fixed 30 days. Applied in Python to the certificate lifetimes Let’s Encrypt has announced, the two rules diverge:

lifetime 90 d | fixed 30-day rule renews at age 60.0 d | 1/3 rule renews at age  60.0 d (30.0 d left)
lifetime 64 d | fixed 30-day rule renews at age 34.0 d | 1/3 rule renews at age  42.7 d (21.3 d left)
lifetime 45 d | fixed 30-day rule renews at age 15.0 d | 1/3 rule renews at age  30.0 d (15.0 d left)

For the 90-day certificates the default profile still issues, the rules agree. Let’s Encrypt’s announcement puts the opt-in tlsserver profile on 45-day certificates from May 13, 2026, the default profile on 64-day certificates from February 10, 2027, and 45 days for everyone by February 16, 2028. The old rule renews early rather than late, so it is wasteful rather than dangerous, but it is also the version that cannot request profiles at all, since the --preferred-profile flags arrived in 4.0.0. The planning side of that change is in x9m8’s guide to preparing for 64-day certificates.

ARI and rate limits. The rate limit page says “Renewals coordinated by ARI offer the unique benefit of being exempt from all rate limits.” A client too old to speak ARI does not get that exemption.

Hand-edited files under /etc/letsencrypt. While building the test lineage, a mismatched file produced this on the first try:

Renewal configuration file /etc/letsencrypt/renewal/lab.example.com.conf produced an unexpected error: fullchain does not match cert + chain for lab.example.com!. Skipping.

The following renewal configurations were invalid:
  /etc/letsencrypt/renewal/lab.example.com.conf

That is a parse failure, and Certbot skips the certificate entirely rather than trying to renew it. The guide says renewal configs live at /etc/letsencrypt/renewal/CERTNAME.conf and that renewal reuses “The same plugin and options that were used at the time the certificate was originally issued.” Changing those options is what certbot reconfigure is for; the changelog dates it to 2.3.0, and the guide says it runs a test renewal against staging before saving.

Hooks that only fire on success. The guide says pre and post hooks “will only be run if a certificate is due for renewal,” and to use --deploy-hook for actions that should follow only a successful renewal.

Validation from more than one place. Since 2020, Let’s Encrypt validates “from multiple perspectives”, and its FAQ says “We don’t publish a list of IP addresses we use to validate, and these IP addresses may change at any time.” A firewall that allows only certain countries or address ranges can pass one validation path and fail another.

Wall calendar with one day circled in red marker above a home office desk

When the problem is the monitoring

A renewal system with no alarm is a boiler with no pressure gauge

The strongest case against everything above is that troubleshooting starts too late. Every failure mode in this post is survivable if someone notices within the remaining third of a certificate’s life, and they tend to go unnoticed when nothing is watching. Let’s Encrypt’s own announcement on shorter lifetimes recommends making sure systems have “sufficient monitoring in place to alert appropriately.” Its expiration emails, the old safety net, are gone. A certificate expiry audit that checks what the server is actually serving, from outside, catches a server still presenting an old certificate, something Certbot’s own logs cannot see.

Logs still matter. The guide says Certbot “stores status logs in /var/log/letsencrypt” by default, and that directory keeps a record of every attempt, including the ones a -q flag kept off the screen.

On the test container, the timer’s command crashed before Certbot printed a single line of its own. Twice a day, every day, it would have failed in the same place, and the certificate would have counted down from 17 days to zero with a perfectly configured renewal file sitting next to it. Which part of a renewal setup gets tested on the day it is installed, and which part gets tested only on the day the browser warning appears?

Sources

  • Certbot User Guide: https://eff-certbot.readthedocs.io/en/stable/using.html
  • Certbot changelog: https://github.com/certbot/certbot/blob/main/certbot/CHANGELOG.md
  • Certbot 2.9.0 renewal.py (random delay): https://github.com/certbot/certbot/blob/v2.9.0/certbot/certbot/_internal/renewal.py
  • Certbot 2.9.0 standalone.py (port bind error): https://github.com/certbot/certbot/blob/v2.9.0/certbot/certbot/_internal/plugins/standalone.py
  • Let’s Encrypt, Challenge Types: https://letsencrypt.org/docs/challenge-types/
  • Let’s Encrypt, Rate Limits: https://letsencrypt.org/docs/rate-limits/
  • Let’s Encrypt, Best Practice – Keep Port 80 Open: https://letsencrypt.org/docs/allow-port-80/
  • Let’s Encrypt, FAQ: https://letsencrypt.org/docs/faq/
  • Let’s Encrypt, Ending Support for Expiration Notification Emails (Jan 22, 2025): https://letsencrypt.org/2025/01/22/ending-expiration-emails/
  • Let’s Encrypt, Decreasing Certificate Lifetimes to 45 Days (Dec 2, 2025): https://letsencrypt.org/2025/12/02/from-90-to-45
  • Let’s Encrypt, Multi-Perspective Validation (Feb 19, 2020): https://letsencrypt.org/2020/02/19/multi-perspective-validation/
  • Boulder, va/va.go (connection error messages): https://github.com/letsencrypt/boulder/blob/main/va/va.go
  • Boulder, va/http.go: https://github.com/letsencrypt/boulder/blob/main/va/http.go
  • Boulder, va/dns.go: https://github.com/letsencrypt/boulder/blob/main/va/dns.go

487 Posts

Peter Kalafatis writes and edits X9M8. He holds a bachelor's degree from LIU Post and a master's in Media Studies from The New School, with academic work in the philosophy of science, human behavior, AI, and memetics.

View All Posts

Leave a Reply

Your email address will not be published. Required fields are marked *