{"record":{"id":"4ba2a0f7a2da2e20","repo":"bytedance/deer-flow","slug":"run-run-id-is-not-active-on-this-worker-and-cann-4ba2a0","errorCode":null,"errorMessage":"Run {run_id} is not active on this worker and cannot be streamed","messagePattern":"Run (.+?) is not active on this worker and cannot be streamed","errorType":"http","errorClass":"HTTPException","httpStatus":409,"severity":"error","filePath":"backend/app/gateway/routers/thread_runs.py","lineNumber":993,"sourceCode":"\n    if outcome == CancelOutcome.lease_valid_elsewhere:\n        await _raise_lease_valid_elsewhere(run_id, run_mgr, record)\n\n    # not_cancellable, not_active_locally, unknown\n    raise HTTPException(status_code=409, detail=_cancel_conflict_detail(run_id, record))\n\n\n@router.get(\"/{thread_id}/runs/{run_id}/join\")\n@require_permission(\"runs\", \"read\", owner_check=True)\nasync def join_run(thread_id: ThreadId, run_id: str, request: Request) -> StreamingResponse:\n    \"\"\"Join an existing run's SSE stream.\"\"\"\n    run_mgr = get_run_manager(request)\n    record = await run_mgr.get(run_id)\n    if record is None or record.thread_id != thread_id:\n        raise HTTPException(status_code=404, detail=f\"Run {run_id} not found\")\n    bridge = get_stream_bridge(request)\n    if record.store_only and not bridge.supports_cross_process:\n        raise HTTPException(status_code=409, detail=f\"Run {run_id} is not active on this worker and cannot be streamed\")\n\n    return StreamingResponse(\n        sse_consumer(bridge, record, request, run_mgr),\n        media_type=\"text/event-stream\",\n        headers={\n            \"Cache-Control\": \"no-cache\",\n            \"Connection\": \"keep-alive\",\n            \"X-Accel-Buffering\": \"no\",\n        },\n    )\n\n\n# Register GET and POST as separate routes so each method gets a unique OpenAPI\n# operationId. ``api_route(methods=[\"GET\", \"POST\"])`` shares one route registration\n# across both methods, which makes FastAPI emit the same ``operationId`` twice and\n# warn about a duplicate operation id during OpenAPI generation.\n@router.get(\"/{thread_id}/runs/{run_id}/stream\", response_model=None)\n@router.post(\"/{thread_id}/runs/{run_id}/stream\", response_model=None)","sourceCodeStart":975,"sourceCodeEnd":1011,"githubUrl":"https://github.com/bytedance/deer-flow/blob/1dd6ba1acb03700589994b0366c5d1c7d05e2eff/backend/app/gateway/routers/thread_runs.py#L975-L1011","documentation":"Error \"Run {run_id} is not active on this worker and cannot be streamed\" thrown in bytedance/deer-flow.","triggerScenarios":"Thrown at backend/app/gateway/routers/thread_runs.py:993 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Stream the run from the worker that owns it (sticky routing) or wait for lease expiry.","Start a new run if the original is no longer active."],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"1dd6ba1acb03700589994b0366c5d1c7d05e2eff","analyzedAt":"2026-08-14T21:20:34.804Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}