{"record":{"id":"119ec3265c705396","repo":"bytedance/deer-flow","slug":"scheduled-task-repo-not-available","errorCode":null,"errorMessage":"Scheduled task repo not available","messagePattern":"Scheduled task repo not available","errorType":"http","errorClass":"HTTPException","httpStatus":503,"severity":"error","filePath":"backend/app/gateway/deps.py","lineNumber":647,"sourceCode":"\n\ndef get_store(request: Request):\n    \"\"\"Return the global store (may be ``None`` if not configured).\"\"\"\n    return getattr(request.app.state, \"store\", None)\n\n\ndef get_thread_store(request: Request) -> ThreadMetaStore:\n    \"\"\"Return the thread metadata store (SQL or memory-backed).\"\"\"\n    val = getattr(request.app.state, \"thread_store\", None)\n    if val is None:\n        raise HTTPException(status_code=503, detail=\"Thread metadata store not available\")\n    return val\n\n\ndef get_scheduled_task_repo(request: Request):\n    val = getattr(request.app.state, \"scheduled_task_repo\", None)\n    if val is None:\n        raise HTTPException(status_code=503, detail=\"Scheduled task repo not available\")\n    return val\n\n\ndef get_scheduled_task_run_repo(request: Request):\n    val = getattr(request.app.state, \"scheduled_task_run_repo\", None)\n    if val is None:\n        raise HTTPException(status_code=503, detail=\"Scheduled task run repo not available\")\n    return val\n\n\ndef get_scheduled_task_service(request: Request):\n    val = getattr(request.app.state, \"scheduled_task_service\", None)\n    if val is None:\n        raise HTTPException(status_code=503, detail=\"Scheduled task service not available\")\n    return val\n\n\ndef get_mcp_task_repo(request: Request):","sourceCodeStart":629,"sourceCodeEnd":665,"githubUrl":"https://github.com/bytedance/deer-flow/blob/1dd6ba1acb03700589994b0366c5d1c7d05e2eff/backend/app/gateway/deps.py#L629-L665","documentation":"HTTP 503 from get_scheduled_task_repo() when app.state.scheduled_task_repo is None. The scheduled-task repository backs the /workspace/scheduled-tasks feature; it is instantiated during lifespan only when the scheduler subsystem initialises, so its absence means scheduled-task persistence is not wired up.","triggerScenarios":"Calling scheduled-task CRUD routes (create/list/update/delete a scheduled task) when the repo was never attached — scheduler.enabled is false or misconfigured in config.yaml, or lifespan bootstrap of the scheduler failed.","commonSituations":"Operator left scheduler disabled in config.yaml but the frontend workspace page still calls the API; scheduler service failed to init because the underlying run store/thread store was unavailable; version skew where frontend deployed ahead of backend.","solutions":["Set scheduler.enabled: true in config.yaml and restart the Gateway (repo construction is restart-required)","Check Gateway startup logs for a scheduler initialisation exception and fix the underlying cause (usually DB or run store unavailability)","Verify the request hits the right Gateway instance — a stack running an older config without the scheduler will always 503 here"],"exampleFix":"# config.yaml\n# before\nscheduler:\n  enabled: false\n# after\nscheduler:\n  enabled: true\n# then: restart the Gateway (restart-required by design)","handlingStrategy":"validation","validationCode":"# before using scheduled-task APIs, confirm the feature is on\nimport yaml\ncfg = yaml.safe_load(open('config.yaml'))\nassert cfg.get('scheduler', {}).get('enabled') is True, 'scheduler disabled — scheduled-task API will 503'","typeGuard":"null","tryCatchPattern":"try:\n    task = await api.create_scheduled_task(payload)\nexcept HTTP503 as e:\n    if 'Scheduled task repo' in e.detail:\n        hide_scheduler_ui()  # feature-flag the UI off\n    else:\n        raise","preventionTips":["Feature-flag the scheduled-tasks UI on the same scheduler.enabled config the backend reads","Restart the Gateway after enabling the scheduler — it is restart-required","Add a readiness endpoint check for scheduler availability before showing the workspace page"],"tags":["http-503","scheduler","scheduled-tasks","config","gateway"],"backgroundTag":null,"analyzedSha":"1dd6ba1acb03700589994b0366c5d1c7d05e2eff","analyzedAt":"2026-08-14T21:20:34.804Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}