{"record":{"id":"f75d1f9fa82e38e0","repo":"Significant-Gravitas/AutoGPT","slug":"block-block-id-not-found","errorCode":null,"errorMessage":"Block #{block_id} not found.","messagePattern":"Block #(.+?) not found\\.","errorType":"http","errorClass":"HTTPException","httpStatus":404,"severity":"error","filePath":"autogpt_platform/backend/backend/api/external/v1/routes.py","lineNumber":104,"sourceCode":"    dependencies=[Security(require_permission(APIKeyPermission.EXECUTE_BLOCK))],\n)\nasync def execute_graph_block(\n    block_id: str,\n    data: BlockInput,\n    auth: APIAuthorizationInfo = Security(\n        require_permission(APIKeyPermission.EXECUTE_BLOCK)\n    ),\n) -> CompletedBlockOutput:\n    # Sync block exec doesn't pass through ``add_graph_execution`` (no\n    # central enqueue), and external API routes use API-key auth instead\n    # of JWT so the JWT-based dep doesn't apply either. Inline strict\n    # gate with the same fail-closed (503-on-blip) posture as the dep —\n    # consistent with chat / internal block / internal graph routes.\n    await enforce_payment_paywall(auth.user_id)\n\n    obj = backend.blocks.get_block(block_id)\n    if not obj:\n        raise HTTPException(status_code=404, detail=f\"Block #{block_id} not found.\")\n    if obj.disabled:\n        raise HTTPException(status_code=403, detail=f\"Block #{block_id} is disabled.\")\n\n    user = await user_db.get_user_by_id(auth.user_id)\n    if not user:\n        raise HTTPException(status_code=404, detail=\"User not found.\")\n\n    try:\n        await charge_for_direct_block_execution(\n            user_id=auth.user_id, block=obj, input_data=data, source=\"external\"\n        )\n    except InsufficientBalanceError as e:\n        raise HTTPException(\n            status_code=status.HTTP_402_PAYMENT_REQUIRED, detail=str(e)\n        ) from e\n\n    # Direct block execution has no graph; build a minimal ExecutionContext\n    # carrying the caller's identity + timezone so blocks that depend on","sourceCodeStart":86,"sourceCodeEnd":122,"githubUrl":"https://github.com/Significant-Gravitas/AutoGPT/blob/9c8bb5550f446ba5d3046b78896578742495b3cf/autogpt_platform/backend/backend/api/external/v1/routes.py#L86-L122","documentation":"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).","triggerScenarios":"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.","commonSituations":"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.","solutions":["Fetch the block catalog from the platform API and use ids from the running instance.","Upgrade the platform (or install the contributing block package) if the block exists upstream but not locally.","Verify the id is a complete, exact UUID string."],"exampleFix":"# before\nPOST /blocks/31d1064e-0e0f-4d1d-0000-000000000000/execute  # typo -> 404\n\n# after\nblocks = GET /api/external-api/v1/blocks\nPOST /blocks/{blocks[i].id}/execute","handlingStrategy":"validation","validationCode":"blocks = client.get(\"/blocks\").json()  # block catalog of this deployment\nids = {b[\"id\"] for b in blocks}\nassert block_id in ids, f\"block {block_id} not registered here\"","typeGuard":null,"tryCatchPattern":"try:\n    client.post(f\"/blocks/{block_id}/execute\", json=data)\nexcept HTTPError as e:\n    if e.response.status_code == 404:\n        blocks = client.get(\"/blocks\").json()\n        raise UnknownBlock(f\"{block_id} not in catalog of {len(blocks)} blocks\") from e\n    raise","preventionTips":["Discover block ids from the running instance, never from docs of another version.","Pin block ids in config validated against the catalog at startup."],"tags":["blocks","not-found","external-api","registry"],"backgroundTag":null,"analyzedSha":"9c8bb5550f446ba5d3046b78896578742495b3cf","analyzedAt":"2026-08-14T17:17:21.957Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}