Skip to content

fix(seer): Handle InvalidSearchQuery for transaction names#118109

Open
sentry[bot] wants to merge 1 commit into
masterfrom
seer/fix/seer-invalid-search-query
Open

fix(seer): Handle InvalidSearchQuery for transaction names#118109
sentry[bot] wants to merge 1 commit into
masterfrom
seer/fix/seer-invalid-search-query

Conversation

@sentry

@sentry sentry Bot commented Jun 19, 2026

Copy link
Copy Markdown
Contributor

This PR addresses an InvalidSearchQuery exception that occurred in sentry/seer/agent/index_data.py within the get_trace_for_transaction function.

Problem:
The get_trace_for_transaction function constructs a SnQL query using the transaction_name parameter. If transaction_name contained literal backslashes (e.g., http://*/....\\....\\windows\\win.ini), the Spans.run_table_query parser would interpret these as invalid escape sequences, leading to an InvalidSearchQuery exception and a 500 error for internal RPC calls.

Solution:
To prevent these crashes, the call to Spans.run_table_query in get_trace_for_transaction is now wrapped in a try...except InvalidSearchQuery block. If the query parser raises this exception, it is caught, logged, and the function gracefully returns None. This ensures that the system handles malformed transaction_name inputs without crashing, allowing for a more robust user experience.

Legal Boilerplate

Look, I get it. The entity doing business as "Sentry" was incorporated in the State of Delaware in 2015 as Functional Software, Inc. and is gonna need some rights from me in order to utilize my contributions in this here PR. So here's the deal: I retain all rights, title and interest in and to my contributions, and by keeping this boilerplate intact I confirm that Sentry can use, modify, copy, and redistribute my contributions, under Sentry's choice of terms.

Fixes SENTRY-5PCT

@sentry sentry Bot requested a review from a team as a code owner June 19, 2026 22:40
@github-actions github-actions Bot added the Scope: Backend Automatically applied to PRs that change backend components label Jun 19, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Scope: Backend Automatically applied to PRs that change backend components

Projects

None yet

Development

Successfully merging this pull request may close these issues.

0 participants