Significant-Gravitas/AutoGPT · error · NotFoundError

Agent #{graph_id} v{graph_version} not found for this user (

Error message

Agent #{graph_id} v{graph_version} not found for this user (#{user_id})

What it means

NotFoundError raised when no AgentGraph row matches the triple {id: graph_id, version: graph_version, userId: user_id}. All three must match: the graph must exist, at that exact version, and be owned by the authenticated user. Maps to HTTP 404 at the API layer. The most common non-obvious cause is the version mismatch — graphs are versioned, and submitting requires the version number you actually have.

Source

Thrown at autogpt_platform/backend/backend/api/features/store/db.py:902

        # First verify the agent graph belongs to this user
        graph = await prisma.models.AgentGraph.prisma().find_first(
            where={"id": graph_id, "version": graph_version, "userId": user_id},
            include={"User": {"include": {"Profile": True}}},
        )

        if not graph:
            logger.warning(
                f"Agent graph {graph_id} v{graph_version} not found for user {user_id}"
            )
            # Provide more user-friendly error message when graph_id is empty
            if not graph_id or graph_id.strip() == "":
                raise ValueError(
                    "No agent selected. "
                    "Please select an agent before submitting to the store."
                )
            else:
                raise NotFoundError(
                    f"Agent #{graph_id} v{graph_version} not found "
                    f"for this user (#{user_id})"
                )

        if not graph.User or not graph.User.Profile:
            logger.warning(f"User #{user_id} does not have a Profile")
            raise PreconditionFailed(
                "User must create a Marketplace Profile before submitting an agent"
            )

        async with transaction() as tx:
            # Determine next version number for this listing
            existing_listing = await prisma.models.StoreListing.prisma(tx).find_unique(
                where={"agentGraphId": graph_id},
                include={
                    "Versions": {
                        # We just need the latest version and one of each status:
                        "order_by": {"version": "desc"},

View on GitHub (pinned to 9c8bb5550f)

Solutions

  1. Refetch the user's agents list and resubmit with the current id/version pair.
  2. Confirm the authenticated user owns the graph — submissions on behalf of another user are not supported.
  3. Check the deleted-agents path: if the graph was removed, re-create it or pick another agent.
  4. Verify environment consistency (same backend the agent list came from).

Example fix

// before
await api.createSubmission({ graph_id: params.graphId, graph_version: 1, ... });
// after
const graph = (await api.getMyAgents()).find(a => a.id === params.graphId);
if (!graph) throw new Error('Agent not found — refresh and select it again');
await api.createSubmission({ graph_id: graph.id, graph_version: graph.version, ... });
Defensive patterns

Strategy: validation

Validate before calling

const mine = await api.getMyAgents();
const owned = mine.find(a => a.id === form.graph_id && a.version === form.graph_version);
if (!owned) {
  setError('This agent was changed or deleted — refresh and select it again');
  return;
}
await api.createSubmission(form);

Try / catch

from backend.util.exceptions import NotFoundError

try:
    await store_db.create_store_submission(...)
except NotFoundError as e:
    if 'not found for this user' in str(e):
        ui.refreshAgentList();
        ui.show('Agent not found; it may have been edited or deleted');
        return;
    raise

Prevention

When it happens

Trigger: POST /store/submissions with a graph_id belonging to another user; a stale graph_id after the agent was deleted; graph_version mismatch (e.g. sending 1 when the saved graph is version 4); sending the graph name instead of its UUID.

Common situations: Agent deleted in another tab before publishing; concurrent edits bumping the version after the dialog opened; environment mismatch (submitting an ID from a local DB to staging); frontend sending graph.version as a string.

Related errors


AI-assisted analysis of Significant-Gravitas/AutoGPT@9c8bb5550f (2026-08-14). Data as JSON: /api/errors/cc7f16b335d51122. Report an issue: GitHub.