chore: fix log statement#116512
Open
joseph-sentry wants to merge 1 commit into
Open
Conversation
ran into an issue when running this locally where emitting this log hard errored because we're setting msg when it's apparently a reserved keyword in python's log record, so we should just set this with a different key
JoshFerge
approved these changes
May 29, 2026
Member
JoshFerge
left a comment
There was a problem hiding this comment.
hmm weird, i thought we had a ruff rule enabled for this 🤔 G101
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.
Summary
Fixes a bug where emitting the
viewer_context_jwt.no_signing_keywarning log hard-errors instead of degrading gracefully.When
SEER_API_SHARED_SECRETis not configured,encode_viewer_contextraisesValueError, which is meant to be caught and logged as a warning so the request can continue. But the warning passedextra={"msg": ...}, andmsgis a reserved attribute on Python'sLogRecord.logging.makeRecordrefuses to overwrite it and raises:So the handler meant to swallow the missing-key case instead threw a new exception that bubbled up as an uncaught 500 on the autofix endpoints.
The fix renames the
extrakey from the reservedmsgtoreason.Test plan
Hit a Seer-backed endpoint (e.g. autofix) locally without
SEER_API_SHARED_SECRETset — the request now logs a warning and continues instead of 500ing.