{"record":{"id":"00e2623c72f8462e","repo":"BerriAI/litellm","slug":"team-s-not-found-sorted-missing-ids","errorCode":null,"errorMessage":"Team(s) not found: {sorted(missing_ids)}","messagePattern":"Team\\(s\\) not found: (.+?)","errorType":"http","errorClass":"HTTPException","httpStatus":404,"severity":"error","filePath":"litellm/proxy/management_endpoints/team_endpoints.py","lineNumber":5644,"sourceCode":"                data={\"team_member_permissions\": merged_perms},\n            )\n        await batcher.commit()\n\n    return len(updates)\n\n\nasync def _append_permissions_to_specific_teams(\n    prisma_client: PrismaClient, team_ids: list[str], permissions_to_add: set\n) -> int:\n    \"\"\"Fetch specific teams by ID and append permissions.\"\"\"\n    teams: Final = await _team_db(prisma_client).find_many(\n        where={\"team_id\": {\"in\": team_ids}},\n    )\n\n    found_ids: Final = {team.team_id for team in teams}\n    missing_ids: Final = set(team_ids) - found_ids\n    if missing_ids:\n        raise HTTPException(\n            status_code=404,\n            detail={\"error\": f\"Team(s) not found: {sorted(missing_ids)}\"},\n        )\n\n    return await _compute_and_batch_updates(prisma_client, teams, permissions_to_add)\n\n\nasync def _append_permissions_to_all_teams(prisma_client: PrismaClient, permissions_to_add: set) -> int:\n    \"\"\"Paginated read + batched write across all teams.\"\"\"\n    teams_updated = 0\n    cursor = None\n    BATCH_SIZE: Final = 500\n\n    while True:\n        find_args: _TeamFindManyArgs = {\n            \"take\": BATCH_SIZE,\n            \"order\": {\"team_id\": \"asc\"},\n        }","sourceCodeStart":5626,"sourceCodeEnd":5662,"githubUrl":"https://github.com/BerriAI/litellm/blob/77b7c6c40c0c5aa5fbcb1d6a1825ac39ca8829b8/litellm/proxy/management_endpoints/team_endpoints.py#L5626-L5662","documentation":"Error \"Team(s) not found: {sorted(missing_ids)}\" thrown in BerriAI/litellm.","triggerScenarios":"Thrown at litellm/proxy/management_endpoints/team_endpoints.py:5644 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Verify each team id in team_ids exists via /team/list; remove the missing ids listed in the error."],"exampleFix":null,"handlingStrategy":null,"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"}