{"record":{"id":"985af4522bb3ae97","repo":"BerriAI/litellm","slug":"error-searching-teams-e","errorCode":null,"errorMessage":"Error searching teams: {e}","messagePattern":"Error searching teams: (.+?)","errorType":"http","errorClass":"HTTPException","httpStatus":500,"severity":"error","filePath":"litellm/proxy/management_endpoints/team_endpoints.py","lineNumber":5223,"sourceCode":"                \"contains\": team_alias,\n                \"mode\": \"insensitive\",  # Case-insensitive search\n            }\n\n        # Query users with pagination and filters\n        teams: Final = await _team_db(prisma_client).find_many(\n            where=where_conditions,\n            skip=skip,\n            take=page_size,\n            order={\"created_at\": \"desc\"},\n        )\n\n        if not teams:\n            return []\n\n        return teams\n\n    except Exception as e:\n        raise HTTPException(status_code=500, detail=f\"Error searching teams: {e}\")\n\n\ndef add_new_models_to_team(team_obj: LiteLLM_TeamTable, new_models: list[str]) -> list[str]:\n    \"\"\"\n    Add new models to a team's allowed model list.\n    \"\"\"\n    current_models = team_obj.models\n    if current_models is not None and len(current_models) == 0:  # implies all model access\n        current_models = [SpecialModelNames.all_proxy_models.value]\n    else:\n        current_models = team_obj.models\n    updated_models: Final = list(set(current_models + new_models))\n    return updated_models\n\n\n@router.post(\n    \"/team/model/add\",\n    tags=[\"team management\"],","sourceCodeStart":5205,"sourceCodeEnd":5241,"githubUrl":"https://github.com/BerriAI/litellm/blob/77b7c6c40c0c5aa5fbcb1d6a1825ac39ca8829b8/litellm/proxy/management_endpoints/team_endpoints.py#L5205-L5241","documentation":"Error \"Error searching teams: {e}\" thrown in BerriAI/litellm.","triggerScenarios":"Thrown at litellm/proxy/management_endpoints/team_endpoints.py:5223 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Check the embedded error and proxy logs; verify the database connection and search parameters."],"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"}