{"record":{"id":"f45d8aa1bb23119f","repo":"BerriAI/litellm","slug":"user-not-found","errorCode":null,"errorMessage":"User not found","messagePattern":"User not found","errorType":"http","errorClass":"HTTPException","httpStatus":404,"severity":"error","filePath":"litellm/proxy/management_endpoints/team_endpoints.py","lineNumber":4501,"sourceCode":"            status_code=400,\n            detail={\"error\": CommonProxyErrors.db_not_connected_error.value},\n        )\n\n    available_teams = cast(\n        list[str] | None,\n        (\n            litellm.default_internal_user_params.get(\"available_teams\")\n            if litellm.default_internal_user_params is not None\n            else None\n        ),\n    )\n    if available_teams is None:\n        return []\n\n    # filter out teams that the user is already a member of\n    user_info: Final = await _user_db(prisma_client).find_unique(where={\"user_id\": user_api_key_dict.user_id})\n    if user_info is None:\n        raise HTTPException(\n            status_code=404,\n            detail={\"error\": \"User not found\"},\n        )\n    user_info_correct_type: Final = LiteLLM_UserTable.model_validate(user_info.model_dump())\n\n    available_teams = [team for team in available_teams if team not in user_info_correct_type.teams]\n\n    available_teams_db: Final = await _team_db(prisma_client).find_many(where={\"team_id\": {\"in\": available_teams}})\n\n    available_teams_correct_type = [LiteLLM_TeamTable.model_validate(team.model_dump()) for team in available_teams_db]\n\n    return available_teams_correct_type\n\n\nasync def _get_org_admin_org_ids(\n    user_id: str,\n    prisma_client: PrismaClient,\n    user_api_key_cache: UserApiKeyCache,","sourceCodeStart":4483,"sourceCodeEnd":4519,"githubUrl":"https://github.com/BerriAI/litellm/blob/77b7c6c40c0c5aa5fbcb1d6a1825ac39ca8829b8/litellm/proxy/management_endpoints/team_endpoints.py#L4483-L4519","documentation":"Error \"User not found\" thrown in BerriAI/litellm.","triggerScenarios":"Thrown at litellm/proxy/management_endpoints/team_endpoints.py:4501 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Verify the user exists (GET /user/info) before calling this endpoint."],"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"}