Skip to content

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
mainfrom
fix/auth-logs-keep-causes
Draft

PiquelChips wants to merge 2 commits into
mainfrom
fix/auth-logs-keep-causes

Conversation

@PiquelChips

@PiquelChips PiquelChips commented Nov 22, 2026 •

Copy link
Copy Markdown
Member

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:

  • Picture uploads (web/settings/profile.rs) and pasted verification links (web/settings/emails.rs) logged %error, which is Display only. They now log error = %ErrorChain(..), as the rest of auth does.
  • Outbound requests (deliveries/outbound.rs): a request that failed in transport, for a back-channel logout or a provider's profile picture, was reduced to Connection, Timeout, Resolution or InvalidDestination, and the reqwest::Error was 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's delivery will be retried / delivery failed, which name only the failure. A picture import logs it at debug, since its caller already warns provider picture not imported. Only the reduced failure is recorded as the delivery's last_error, as before.
  • The dashboard's signing-key error (admin/error.rs): KeyError::Stored answered 409 stored signing key … cannot be used and logged nothing, so its CryptoError cause was lost. It now goes through ApiError::log_error first. The answer stays the same.

Changed logs

Where Level Message Before After
Profile::upload (×2) debug picture upload rejected error = %error error = %ErrorChain(&*error)
Verification::token debug pasted verification link rejected error = %error error = %ErrorChain(error) (url::ParseError has no source, so its text is the same)
OutboundClient::send (back-channel deliveries) warn, new outbound request failed none error (the reqwest chain, without the URL), failure (e.g. connection failed, retryable)
OutboundClient::get (picture imports, request and body read) debug, new outbound request failed none the same fields
From<AdminError> for ApiError, KeyError::Stored error, new authentication operation failed none error = stored signing key <kid> cannot be used: <CryptoError chain>

transport_error takes the level from its caller. send is used only for back-channel deliveries, and get only for picture imports.

Unchanged

  • Every HTTP response and status, the delivery's recorded last_error, and its retry classification. classify is the old transport_error body, moved as it was.

Files other agents edit

Checks

  • cargo clippy --locked -p auth-service --all-targets -- -D warnings, with and without --all-features
  • just test -p auth-service: 90 passed
  • just db test --test-threads 2: 509 passed

No 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)

…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.
@PiquelChips PiquelChips added bug Something isn't working apps/auth-service Origin Auth at auth.sourceorigin.dev, its settings and developer console, and the operator CLI labels Nov 22, 2026
@github-project-automation github-project-automation Bot moved this to Needs Triage in sourceorigin.dev Nov 22, 2026
@coderabbitai

coderabbitai Bot commented Nov 22, 2026

Copy link
Copy Markdown

Important

Draft PR not reviewed

Draft PRs are not automatically reviewed by default.

  • Trigger a manual review

To automatically review draft PRs, update your CodeRabbit configuration:

reviews:
  auto_review:
    drafts: true
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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.

Share

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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

apps/auth-service Origin Auth at auth.sourceorigin.dev, its settings and developer console, and the operator CLI bug Something isn't working

Projects

Status: Needs Triage

Development

Successfully merging this pull request may close these issues.

1 participant