{"record":{"id":"dbca177a9b45b5f3","repo":"Significant-Gravitas/AutoGPT","slug":"graph-graph-id-not-found-dbca17","errorCode":null,"errorMessage":"Graph #{graph_id} not found.","messagePattern":"Graph #(.+?) not found\\.","errorType":"http","errorClass":"HTTPException","httpStatus":404,"severity":"warning","filePath":"autogpt_platform/backend/backend/api/features/v1.py","lineNumber":1708,"sourceCode":"    dependencies=[Security(requires_user)],\n)\nasync def get_graph(\n    graph_id: str,\n    user_id: Annotated[str, Security(get_user_id)],\n    ctx: Annotated[RequestContext, Security(get_request_context)],\n    version: int | None = None,\n    for_export: bool = False,\n) -> graph_db.GraphModel:\n    graph = await graph_db.get_graph(\n        graph_id,\n        version,\n        user_id=user_id,\n        for_export=for_export,\n        include_subgraphs=True,  # needed to construct full credentials input schema\n        organization_id=ctx.org_id,\n    )\n    if not graph:\n        raise HTTPException(status_code=404, detail=f\"Graph #{graph_id} not found.\")\n    return graph\n\n\n@v1_router.get(\n    path=\"/graphs/{graph_id}/versions\",\n    summary=\"Get all graph versions\",\n    tags=[\"graphs\"],\n    dependencies=[Security(requires_user)],\n)\nasync def get_graph_all_versions(\n    graph_id: str,\n    user_id: Annotated[str, Security(get_user_id)],\n    ctx: Annotated[RequestContext, Security(get_request_context)],\n) -> Sequence[graph_db.GraphModel]:\n    graphs = await graph_db.get_graph_all_versions(\n        graph_id, user_id=user_id, organization_id=ctx.org_id\n    )\n    if not graphs:","sourceCodeStart":1690,"sourceCodeEnd":1726,"githubUrl":"https://github.com/Significant-Gravitas/AutoGPT/blob/9c8bb5550f446ba5d3046b78896578742495b3cf/autogpt_platform/backend/backend/api/features/v1.py#L1690-L1726","documentation":"Raised (404) by the internal helper _get_graph (used by get_graph, execute-once and export endpoints) when graph_db.get_graph returns nothing for the given graph_id/version under the requesting user and organization. No row matched either because the ID is wrong, the version does not exist, or the graph belongs to another user/org.","triggerScenarios":"GET /graphs/{graph_id} (optionally ?version=n) where the graph was deleted, the version never existed, or the authenticated user/org has no access to it. Also triggered when a stale client holds an ID from a shared link to another user's agent.","commonSituations":"Deep-linked builder URLs after the agent was deleted; concurrent sessions where one tab deletes a graph another tab still shows; version numbers from an older listing after versions were cleaned up; org-scoped deployments where the graph exists but under a different organization.","solutions":["Re-fetch the user's graph list to confirm the graph_id still exists for this account.","If a specific version was requested, drop the version parameter to resolve the latest version, or list /graphs/{id}/versions to see what exists.","Verify you are authenticated as the same user (and org) that owns the graph."],"exampleFix":null,"handlingStrategy":"type-guard","validationCode":"const graphs = await api.listGraphs();\nconst exists = graphs.some(g => g.id === graphId);\nif (!exists) router.replace('/builder'); // stale deep link","typeGuard":"const graphExistsForUser = (id: string, graphs: GraphMeta[]) => graphs.some(g => g.id === id);","tryCatchPattern":"catch (e) { if (e.response?.status === 404) { showNotFoundAndExitEditor(); } else throw e; }","preventionTips":["Resolve deep-linked graph IDs against the user's graph list before mounting the editor.","Subscribe to deletion events (or revalidate on focus) so other-session deletes surface immediately.","Never auto-retry a 404 — refresh the source listing instead."],"tags":["api","graphs","http-404","not-found","authorization"],"backgroundTag":null,"analyzedSha":"9c8bb5550f446ba5d3046b78896578742495b3cf","analyzedAt":"2026-08-14T17:17:21.957Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}