Significant-Gravitas/AutoGPT · error · NotFoundError
User {new_owner_id} is not a member of org {org_id}
Error message
User {new_owner_id} is not a member of org {org_id} What it means
Error "User {new_owner_id} is not a member of org {org_id}" thrown in Significant-Gravitas/AutoGPT.
Source
Thrown at autogpt_platform/backend/backend/api/features/orgs/db.py:625
async def transfer_ownership(
org_id: str, current_owner_id: str, new_owner_id: str
) -> None:
"""Transfer org ownership atomically. Both updates happen in one statement."""
if current_owner_id == new_owner_id:
raise ValueError("Cannot transfer ownership to the same user")
current = await prisma.orgmember.find_unique(
where={"orgId_userId": {"orgId": org_id, "userId": current_owner_id}}
)
if current is None or not current.isOwner:
raise ValueError("Current user is not the org owner")
new = await prisma.orgmember.find_unique(
where={"orgId_userId": {"orgId": org_id, "userId": new_owner_id}}
)
if new is None:
raise NotFoundError(f"User {new_owner_id} is not a member of org {org_id}")
await prisma.execute_raw(
"""
UPDATE "OrgMember"
SET "isOwner" = CASE
WHEN "userId" = $1 THEN false
WHEN "userId" = $2 THEN true
ELSE "isOwner"
END,
"isAdmin" = CASE
WHEN "userId" = $2 THEN true
ELSE "isAdmin"
END,
"updatedAt" = NOW()
WHERE "orgId" = $3 AND "userId" IN ($1, $2)
""",
current_owner_id,
new_owner_id,View on GitHub (pinned to 9c8bb5550f)
Solutions
- Invite the user to the organization first, then transfer ownership.
- Verify the user ID is correct.
When it happens
Trigger: Thrown at autogpt_platform/backend/backend/api/features/orgs/db.py:625 when the library encounters an invalid state.
Common situations: See trigger scenarios.
AI-assisted analysis of Significant-Gravitas/AutoGPT@9c8bb5550f (2026-08-14).
Data as JSON: /api/errors/cf5154c89d3c35c3.
Report an issue: GitHub.