Repository navigation
fix(auth): logs say why an upload, an outbound request or a stored signing key failed - #690
Draft
PiquelChips wants to merge 2 commits into
Draft
PiquelChips wants to merge 2 commits into
PiquelChips wants to merge 2 commits into
Conversation
…t failures and unusable signing keys - The picture upload and pasted verification link logs format their error through ErrorChain, as the rest of auth does. - An outbound request that gets no response logs its reqwest error, without its URL, before it is reduced to the failure the delivery records. - The dashboard logs why a stored signing key cannot be used; its answer is unchanged.
|
Important Draft PR not reviewedDraft PRs are not automatically reviewed by default.
To automatically review draft PRs, update your CodeRabbit configuration: reviews:
auto_review:
drafts: true
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. |
Review follow-up: the log reads "outbound request failed", since a body read can fail too. A back-channel delivery logs the cause as a warning beside its worker's; a picture import logs it at debug, since its caller already warns.
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.
Part of #544 (NEW-17, auth's logs).
Four places in auth logged an error without its cause, or didn't log it at all, so the log couldn't say why something failed:
web/settings/profile.rs) and pasted verification links (web/settings/emails.rs) logged%error, which is Display only. They now logerror = %ErrorChain(..), as the rest of auth does.deliveries/outbound.rs): a request that failed in transport, for a back-channel logout or a provider's profile picture, was reduced toConnection,Timeout,ResolutionorInvalidDestination, and thereqwest::Errorwas dropped. This covers failures before the response and while reading a picture's body. The cause is now logged, with the URL stripped (reqwest::Error::without_url), since a provider's picture URL can identify a person. A back-channel delivery logs it as a warning, beside the worker'sdelivery will be retried/delivery failed, which name only the failure. A picture import logs it at debug, since its caller already warnsprovider picture not imported. Only the reduced failure is recorded as the delivery'slast_error, as before.admin/error.rs):KeyError::Storedanswered409 stored signing key … cannot be usedand logged nothing, so itsCryptoErrorcause was lost. It now goes throughApiError::log_errorfirst. The answer stays the same.Changed logs
Profile::upload(×2)picture upload rejectederror = %errorerror = %ErrorChain(&*error)Verification::tokenpasted verification link rejectederror = %errorerror = %ErrorChain(error)(url::ParseErrorhas no source, so its text is the same)OutboundClient::send(back-channel deliveries)outbound request failederror(thereqwestchain, without the URL),failure(e.g.connection failed, retryable)OutboundClient::get(picture imports, request and body read)outbound request failedFrom<AdminError> for ApiError,KeyError::Storedauthentication operation failederror = stored signing key <kid> cannot be used: <CryptoError chain>transport_errortakes the level from its caller.sendis used only for back-channel deliveries, andgetonly for picture imports.Unchanged
last_error, and its retry classification.classifyis the oldtransport_errorbody, moved as it was.Files other agents edit
web/settings/profile.rsandweb/settings/emails.rsare also changed by refactor(ui): the pages' browser code is Rust on Topcoat's runtime, not script files #387. This PR only touches the log lines and one import in each.admin/error.rs: theKeyError::Storedarm is split out of the conflict arm, and nothing else changes.Checks
cargo clippy --locked -p auth-service --all-targets -- -D warnings, with and without--all-featuresjust test -p auth-service: 90 passedjust db test --test-threads 2: 509 passedNo published crate is touched, so there is no semver check.
Note
Written by Claude Opus 5.5 in Claude Code and reviewed by Claude Opus 5.5 (via T3 Code)