Skip to content

fix(issues): Validate tag keys and handle query errors in group tagkey endpoints - #132131

Open
sentry[bot] wants to merge 3 commits into
masterfrom
seer/fix-group-tagkey-unqualified-query-error
Open

sentry[bot] wants to merge 3 commits into
masterfrom
seer/fix-group-tagkey-unqualified-query-error

Conversation

@sentry

@sentry sentry Bot commented Nov 22, 2026 •

Copy link
Copy Markdown
Contributor

Description

When an issue tag endpoint receives a tag key containing spaces or other characters Snuba cannot resolve (e.g. mac catalyst app.name), Snuba returns a validation error that surfaces as UnqualifiedQueryError. Because the calls in GroupTagKeyDetailsEndpoint and GroupTagKeyValuesEndpoint were unguarded, this escaped as an unhandled 500.

Wrap the tagstore and paginator queries in both endpoints with handle_query_errors(), converting UnqualifiedQueryError into a 400 ParseError response (matching the pattern used by GroupTagsEndpoint) while preserving GroupTagKeyNotFound -> 404 behavior.

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-5YZ8

@sentry <feedback>: Autofix iterates on these changes
@sentry stop iterating: Autofix stops iterating on this run

This PR was automatically generated by Sentry. You can adjust this setting at any time.

@sentry
sentry Bot requested review from a team as code owners November 22, 2026 22:43
@github-actions github-actions Bot added the Scope: Backend Automatically applied to PRs that change backend components label Nov 22, 2026
@github-actions

github-actions Bot commented Nov 22, 2026 •

Copy link
Copy Markdown
Contributor

No findings on the latest commit.

@cvxluo cvxluo added the Trigger: getsentry tests Once code is reviewed: apply label to PR to trigger getsentry tests label Nov 23, 2026
@cvxluo
cvxluo enabled auto-merge (squash) November 23, 2026 18:03
@github-actions github-actions Bot removed the Trigger: getsentry tests Once code is reviewed: apply label to PR to trigger getsentry tests label Nov 23, 2026

@cursor cursor Bot left a comment

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.

Cursor Bugbot has reviewed your changes using default effort and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 18e6980. Configure here.

request=request,
paginator=paginator,
on_results=lambda results: serialize(results, request.user, serializer_cls),
)

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.

Paginator query skips error handling

Medium Severity

get_group_tag_value_paginator runs the Snuba query immediately, but handle_query_errors() wraps self.paginate instead. SequencePaginator only pages in-memory results, so timeouts, rate limits, and other Snuba errors from the values fetch still escape as unhandled 500s.

Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit 18e6980. Configure here.

This branch was successfully deployed

1 active deployment
Preview — 18e69805 Deployed Nov 23, 2026 by vercel[bot]
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.

1 participant