fix: don't panic when a Let's Encrypt request fails - #1046
Merged
jmattheis merged 1 commit intoSep 9, 2026
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #1046 +/- ##
==========================================
+ Coverage 75.77% 76.04% +0.27%
==========================================
Files 66 66
Lines 3620 3620
==========================================
+ Hits 2743 2753 +10
+ Misses 666 655 -11
- Partials 211 212 +1 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
jmattheis
force-pushed
the
fix-letsencrypt-transport-error
branch
from
September 9, 2026 18:59
9b5a807 to
553f665
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
A refused connection to the ACME server can take the whole process down, not just the renewal that hit it.
LoggingRoundTripper.RoundTripreadsresp.StatusCodebefore it looks aterr. A dial failure, a DNS miss, a cancelled context or the clients own 60s timeout all come back as a nil response with an error, so that first line panics and theelse if err != nilbranch below it never gets its turn.Point an
acme.Clientat a directory URL that refuses the connection, through that transport, and you get:With the branches swapped it logs the line that branch was written for and hands the error back:
Which of those you get depends on who made the request. During a handshake
net/httprecovers it, so you lose that connection and a stack trace lands in the log. Renewal is the bad one: autocert schedules it withtime.AfterFunc, so the callback is a bare goroutine with nothing to recover it, and the server exits.The diff just moves the error branch to the front, all three log lines are unchaged. There was no test file under
runner/at all, so theres one now covering the nil-response case.