{"record":{"id":"8d0fc19586083f42","repo":"BerriAI/litellm","slug":"error-adding-member-member-to-organization-orga","errorCode":null,"errorMessage":"Error adding member={member} to organization={organization_id}: {e}","messagePattern":"Error adding member=(.+?) to organization=(.+?): (.+?)","errorType":"exception","errorClass":"ValueError","httpStatus":500,"severity":"error","filePath":"litellm/proxy/management_endpoints/organization_endpoints.py","lineNumber":1574,"sourceCode":"            raise ValueError(\n                f\"User does not exist in LiteLLM_UserTable. user_id={member.user_id} and user_email={member.user_email}\"\n            )\n\n        # Add user to organization\n        _organization_membership: Final = await _table(OrganizationMembershipRepository(prisma_client)).create(\n            data={\n                \"organization_id\": organization_id,\n                \"user_id\": user_object.user_id,\n                \"user_role\": member.role,\n            }\n        )\n        organization_membership: Final = LiteLLM_OrganizationMembershipTable.model_validate(\n            _organization_membership.model_dump()\n        )\n        return user_object, organization_membership\n\n    except Exception as e:\n        raise ValueError(f\"Error adding member={member} to organization={organization_id}: {e}\")\n","sourceCodeStart":1556,"sourceCodeEnd":1575,"githubUrl":"https://github.com/BerriAI/litellm/blob/77b7c6c40c0c5aa5fbcb1d6a1825ac39ca8829b8/litellm/proxy/management_endpoints/organization_endpoints.py#L1556-L1575","documentation":"Catch-all around the membership creation (and surrounding user resolution) in add_member: any unexpected failure — Prisma constraint violation, DB outage, serialization bug — is wrapped into an HTTPException 400 carrying the member and organization id, so the caller knows which add operation failed.","triggerScenarios":"Thrown at litellm/proxy/management_endpoints/organization_endpoints.py:1574 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Check proxy server logs for the underlying exception details.","Verify the member and organization ids are valid."],"exampleFix":null,"handlingStrategy":"try-catch","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"}