bytedance/deer-flow · error · HTTPException

Run {run_id} is not active on this worker and cannot be canc

Error message

Run {run_id} is not active on this worker and cannot be cancelled

What it means

Error "Run {run_id} is not active on this worker and cannot be cancelled" thrown in bytedance/deer-flow.

Source

Thrown at backend/app/gateway/routers/thread_runs.py:980

            return Response(status_code=204)
        if wait and outcome == CancelOutcome.requested:
            bridge = get_stream_bridge(request)
            if record.store_only and bridge.supports_cross_process:
                completed = await wait_for_run_completion(
                    bridge,
                    record,
                    request,
                    run_mgr,
                )
                if completed:
                    return Response(status_code=204)
        return Response(status_code=202)

    if outcome == CancelOutcome.lease_valid_elsewhere:
        await _raise_lease_valid_elsewhere(run_id, run_mgr, record)

    # not_cancellable, not_active_locally, unknown
    raise HTTPException(status_code=409, detail=_cancel_conflict_detail(run_id, record))


@router.get("/{thread_id}/runs/{run_id}/join")
@require_permission("runs", "read", owner_check=True)
async def join_run(thread_id: ThreadId, run_id: str, request: Request) -> StreamingResponse:
    """Join an existing run's SSE stream."""
    run_mgr = get_run_manager(request)
    record = await run_mgr.get(run_id)
    if record is None or record.thread_id != thread_id:
        raise HTTPException(status_code=404, detail=f"Run {run_id} not found")
    bridge = get_stream_bridge(request)
    if record.store_only and not bridge.supports_cross_process:
        raise HTTPException(status_code=409, detail=f"Run {run_id} is not active on this worker and cannot be streamed")

    return StreamingResponse(
        sse_consumer(bridge, record, request, run_mgr),
        media_type="text/event-stream",
        headers={

View on GitHub (pinned to 1dd6ba1acb)

Solutions

  1. The run is owned by another worker; wait for it to finish or for its lease to expire, then cancel.
  2. If the owning worker is down, reconciliation will mark the run orphaned; retry after that.

When it happens

Trigger: Thrown at backend/app/gateway/routers/thread_runs.py:980 when the library encounters an invalid state.

Common situations: See trigger scenarios.


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