Skip to content

feat(symbolication): Return event_id on error#103812

Closed
loewenheim wants to merge 1 commit intomasterfrom
sebastian/symbolicator-error-event-id
Closed

feat(symbolication): Return event_id on error#103812
loewenheim wants to merge 1 commit intomasterfrom
sebastian/symbolicator-error-event-id

Conversation

@loewenheim
Copy link
Copy Markdown
Contributor

This adds a sentry event ID to the error message when symbolication fails because of an internal error. That should make it easier to track down the specific problem in Sentry.

It also centralizes the (identical) _handle_response_status functions for the different platforms in the symbolicator module.

@loewenheim loewenheim requested a review from a team as a code owner November 21, 2025 14:48
@github-actions github-actions Bot added the Scope: Backend Automatically applied to PRs that change backend components label Nov 21, 2025
This adds a sentry event ID to the error message when symbolication fails
because of an internal error. That should make it easier to track down
the specific problem in Sentry.
logger.error("Unexpected symbolicator status: %s", response_json["status"])
error = SymbolicationFailed(
type=EventError.NATIVE_INTERNAL_FAILURE, event_id=response_json.get("event_id")
)
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bug: Missing Sentry event capture for unexpected status

When Symbolicator returns an unexpected status value, the code logs an error but doesn't capture it to Sentry, so response_json.get("event_id") returns None. This prevents including a Sentry event ID for tracking internal errors, which contradicts the PR's goal. Unlike HTTP-level errors (lines 525-530), unexpected statuses don't get captured to Sentry, creating an inconsistency in error tracking.

Fix in Cursor Fix in Web

@codecov
Copy link
Copy Markdown

codecov Bot commented Nov 24, 2025

Codecov Report

❌ Patch coverage is 21.73913% with 18 lines in your changes missing coverage. Please review.
✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
src/sentry/lang/native/symbolicator.py 20.00% 12 Missing ⚠️
src/sentry/lang/native/error.py 16.66% 5 Missing ⚠️
src/sentry/lang/java/processing.py 50.00% 1 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##           master   #103812      +/-   ##
===========================================
- Coverage   80.58%    80.58%   -0.01%     
===========================================
  Files        9293      9293              
  Lines      396687    396681       -6     
  Branches    25281     25281              
===========================================
- Hits       319670    319658      -12     
- Misses      76557     76563       +6     
  Partials      460       460              

else:
logger.error("Unexpected symbolicator status: %s", response_json["status"])
error = SymbolicationFailed(
type=EventError.NATIVE_INTERNAL_FAILURE, event_id=response_json.get("event_id")
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does this need to come from the response? I assume sentry can just send this id as a scope when making the request?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't quite understand what you mean. Are you suggesting that we store the event ID of the Sentry error on the scope?

Copy link
Copy Markdown
Member

@Dav1dde Dav1dde Nov 26, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't understand why the event id needs to come from the Symbolicator response, Sentry should already have it.

One possibility is to instead setup the SDK scope in a way that the event id is always present, then there is also no need to parse it from the response. Assuming your use is for a Sentry error.

@getsantry
Copy link
Copy Markdown
Contributor

getsantry Bot commented Dec 18, 2025

This pull request has gone three weeks without activity. In another week, I will close it.

But! If you comment or otherwise update it, I will reset the clock, and if you add the label WIP, I will leave it alone unless WIP is removed ... forever!


"A weed is but an unloved flower." ― Ella Wheeler Wilcox 🥀

@getsantry getsantry Bot added the Stale label Dec 18, 2025
@getsantry getsantry Bot closed this Dec 26, 2025
@github-actions github-actions Bot locked and limited conversation to collaborators Jan 10, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

Scope: Backend Automatically applied to PRs that change backend components Stale

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants