crewAIInc/crewAI · error · SystemExit
Failed to retrieve organization list: {e!s}
Error message
Failed to retrieve organization list: {e!s} What it means
Printed by `crewai org list` when the organizations API call returns an HTTP error status other than 401 (401 is handled separately as 'not logged in'). The message embeds the HTTPStatusError text (status code + URL) and the command exits 1. It means authentication succeeded but the Plus API rejected the request — 403/404/500 etc.
Source
Thrown at lib/cli/src/crewai_cli/organization/main.py:46
table = Table(title="Your Organizations")
table.add_column("Name", style="cyan")
table.add_column("ID", style="green")
for org in orgs:
table.add_row(org["name"], org["uuid"])
console.print(table)
except HTTPStatusError as e:
if e.response.status_code == 401:
console.print(
"You are not logged in to any organization. Use 'crewai login' to login.",
style="bold red",
)
return
console.print(
f"Failed to retrieve organization list: {e!s}", style="bold red"
)
raise SystemExit(1) from e
except Exception as e:
console.print(
f"Failed to retrieve organization list: {e!s}", style="bold red"
)
raise SystemExit(1) from e
def switch(self, org_id: str) -> None:
try:
response = self.plus_api_client.get_organizations()
response.raise_for_status()
orgs = response.json()
org = next((o for o in orgs if o["uuid"] == org_id), None)
if not org:
console.print(
f"Organization with id '{org_id}' not found.", style="bold red"
)
returnView on GitHub (pinned to 754d7323be)
Solutions
- Read the status code in the message: 403 → check your plan/entitlements on crewai.com; 5xx → retry later or check status page
- Update the CLI: uv tool upgrade crewai (or pip install -U crewai) to clear endpoint version skew
- Re-login (`crewai logout && crewai login`) to refresh tokens if the API reports auth-adjacent 403
- If persistent, capture `crewai org list` output and contact CrewAI support with the status code
Defensive patterns
Strategy: retry
Validate before calling
import httpx
def org_api_ok(client_base_url: str, headers: dict) -> bool:
try:
r = httpx.get(f"{client_base_url}/organizations", headers=headers, timeout=15)
return r.status_code < 400 or r.status_code == 401
except httpx.HTTPError:
return False Try / catch
try:
org_cmd.list()
except SystemExit:
# message already printed; inspect it for the HTTP status before deciding
raise Prevention
- Keep the CLI updated to match the current Plus API
- Treat 5xx/429 as transient — retry after a backoff
- Re-login after account/plan changes to refresh token claims
When it happens
Trigger: Running `crewai org list` (or OrganizationCommand.list) when the Plus API returns 403 (account lacks org access), 404 (endpoint moved / stale CLI against old API), 429, or 5xx — any raise_for_status() failure that is not 401.
Common situations: Expired feature entitlements or suspended accounts, CLI version skew with API changes, CrewAI Plus incidents, or organization membership revoked while the token remains valid.
Related errors
- Project name '{name}' would generate invalid Python class na
- Failed to switch organization: {e!s}
- Error: {error_data.get('error', 'Trigger not found')}
- Failed to evaluate model input and output. Response status c
- Failed to evaluate model input and output. Status code: {res
AI-assisted analysis of crewAIInc/crewAI@754d7323be (2026-08-15).
Data as JSON: /api/errors/0465199c0439909e.
Report an issue: GitHub.