You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix(init): show actionable error when org is over its member limit (#1091)
## Summary
When you run `sentry init` against an org that's over its member limit,
Sentry disables your seat and returns `401 member-disabled-over-limit`
on 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:
```
✖ Setup failed.
Failed to list teams
401
```
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 `init` failure against an over-limit EU org.
## Changes
- `enrich401Detail` recognizes the `member-disabled-over-limit` code 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.
- The init team-resolution paths (implicit and explicit) now surface the
`ApiError`'s enriched detail via `format()` rather than flattening it to
`error.message`, and `resolve-team`'s `handleListTeamsError` re-throws
401s as `ApiError` so the detail survives. This mirrors the existing 401
handling for `listOrganizations` (#971).
After:
```
Failed to list teams: 401
Your account is disabled in this organization because it is over its member limit.
This is a billing/seat-limit issue, not an auth problem — re-authenticating won't help.
Ask an org owner to upgrade the plan or free up a seat, then retry.
Or target a different org, e.g.: sentry init my-other-org/
```
## Test Plan
- New unit tests: `infrastructure.test.ts` (member-limit 401 message,
and that it doesn't suggest re-auth) and `preflight.test.ts` (implicit
`listTeams` 401 surfaces the detail).
- `pnpm test` green, lint + `tsc --noEmit` clean.
- Verified end-to-end against a real over-limit org: `sentry team list
<org>/` and `sentry init <org>/` both print the new guidance and fail
before writing any files.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
0 commit comments