{"record":{"id":"10875e971fc45f4e","repo":"Significant-Gravitas/AutoGPT","slug":"member-user-id-not-found-in-org-org-id","errorCode":null,"errorMessage":"Member {user_id} not found in org {org_id}","messagePattern":"Member (.+?) not found in org (.+?)","errorType":"http","errorClass":"NotFoundError","httpStatus":404,"severity":"error","filePath":"autogpt_platform/backend/backend/api/features/orgs/db.py","lineNumber":518,"sourceCode":"                # Org admins get workspace admin on the default workspace,\n                # matching what org creation grants the owner.\n                \"isAdmin\": is_admin,\n                \"status\": \"ACTIVE\",\n            }\n        )\n\n    return OrgMemberResponse.from_db(member)\n\n\nasync def update_org_member(\n    org_id: str, user_id: str, is_admin: bool | None, is_billing_manager: bool | None\n) -> OrgMemberResponse:\n    \"\"\"Update a member's role flags.\"\"\"\n    member = await prisma.orgmember.find_unique(\n        where={\"orgId_userId\": {\"orgId\": org_id, \"userId\": user_id}}\n    )\n    if member is None:\n        raise NotFoundError(f\"Member {user_id} not found in org {org_id}\")\n    if member.isOwner:\n        raise ValueError(\n            \"Cannot change the owner's role flags directly. Use transfer-ownership.\"\n        )\n\n    update_data: dict = {}\n    if is_admin is not None:\n        update_data[\"isAdmin\"] = is_admin\n    if is_billing_manager is not None:\n        update_data[\"isBillingManager\"] = is_billing_manager\n\n    if update_data:\n        await prisma.orgmember.update(\n            where={\"orgId_userId\": {\"orgId\": org_id, \"userId\": user_id}},\n            data=update_data,\n        )\n\n    # Keep the default-workspace admin flag in step with the org role —","sourceCodeStart":500,"sourceCodeEnd":536,"githubUrl":"https://github.com/Significant-Gravitas/AutoGPT/blob/9c8bb5550f446ba5d3046b78896578742495b3cf/autogpt_platform/backend/backend/api/features/orgs/db.py#L500-L536","documentation":"Error \"Member {user_id} not found in org {org_id}\" thrown in Significant-Gravitas/AutoGPT.","triggerScenarios":"Thrown at autogpt_platform/backend/backend/api/features/orgs/db.py:518 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Confirm the user ID and org ID are correct and the user is still a member.","Refresh the member list; the membership may have been removed."],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"9c8bb5550f446ba5d3046b78896578742495b3cf","analyzedAt":"2026-08-14T17:17:21.957Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}