Significant-Gravitas/AutoGPT · error · HTTPException

Block #{block_id} not found.

Error message

Block #{block_id} not found.

What it means

Raised (HTTP 404) by the external execute-block endpoint when `backend.blocks.get_block(block_id)` returns None — no block with that id is registered in the running backend's block registry. Block ids are UUIDs/strings fixed per block class; an unknown id means the block doesn't exist in this deployment (never loaded, renamed, or from a different version).

Source

Thrown at autogpt_platform/backend/backend/api/external/v1/routes.py:104

    dependencies=[Security(require_permission(APIKeyPermission.EXECUTE_BLOCK))],
)
async def execute_graph_block(
    block_id: str,
    data: BlockInput,
    auth: APIAuthorizationInfo = Security(
        require_permission(APIKeyPermission.EXECUTE_BLOCK)
    ),
) -> CompletedBlockOutput:
    # Sync block exec doesn't pass through ``add_graph_execution`` (no
    # central enqueue), and external API routes use API-key auth instead
    # of JWT so the JWT-based dep doesn't apply either. Inline strict
    # gate with the same fail-closed (503-on-blip) posture as the dep —
    # consistent with chat / internal block / internal graph routes.
    await enforce_payment_paywall(auth.user_id)

    obj = backend.blocks.get_block(block_id)
    if not obj:
        raise HTTPException(status_code=404, detail=f"Block #{block_id} not found.")
    if obj.disabled:
        raise HTTPException(status_code=403, detail=f"Block #{block_id} is disabled.")

    user = await user_db.get_user_by_id(auth.user_id)
    if not user:
        raise HTTPException(status_code=404, detail="User not found.")

    try:
        await charge_for_direct_block_execution(
            user_id=auth.user_id, block=obj, input_data=data, source="external"
        )
    except InsufficientBalanceError as e:
        raise HTTPException(
            status_code=status.HTTP_402_PAYMENT_REQUIRED, detail=str(e)
        ) from e

    # Direct block execution has no graph; build a minimal ExecutionContext
    # carrying the caller's identity + timezone so blocks that depend on

View on GitHub (pinned to 9c8bb5550f)

Solutions

  1. Fetch the block catalog from the platform API and use ids from the running instance.
  2. Upgrade the platform (or install the contributing block package) if the block exists upstream but not locally.
  3. Verify the id is a complete, exact UUID string.

Example fix

# before
POST /blocks/31d1064e-0e0f-4d1d-0000-000000000000/execute  # typo -> 404

# after
blocks = GET /api/external-api/v1/blocks
POST /blocks/{blocks[i].id}/execute
Defensive patterns

Strategy: validation

Validate before calling

blocks = client.get("/blocks").json()  # block catalog of this deployment
ids = {b["id"] for b in blocks}
assert block_id in ids, f"block {block_id} not registered here"

Try / catch

try:
    client.post(f"/blocks/{block_id}/execute", json=data)
except HTTPError as e:
    if e.response.status_code == 404:
        blocks = client.get("/blocks").json()
        raise UnknownBlock(f"{block_id} not in catalog of {len(blocks)} blocks") from e
    raise

Prevention

When it happens

Trigger: POST `/api/external-api/v1/blocks/{block_id}/execute` with a block id that is not registered — typo'd uuid, block from a newer/older platform version, or a custom block not installed.

Common situations: Hardcoding block ids from docs of a different release; SDK-contributed blocks not installed in self-hosted deployments; ids copied with truncation or wrong casing.

Related errors


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