Significant-Gravitas/AutoGPT · warning · HTTPException
Graph #{graph_id} not found.
Error message
Graph #{graph_id} not found. What it means
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.
Source
Thrown at autogpt_platform/backend/backend/api/features/v1.py:1708
dependencies=[Security(requires_user)],
)
async def get_graph(
graph_id: str,
user_id: Annotated[str, Security(get_user_id)],
ctx: Annotated[RequestContext, Security(get_request_context)],
version: int | None = None,
for_export: bool = False,
) -> graph_db.GraphModel:
graph = await graph_db.get_graph(
graph_id,
version,
user_id=user_id,
for_export=for_export,
include_subgraphs=True, # needed to construct full credentials input schema
organization_id=ctx.org_id,
)
if not graph:
raise HTTPException(status_code=404, detail=f"Graph #{graph_id} not found.")
return graph
@v1_router.get(
path="/graphs/{graph_id}/versions",
summary="Get all graph versions",
tags=["graphs"],
dependencies=[Security(requires_user)],
)
async def get_graph_all_versions(
graph_id: str,
user_id: Annotated[str, Security(get_user_id)],
ctx: Annotated[RequestContext, Security(get_request_context)],
) -> Sequence[graph_db.GraphModel]:
graphs = await graph_db.get_graph_all_versions(
graph_id, user_id=user_id, organization_id=ctx.org_id
)
if not graphs:View on GitHub (pinned to 9c8bb5550f)
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.
Defensive patterns
Strategy: type-guard
Validate before calling
const graphs = await api.listGraphs();
const exists = graphs.some(g => g.id === graphId);
if (!exists) router.replace('/builder'); // stale deep link Type guard
const graphExistsForUser = (id: string, graphs: GraphMeta[]) => graphs.some(g => g.id === id);
Try / catch
catch (e) { if (e.response?.status === 404) { showNotFoundAndExitEditor(); } else throw e; } Prevention
- 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.
When it happens
Trigger: 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.
Common situations: 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.
Related errors
- Graph #{graph_id} not found
- Application not found or you don't have permission to update
- OAuth App not found
- Invitation {invitation_id} not found
- Graph #{graph_id} v{new_active_version} not found
AI-assisted analysis of Significant-Gravitas/AutoGPT@9c8bb5550f (2026-08-14).
Data as JSON: /api/errors/dbca177a9b45b5f3.
Report an issue: GitHub.