bytedance/deer-flow · error · HTTPException

Scheduled task repo not available

Error message

Scheduled task repo not available

What it means

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.

Source

Thrown at backend/app/gateway/deps.py:647


def get_store(request: Request):
    """Return the global store (may be ``None`` if not configured)."""
    return getattr(request.app.state, "store", None)


def get_thread_store(request: Request) -> ThreadMetaStore:
    """Return the thread metadata store (SQL or memory-backed)."""
    val = getattr(request.app.state, "thread_store", None)
    if val is None:
        raise HTTPException(status_code=503, detail="Thread metadata store not available")
    return val


def get_scheduled_task_repo(request: Request):
    val = getattr(request.app.state, "scheduled_task_repo", None)
    if val is None:
        raise HTTPException(status_code=503, detail="Scheduled task repo not available")
    return val


def get_scheduled_task_run_repo(request: Request):
    val = getattr(request.app.state, "scheduled_task_run_repo", None)
    if val is None:
        raise HTTPException(status_code=503, detail="Scheduled task run repo not available")
    return val


def get_scheduled_task_service(request: Request):
    val = getattr(request.app.state, "scheduled_task_service", None)
    if val is None:
        raise HTTPException(status_code=503, detail="Scheduled task service not available")
    return val


def get_mcp_task_repo(request: Request):

View on GitHub (pinned to 1dd6ba1acb)

Solutions

  1. Set scheduler.enabled: true in config.yaml and restart the Gateway (repo construction is restart-required)
  2. Check Gateway startup logs for a scheduler initialisation exception and fix the underlying cause (usually DB or run store unavailability)
  3. Verify the request hits the right Gateway instance — a stack running an older config without the scheduler will always 503 here

Example fix

# config.yaml
# before
scheduler:
  enabled: false
# after
scheduler:
  enabled: true
# then: restart the Gateway (restart-required by design)
Defensive patterns

Strategy: validation

Validate before calling

# before using scheduled-task APIs, confirm the feature is on
import yaml
cfg = yaml.safe_load(open('config.yaml'))
assert cfg.get('scheduler', {}).get('enabled') is True, 'scheduler disabled — scheduled-task API will 503'

Type guard

null

Try / catch

try:
    task = await api.create_scheduled_task(payload)
except HTTP503 as e:
    if 'Scheduled task repo' in e.detail:
        hide_scheduler_ui()  # feature-flag the UI off
    else:
        raise

Prevention

When it happens

Trigger: 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.

Common situations: 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.

Related errors


AI-assisted analysis of bytedance/deer-flow@1dd6ba1acb (2026-08-14). Data as JSON: /api/errors/119ec3265c705396. Report an issue: GitHub.