{"record":{"id":"c4f0cc5e442791b4","repo":"Significant-Gravitas/AutoGPT","slug":"schedule-schedule-id-not-found","errorCode":null,"errorMessage":"Schedule #{schedule_id} not found","messagePattern":"Schedule #(.+?) not found","errorType":"http","errorClass":"HTTPException","httpStatus":404,"severity":"error","filePath":"autogpt_platform/backend/backend/api/features/v1.py","lineNumber":2569,"sourceCode":"    # the response with a Pydantic validation error.\n    return [s for s in schedules if isinstance(s, scheduler.CopilotTurnJobInfo)]\n\n\n@v1_router.delete(\n    path=\"/schedules/{schedule_id}\",\n    summary=\"Delete execution schedule\",\n    tags=[\"schedules\"],\n    dependencies=[Security(requires_user)],\n)\nasync def delete_graph_execution_schedule(\n    user_id: Annotated[str, Security(get_user_id)],\n    ctx: Annotated[RequestContext, Security(get_request_context)],\n    schedule_id: str = Path(..., description=\"ID of the schedule to delete\"),\n) -> dict[str, Any]:\n    try:\n        await get_scheduler_client().delete_schedule(schedule_id, user_id=user_id)\n    except NotFoundError:\n        raise HTTPException(\n            status_code=HTTP_404_NOT_FOUND,\n            detail=f\"Schedule #{schedule_id} not found\",\n        )\n    return {\"id\": schedule_id}\n\n\n########################################################\n##################### COPILOT SKILLS #####################\n########################################################\n\n\nclass CopilotSkillInfo(BaseModel):\n    \"\"\"User-distilled copilot skill metadata for the library UI.\n\n    Defaults (built-in agent-building / MCP-tool guides) are intentionally\n    excluded — they cannot be edited or deleted, so surfacing them in the\n    user-facing list would add noise without affordances.\n    \"\"\"","sourceCodeStart":2551,"sourceCodeEnd":2587,"githubUrl":"https://github.com/Significant-Gravitas/AutoGPT/blob/9c8bb5550f446ba5d3046b78896578742495b3cf/autogpt_platform/backend/backend/api/features/v1.py#L2551-L2587","documentation":"Schedule-deletion endpoint converts a NotFoundError from the scheduler client (`get_scheduler_client().delete_schedule(schedule_id, user_id=user_id)`) into a 404. The call is user-scoped, so the scheduler raises NotFound both when the schedule ID doesn't exist and when it exists but belongs to a different user — identical 404 either way.","triggerScenarios":"DELETE /v1/schedules/{schedule_id} where the ID is wrong, the schedule was already deleted (double-delete), or it belongs to another user.","commonSituations":"Two clicks on a delete button with the second racing the first; UI list out of sync with the scheduler; environments where the scheduler service was reset (redis-backed scheduler lost its jobs) while the DB list still shows them.","solutions":["Refresh the schedules list and reconcile client state — a 404 on delete usually means already gone, which is safe to treat as success in the UI.","Confirm the schedule_id comes from the authenticated user's own list.","If the scheduler was wiped but the UI still lists schedules, re-sync by re-fetching from the scheduler-backed list endpoint."],"exampleFix":"// before\nawait api.deleteSchedule(id);\n// after — treat 404 as idempotent success\nconst res = await api.deleteSchedule(id);\nif (res.status === 404) { /* already deleted */ }","handlingStrategy":"fallback","validationCode":"const schedules = await api.listSchedules();\nconst exists = schedules.some(s => s.id === scheduleId);\nif (!exists) { removeScheduleFromUi(scheduleId); return; }","typeGuard":null,"tryCatchPattern":"try {\n  await api.deleteSchedule(scheduleId);\n} catch (e) {\n  if (e.status === 404) { removeScheduleFromUi(scheduleId); return; } // idempotent\n  throw e;\n}","preventionTips":["Treat schedule-delete 404 as success (already gone) and reconcile the list.","Disable the delete button while a deletion is in flight to avoid double submits.","Refresh schedules after scheduler restarts, since scheduler state may have been wiped."],"tags":["http-404","schedules","scheduler","idempotency"],"backgroundTag":null,"analyzedSha":"9c8bb5550f446ba5d3046b78896578742495b3cf","analyzedAt":"2026-08-14T17:17:21.957Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}