fix(init): show actionable error when org is over its member limit#1091
Merged
Conversation
Contributor
|
Contributor
Codecov Results 📊✅ Patch coverage is 100.00%. Project has 5016 uncovered lines. Files with missing lines (1)
Coverage diff@@ Coverage Diff @@
## main #PR +/-##
==========================================
+ Coverage 81.17% 81.18% +0.01%
==========================================
Files 383 383 —
Lines 26640 26649 +9
Branches 17338 17340 +2
==========================================
+ Hits 21623 21633 +10
- Misses 5017 5016 -1
- Partials 1798 1800 +2Generated by Codecov Action |
dd0af53 to
1f2aac5
Compare
When the target org is over its member limit, Sentry disables the caller's seat and returns 401 `member-disabled-over-limit` for region-scoped calls like listing teams. `sentry init` resolved the org fine from the control-plane org list, then hit this 401 during team resolution and surfaced a bare "Failed to list teams / 401" — and the generic 401 path told the user to re-authenticate, which can't fix a seat-limit lockout. Recognize the code in enrich401Detail and explain the real cause (org over member limit, ask an owner to upgrade/free a seat, or use another org). Preserve the enriched detail through the init team-resolution paths (implicit and explicit) and resolve-team's 401 handling so the guidance reaches the user instead of being flattened. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
1f2aac5 to
0af1566
Compare
5 tasks
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.
Summary
When you run
sentry initagainst an org that's over its member limit, Sentry disables your seat and returns401 member-disabled-over-limiton region-scoped calls (like listing teams). Init resolved the org fine from the control-plane org list, then hit that 401 during team resolution and showed a bare:The generic 401 path also told the user to re-authenticate — useless here, since it's a billing/seat issue, not auth. Found while triaging a real
initfailure against an over-limit EU org.Changes
enrich401Detailrecognizes themember-disabled-over-limitcode and explains the real cause (org over member limit; ask an owner to upgrade or free a seat, or target another org) instead of the misleading re-auth advice.ApiError's enriched detail viaformat()rather than flattening it toerror.message, andresolve-team'shandleListTeamsErrorre-throws 401s asApiErrorso the detail survives. This mirrors the existing 401 handling forlistOrganizations(fix(init): enrich 401 Unauthorized errors with actionable guidance #971).After:
Test Plan
infrastructure.test.ts(member-limit 401 message, and that it doesn't suggest re-auth) andpreflight.test.ts(implicitlistTeams401 surfaces the detail).pnpm testgreen, lint +tsc --noEmitclean.sentry team list <org>/andsentry init <org>/both print the new guidance and fail before writing any files.🤖 Generated with Claude Code