Significant-Gravitas/AutoGPT · error · HTTPException

Shared execution not found

Error message

Shared execution not found

What it means

Public, unauthenticated endpoint GET /v1/public/shared/{share_token} returned 404 because `get_graph_execution_by_share_token(share_token)` found no shared execution with that token. The token must match SHARE_TOKEN_PATTERN at the path-validation layer and exist as an active share; revoked or never-created tokens look identical to malformed ones.

Source

Thrown at autogpt_platform/backend/backend/api/features/v1.py:2354

            is_shared=False,
            share_token=None,
            shared_at=None,
        )
    except NotFoundError as exc:
        raise HTTPException(status_code=404, detail=str(exc))


@v1_router.get("/public/shared/{share_token}")
async def get_shared_execution(
    share_token: Annotated[
        str,
        Path(pattern=SHARE_TOKEN_PATTERN),
    ],
) -> execution_db.SharedExecutionResponse:
    """Get a shared graph execution by share token (no auth required)."""
    execution = await execution_db.get_graph_execution_by_share_token(share_token)
    if not execution:
        raise HTTPException(status_code=404, detail="Shared execution not found")

    return execution


@v1_router.get(
    "/public/shared/{share_token}/files/{file_id}/download",
    summary="Download a file from a shared execution",
    operation_id="download_shared_file",
    tags=["graphs"],
)
async def download_shared_file(
    share_token: Annotated[
        str,
        Path(pattern=SHARE_TOKEN_PATTERN),
    ],
    file_id: Annotated[
        str,
        Path(pattern=SHARE_TOKEN_PATTERN),

View on GitHub (pinned to 9c8bb5550f)

Solutions

  1. Ask the owner to re-enable sharing and send the fresh link — tokens are regenerated per share.
  2. Verify the token was copied whole (no whitespace/truncation) and matches the environment the link came from.
  3. Owners: re-check that sharing is still enabled on the execution if the link suddenly stops working.
Defensive patterns

Strategy: validation

Validate before calling

const SHARE_TOKEN_RE = /^[A-Za-z0-9_-]{16,}$/; // mirror SHARE_TOKEN_PATTERN
function isPlausibleShareToken(t: string): boolean {
  return SHARE_TOKEN_RE.test(t.trim());
}

Type guard

function isPlausibleShareToken(t: string): boolean {
  return typeof t === 'string' && /^[A-Za-z0-9_-]{16,}$/.test(t.trim());
}

Try / catch

try {
  const shared = await api.getSharedExecution(token);
  return { ok: true, shared };
} catch (e) {
  if (e.status === 404) return { ok: false, reason: 'expired-or-invalid' };
  throw e;
}

Prevention

When it happens

Trigger: Opening {frontend_base_url}/share/{share_token} (or calling GET /v1/public/shared/{token}) with a typo'd token, a token whose sharing was disabled (share_token set to NULL), or a token from a different environment/database.

Common situations: User un-shared (disable_execution_sharing set share_token=None) but a recipient still has the old link; links copied between staging and production; truncated or URL-mangled tokens.

Related errors


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