{"record":{"id":"cf40e39376c13b97","repo":"BerriAI/litellm","slug":"team-s-not-found-join-missing-ids-a-tea","errorCode":null,"errorMessage":"Team(s) not found: {', '.join(missing_ids)}. A team must exist before it can be set as a default team for new users.","messagePattern":"Team\\(s\\) not found: (.+?)\\. A team must exist before it can be set as a default team for new users\\.","errorType":"http","errorClass":"HTTPException","httpStatus":400,"severity":"error","filePath":"litellm/proxy/ui_crud_endpoints/proxy_setting_endpoints.py","lineNumber":720,"sourceCode":"            status_code=400,\n            detail={\n                \"error\": f\"Duplicate default team id(s): {', '.join(duplicate_ids)}. List each default team only once.\"\n            },\n        )\n\n    from litellm.proxy.proxy_server import prisma_client\n\n    if prisma_client is None:\n        raise HTTPException(\n            status_code=500,\n            detail={\"error\": \"Database not connected. Please connect a database.\"},\n        )\n\n    existing_teams: Final = await TeamRepository(prisma_client).find_many(where={\"team_id\": {\"in\": list(team_ids)}})\n    existing_team_ids: Final = {team.team_id for team in existing_teams}\n    missing_ids: Final = tuple(team_id for team_id in team_ids if team_id not in existing_team_ids)\n    if missing_ids:\n        raise HTTPException(\n            status_code=400,\n            detail={\n                \"error\": f\"Team(s) not found: {', '.join(missing_ids)}. \"\n                \"A team must exist before it can be set as a default team for new users.\"\n            },\n        )\n\n\nasync def _validate_default_organization_exists(organization_id: str) -> None:\n    \"\"\"Reject a default organization that cannot be assigned.\n\n    Teams are created from these settings long after they are saved, and an unknown\n    organization id would fail every future team creation instead of here, where the\n    admin who typed it can still fix it.\n    \"\"\"\n    from litellm.proxy.proxy_server import prisma_client\n\n    if prisma_client is None:","sourceCodeStart":702,"sourceCodeEnd":738,"githubUrl":"https://github.com/BerriAI/litellm/blob/77b7c6c40c0c5aa5fbcb1d6a1825ac39ca8829b8/litellm/proxy/ui_crud_endpoints/proxy_setting_endpoints.py#L702-L738","documentation":"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.","triggerScenarios":"Thrown at litellm/proxy/ui_crud_endpoints/proxy_setting_endpoints.py:720 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Create the missing teams first (via /team/new) or remove the nonexistent ids from the default teams list."],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"77b7c6c40c0c5aa5fbcb1d6a1825ac39ca8829b8","analyzedAt":"2026-08-18T11:44:31.656Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}