BerriAI/litellm · error · HTTPException
Team(s) not found: {', '.join(missing_ids)}. A team must exi
Error message
Team(s) not found: {', '.join(missing_ids)}. A team must exist before it can be set as a default team for new users. What it means
Referential-integrity check in _validate_default_teams_exist: one or more submitted team ids have no row in LiteLLM_TeamTable. New users are added to default teams long after saving, and that later path swallows failures, so unknown ids must be caught now while the admin can still fix the list.
Source
Thrown at litellm/proxy/ui_crud_endpoints/proxy_setting_endpoints.py:720
status_code=400,
detail={
"error": f"Duplicate default team id(s): {', '.join(duplicate_ids)}. List each default team only once."
},
)
from litellm.proxy.proxy_server import prisma_client
if prisma_client is None:
raise HTTPException(
status_code=500,
detail={"error": "Database not connected. Please connect a database."},
)
existing_teams: Final = await TeamRepository(prisma_client).find_many(where={"team_id": {"in": list(team_ids)}})
existing_team_ids: Final = {team.team_id for team in existing_teams}
missing_ids: Final = tuple(team_id for team_id in team_ids if team_id not in existing_team_ids)
if missing_ids:
raise HTTPException(
status_code=400,
detail={
"error": f"Team(s) not found: {', '.join(missing_ids)}. "
"A team must exist before it can be set as a default team for new users."
},
)
async def _validate_default_organization_exists(organization_id: str) -> None:
"""Reject a default organization that cannot be assigned.
Teams are created from these settings long after they are saved, and an unknown
organization id would fail every future team creation instead of here, where the
admin who typed it can still fix it.
"""
from litellm.proxy.proxy_server import prisma_client
if prisma_client is None:View on GitHub (pinned to 77b7c6c40c)
Solutions
- Create the missing teams first (via /team/new) or remove the nonexistent ids from the default teams list.
Defensive patterns
Strategy: validation
When it happens
Trigger: Thrown at litellm/proxy/ui_crud_endpoints/proxy_setting_endpoints.py:720 when the library encounters an invalid state.
Common situations: See trigger scenarios.
AI-assisted analysis of BerriAI/litellm@77b7c6c40c (2026-08-18).
Data as JSON: /api/errors/cf40e39376c13b97.
Report an issue: GitHub.