{"record":{"id":"f0f196ac254f59b2","repo":"Significant-Gravitas/AutoGPT","slug":"execution-not-found","errorCode":null,"errorMessage":"Execution not found","messagePattern":"Execution not found","errorType":"http","errorClass":"HTTPException","httpStatus":404,"severity":"error","filePath":"autogpt_platform/backend/backend/api/features/admin/diagnostics_admin_routes.py","lineNumber":530,"sourceCode":"    Stop a single execution (admin only).\n\n    Uses robust stop_graph_execution which cascades to children and waits for termination.\n\n    Args:\n        request: Contains execution_id to stop\n\n    Returns:\n        Success status and message\n    \"\"\"\n    logger.info(f\"Admin {user.user_id} stopping execution {request.execution_id}\")\n\n    # Get the execution to find its owner user_id (required by stop_graph_execution)\n    executions = await get_graph_executions(\n        graph_exec_id=request.execution_id,\n    )\n\n    if not executions:\n        raise HTTPException(status_code=404, detail=\"Execution not found\")\n\n    execution = executions[0]\n\n    # Use robust stop_graph_execution (cascades to children, waits for termination)\n    await stop_graph_execution(\n        user_id=execution.user_id,\n        graph_exec_id=request.execution_id,\n        wait_timeout=15.0,\n        cascade=True,\n    )\n\n    return StopExecutionResponse(\n        success=True,\n        stopped_count=1,\n        message=\"Execution stopped successfully\",\n    )\n\n","sourceCodeStart":512,"sourceCodeEnd":548,"githubUrl":"https://github.com/Significant-Gravitas/AutoGPT/blob/9c8bb5550f446ba5d3046b78896578742495b3cf/autogpt_platform/backend/backend/api/features/admin/diagnostics_admin_routes.py#L512-L548","documentation":"HTTP 404 from the admin stop-execution endpoint. get_graph_executions with just graph_exec_id returned no rows, so no AgentGraphExecution with that id exists at all (unlike the requeue endpoint, no status filter applies here). The stop is never attempted.","triggerScenarios":"POST /admin/execution/stop with a malformed or non-existent execution UUID — e.g. truncated when copying, wrong environment (dev id against prod), or the execution record was deleted.","commonSituations":"Stopping an execution already purged by retention; using an execution id from a logs URL that was URL-encoded/truncated; copy-paste between staging and production consoles.","solutions":["Confirm the full UUID exists: check the executions list or AgentGraphExecution table.","Paste ids programmatically (from the API/DB) rather than by hand to avoid truncation.","Ensure you are authenticated against the same environment where the execution ran.","If the row was deleted, no stop is needed — the executor has no record to stop."],"exampleFix":null,"handlingStrategy":"validation","validationCode":"const UUID_RE = /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;\nif (!UUID_RE.test(executionId)) throw new Error('invalid execution id');","typeGuard":"function isExecutionId(id: string): boolean { return /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i.test(id); }","tryCatchPattern":null,"preventionTips":["Pass execution ids programmatically, never hand-typed.","Confirm the environment (dev/stage/prod) matches where the execution ran."],"tags":["http-404","admin-api","execution","not-found"],"backgroundTag":null,"analyzedSha":"9c8bb5550f446ba5d3046b78896578742495b3cf","analyzedAt":"2026-08-14T17:17:21.957Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}