Repository navigation
server: quiet health_live warn when upstream socket not ready - #26741
Merged
BeryJu merged 5 commits intoOct 29, 2026
Merged
Conversation
Before the Unix socket exists, health_live (and the analogous path in the worker) called the upstream via hyper_util's legacy Client. A connect failure with ENOENT (No such file or directory) was logged at warn level, producing false-positive production warnings from the in-process healthcheck during every normal startup. Add a small helper that walks the error's source chain looking for an with . In (server and worker), use it to downgrade that specific case to ; all other connect/request failures continue to log at so real outages remain visible. The fix still returns Err so the health endpoint correctly reports not-live until the socket is up — it only adjusts the log level for the expected startup race. Signed-off-by: hippi345 <[email protected]>
When the upstream Unix socket does not yet exist, the health_live handler in src/server/core.rs used to call server.health_live().await? which converted the eyre::Report into AppError. AppError::into_response unconditionally logs warn!(err = ?self.0, "error occurred"), producing a second spurious warning on top of the one already silenced in the client layer. Replace the await? with an explicit match. A Connect/NotFound error (socket not ready) is now logged at debug and the handler returns SERVICE_UNAVAILABLE directly, bypassing AppError entirely. All other errors continue to log at warn and return SERVICE_UNAVAILABLE; no error is silently swallowed. Apply the same debug/warn split to the worker healthcheck handler (src/worker/healthcheck.rs), which also logged warn unconditionally in its Err arm. Expose is_connect_not_found as pub(crate) in both server/mod.rs and worker/mod.rs so the respective handler files can import it. Signed-off-by: hippi345 <[email protected]>
✅ Deploy Preview for authentik-docs ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
hippi345
marked this pull request as ready for review
October 6, 2026 21:03
Signed-off-by: Jens Langhammer <[email protected]>
BeryJu
approved these changes
Oct 29, 2026
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #26741 +/- ##
==========================================
- Coverage 92.48% 92.43% -0.06%
==========================================
Files 1197 1197
Lines 81195 81213 +18
Branches 4497 4515 +18
==========================================
- Hits 75095 75069 -26
- Misses 6034 6078 +44
Partials 66 66
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. |
Signed-off-by: Jens Langhammer <[email protected]>
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.
Fixes #26686
During startup,
/health/live/can hit the upstream Unix socket before it exists. Connect failures withErrorKind::NotFound(ENOENT) were logged atwarnin both the client helpers and (via?→AppError) the HTTP handler, producing false-positive production warnings from the in-process healthcheck.Changes:
is_connect_not_foundinsrc/server/mod.rsandsrc/worker/mod.rsto detect NotFound in the error source chain.debugin server/workerhealth_liveclient helpers; keepwarnfor other failures.src/server/core.rsandsrc/worker/healthcheck.rs, handle Connect/NotFound without propagating throughAppError(which always warns), returningSERVICE_UNAVAILABLEinstead.Health still reports not-live until the socket works; only the log level for the expected startup race changes.
AI disclosure
This change was written with assistance from Cursor's Claude Sonnet coding agent. I reviewed the diff, verified the NotFound classification and AppError bypass paths against the reported startup logs, and take responsibility for the submission per AI_POLICY.md.