{"record":{"id":"d8fc4fbf57d88e85","repo":"BerriAI/litellm","slug":"unique-user-not-found-for-user-email-user-email","errorCode":null,"errorMessage":"Unique user not found for user_email={user_email}. Potential duplicate OR non-existent user_email in LiteLLM_UserTable. Use 'user_id' instead.","messagePattern":"Unique user not found for user_email=(.+?)\\. Potential duplicate OR non-existent user_email in LiteLLM_UserTable\\. Use 'user_id' instead\\.","errorType":"http","errorClass":"HTTPException","httpStatus":400,"severity":"error","filePath":"litellm/proxy/management_endpoints/organization_endpoints.py","lineNumber":1284,"sourceCode":"        raise ProxyException(\n            message=\"Authentication Error, \" + str(e),\n            type=ProxyErrorTypes.auth_error,\n            param=getattr(e, \"param\", \"None\"),\n            code=status.HTTP_500_INTERNAL_SERVER_ERROR,\n        )\n\n\nasync def find_member_if_email(user_email: str, prisma_client: PrismaClient) -> LiteLLM_UserTable:\n    \"\"\"\n    Find a member if the user_email is in LiteLLM_UserTable\n    \"\"\"\n\n    try:\n        existing_user_email_row: Final[BaseModel] = await UserRepository(prisma_client).table.find_unique(\n            where={\"user_email\": user_email}\n        )\n    except Exception:\n        raise HTTPException(\n            status_code=400,\n            detail={\n                \"error\": f\"Unique user not found for user_email={user_email}. Potential duplicate OR non-existent user_email in LiteLLM_UserTable. Use 'user_id' instead.\"\n            },\n        )\n    existing_user_email_row_pydantic: Final = LiteLLM_UserTable.model_validate(existing_user_email_row.model_dump())\n    return existing_user_email_row_pydantic\n\n\n@router.patch(\n    \"/organization/member_update\",\n    tags=[\"organization management\"],\n    dependencies=[Depends(user_api_key_auth)],\n    response_model=LiteLLM_OrganizationMembershipTable,\n)\n@management_endpoint_wrapper\nasync def organization_member_update(\n    data: OrganizationMemberUpdateRequest,","sourceCodeStart":1266,"sourceCodeEnd":1302,"githubUrl":"https://github.com/BerriAI/litellm/blob/77b7c6c40c0c5aa5fbcb1d6a1825ac39ca8829b8/litellm/proxy/management_endpoints/organization_endpoints.py#L1266-L1302","documentation":"find_member_if_email resolves a user by user_email via a unique lookup on LiteLLM_UserTable; Prisma raises when the email is absent OR duplicated, so the helper converts that into a ProxyException telling the caller to disambiguate with user_id. The at-fault input is a user_email that is not a unique key in the user table.","triggerScenarios":"Thrown at litellm/proxy/management_endpoints/organization_endpoints.py:1284 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Use user_id instead of user_email; the email is duplicated or non-existent in LiteLLM_UserTable."],"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-14T00:17:10.932Z"}