{"record":{"id":"53c339f1211c398e","repo":"BerriAI/litellm","slug":"member-not-found-in-organization-data-organizatio","errorCode":null,"errorMessage":"Member not found in organization={data.organization_id} for user_id={data.user_id}","messagePattern":"Member not found in organization=(.+?) for user_id=(.+?)","errorType":"http","errorClass":"HTTPException","httpStatus":400,"severity":"error","filePath":"litellm/proxy/management_endpoints/organization_endpoints.py","lineNumber":1432,"sourceCode":"                    \"user_id_organization_id\": {\n                        \"user_id\": data.user_id,\n                        \"organization_id\": data.organization_id,\n                    }\n                },\n                data={\"budget_id\": budget_id},\n            )\n        final_organization_membership = await _table(OrganizationMembershipRepository(prisma_client)).find_unique(\n            where={\n                \"user_id_organization_id\": {\n                    \"user_id\": data.user_id,\n                    \"organization_id\": data.organization_id,\n                }\n            },\n            include={\"litellm_budget_table\": True},\n        )\n\n        if final_organization_membership is None:\n            raise HTTPException(\n                status_code=400,\n                detail={\"error\": f\"Member not found in organization={data.organization_id} for user_id={data.user_id}\"},\n            )\n\n        final_organization_membership_pydantic: Final = LiteLLM_OrganizationMembershipTable.model_validate(\n            final_organization_membership.model_dump(exclude_none=True)\n        )\n        return final_organization_membership_pydantic\n    except Exception as e:\n        verbose_proxy_logger.exception(\"Error updating member in organization: %s\", e)\n        raise e\n\n\n@router.delete(\n    \"/organization/member_delete\",\n    tags=[\"organization management\"],\n    dependencies=[Depends(user_api_key_auth)],\n)","sourceCodeStart":1414,"sourceCodeEnd":1450,"githubUrl":"https://github.com/BerriAI/litellm/blob/77b7c6c40c0c5aa5fbcb1d6a1825ac39ca8829b8/litellm/proxy/management_endpoints/organization_endpoints.py#L1414-L1450","documentation":"After applying role/budget updates, the code re-reads the membership row to build the response and it comes back None — the (user_id, organization_id) membership vanished or never existed at response-building time. Raised as 404 to signal the final state could not be confirmed.","triggerScenarios":"Thrown at litellm/proxy/management_endpoints/organization_endpoints.py:1432 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Verify the user_id is a member of the organization."],"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-14T05:17:10.506Z"}