{"record":{"id":"03a9690a36a450bf","repo":"Significant-Gravitas/AutoGPT","slug":"agentgraph-does-not-belong-to-the-source-organizat","errorCode":null,"errorMessage":"AgentGraph does not belong to the source organization","messagePattern":"AgentGraph does not belong to the source organization","errorType":"validation","errorClass":"ValueError","httpStatus":400,"severity":"error","filePath":"autogpt_platform/backend/backend/api/features/transfers/db.py","lineNumber":214,"sourceCode":"\n\n# ---------------------------------------------------------------------------\n# Internal helpers\n# ---------------------------------------------------------------------------\n\n\nasync def _validate_resource_ownership(\n    resource_type: str, resource_id: str, org_id: str\n) -> None:\n    \"\"\"Verify the resource exists and belongs to the given org.\"\"\"\n    if resource_type == \"AgentGraph\":\n        graph = await prisma.agentgraph.find_first(\n            where={\"id\": resource_id, \"isActive\": True}\n        )\n        if graph is None:\n            raise NotFoundError(f\"AgentGraph '{resource_id}' not found\")\n        if graph.organizationId != org_id:\n            raise ValueError(\"AgentGraph does not belong to the source organization\")\n\n    elif resource_type == \"StoreListing\":\n        listing = await prisma.storelisting.find_unique(where={\"id\": resource_id})\n        if listing is None or listing.isDeleted:\n            raise NotFoundError(f\"StoreListing '{resource_id}' not found\")\n        if listing.owningOrgId != org_id:\n            raise ValueError(\"StoreListing does not belong to the source organization\")\n\n\nasync def _move_resource(\n    resource_type: str,\n    resource_id: str,\n    target_org_id: str,\n) -> None:\n    \"\"\"Move the resource to the target organization.\"\"\"\n    if resource_type == \"AgentGraph\":\n        # Move ALL versions, not just the active one, and land the graph at\n        # org-home (teamId=None) — a stale source-org teamId would fail every","sourceCodeStart":196,"sourceCodeEnd":232,"githubUrl":"https://github.com/Significant-Gravitas/AutoGPT/blob/9c8bb5550f446ba5d3046b78896578742495b3cf/autogpt_platform/backend/backend/api/features/transfers/db.py#L196-L232","documentation":"Error \"AgentGraph does not belong to the source organization\" thrown in Significant-Gravitas/AutoGPT.","triggerScenarios":"Thrown at autogpt_platform/backend/backend/api/features/transfers/db.py:214 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Transfer the graph from the organization that actually owns it.","Move the graph to the source org first if appropriate."],"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"}