{"record":{"id":"61fcc028199a9912","repo":"BerriAI/litellm","slug":"user-not-found-for-user-id-member-user-id-and-us","errorCode":null,"errorMessage":"User not found for user_id={member.user_id} and user_email={member.user_email}","messagePattern":"User not found for user_id=(.+?) and user_email=(.+?)","errorType":"http","errorClass":"HTTPException","httpStatus":404,"severity":"error","filePath":"litellm/proxy/management_endpoints/organization_endpoints.py","lineNumber":1550,"sourceCode":"            new_user_defaults: Final = get_new_internal_user_defaults(\n                user_id=user_id,\n                user_email=member.user_email,\n            )\n\n            _returned_user = await prisma_client.insert_data(data=new_user_defaults, table_name=\"user\")\n            if _returned_user is not None:\n                user_object = LiteLLM_UserTable.model_validate(_returned_user.model_dump())\n        elif existing_user_email_row is not None and len(existing_user_email_row) > 1:\n            raise HTTPException(\n                status_code=400,\n                detail={\"error\": \"Multiple users with this email found in db. Please use 'user_id' instead.\"},\n            )\n        elif existing_user_email_row is not None:\n            user_object = LiteLLM_UserTable.model_validate(existing_user_email_row.model_dump())\n        elif existing_user_id_row is not None:\n            user_object = LiteLLM_UserTable.model_validate(existing_user_id_row.model_dump())\n        else:\n            raise HTTPException(\n                status_code=404,\n                detail={\"error\": f\"User not found for user_id={member.user_id} and user_email={member.user_email}\"},\n            )\n\n        if user_object is None:\n            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(","sourceCodeStart":1532,"sourceCodeEnd":1568,"githubUrl":"https://github.com/BerriAI/litellm/blob/77b7c6c40c0c5aa5fbcb1d6a1825ac39ca8829b8/litellm/proxy/management_endpoints/organization_endpoints.py#L1532-L1568","documentation":"Neither the provided user_id nor user_email matched any LiteLLM_UserTable row and no lookup key was resolvable, so the member-creation path has no user to attach to the organization. Raised as 404; the at-fault input is member identifiers that reference no existing user.","triggerScenarios":"Thrown at litellm/proxy/management_endpoints/organization_endpoints.py:1550 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Verify the user_id/user_email exists in LiteLLM_UserTable via /user/list."],"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"}