-
-
Notifications
You must be signed in to change notification settings - Fork 2
Description
Summary
sentry dashboard list and sentry dashboard view fail with unhelpful 404/403 errors when the org is auto-detected from a DSN, while sentry dashboard create works correctly in the same environment.
From #406.
Reproduction
# Fails — org auto-detected from DSN resolves to numeric org ID
sentry dashboard list
# Error: API request failed: 404 Not Found
sentry dashboard view 505818
# Error: API request failed: 403 Forbidden
# Works — explicit org slug
sentry dashboard list sentry/
sentry dashboard view sentry/ 505818
# Also works — create uses a different (correct) resolution path
sentry dashboard create 'Test Dashboard'Root cause
list and view use resolveOrgFromTarget → resolveOrg → resolveOrgFromDsn, which falls back to the numeric org ID from the DSN (e.g., "1" extracted from o1.ingest.us.sentry.io) when there's no cached project entry (resolve-target.ts:230).
create uses resolveAllTargets → resolveDsnToTarget, which does a full project API lookup and correctly resolves the org slug (e.g., "sentry").
The dashboard API endpoints reject the numeric org ID with 404 or 403.
Suggested fix
Make list and view use the same resolution path as create (resolveAllTargets), or improve resolveOrgFromDsn to resolve numeric org IDs to slugs (similar to what resolveEffectiveOrg does in region.ts).
Key files
src/commands/dashboard/resolve.ts:36-42—resolveOrgFromTargetcallsresolveOrgsrc/lib/resolve-target.ts:808-836—resolveOrgfalls back toresolveOrgFromDsnsrc/lib/resolve-target.ts:228-232—resolveOrgFromDsnreturns numeric org ID as fallbacksrc/commands/dashboard/create.ts:124-138—createusesresolveAllTargets(correct path)