Repository navigation
fix(cli): Scope explore to the project by ID, not project:<slug> - #1928
Merged
Merged
Conversation
`sentry explore <org>/<project>` scoped requests with a project:<slug> query term and no project param. The Events API validates that term against the requester's member projects, so a valid project the user is not a member of failed with "Project(s) <slug> do not exist or are not actively selected" (CLI-10). Resolve the numeric ID like trace/span/log list (#1317) and send it as project=<id> for tables, time series, and --metric discovery. Fall back to project:<slug> only when the ID cannot be resolved. Replays keep using projectSlugs. Co-Authored-By: Miguel Betegon <miguel.betegon@sentry.io>
|
The latest updates on your projects. Learn more about Vercel for GitHub. 1 Skipped Deployment
|
BYK
approved these changes
Nov 4, 2026
| ? parsePeriod(flags.period) | ||
| : flags.period; | ||
| const environment = parseReplayEnvironmentFilter(flags.environment); | ||
| // Events queries scope by numeric ID; replays take the slug directly. |
7 tasks done
This branch was previously deployed
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.
sentry explore <org>/<project>scoped the Events request with aproject:<slug>query term and sent noprojectparam. The API checks that term against the requester's member projects only. So if you query a valid project you aren't a member of, the request 400s. This is one of the root causes grouped under CLI-10 ("API request failed: 400"), hitting several orgs on 0.47.0.The fix copies trace/span/log list (#1317). Explore now resolves the numeric project ID with
resolveLogProjectIdand sendsproject=<id>for table queries,--time-series, and--metricdiscovery. It still falls back toproject:<slug>when the ID can't be resolved. Replays already scope withprojectSlugsand are unchanged. A slug that doesn't exist now gets the existing "Project not found" resolution error with suggestions, not a raw 400.Before
After
The output above came from a local fake Sentry server that rejects
project:<slug>without aprojectparam, which matches the production error.via bete.
--
View Session [Sentry]