{"record":{"id":"66067d731d7aebac","repo":"OpenBMB/ChatDev","slug":"failed-to-run-workflow-exc","errorCode":null,"errorMessage":"Failed to run workflow: {exc}","messagePattern":"Failed to run workflow: (.+?)","errorType":"exception","errorClass":"WorkflowExecutionError","httpStatus":null,"severity":"error","filePath":"server/routes/execute_sync.py","lineNumber":183,"sourceCode":"    if not accepts_stream:\n        try:\n            result = await run_in_threadpool(\n                run_workflow,\n                request.yaml_file,\n                task_prompt=request.task_prompt,\n                attachments=request.attachments,\n                session_name=request.session_name,\n                variables=request.variables,\n                log_level=resolved_log_level,\n            )\n        except FileNotFoundError as exc:\n            raise HTTPException(status_code=404, detail=str(exc))\n        except ValidationError as exc:\n            raise HTTPException(status_code=400, detail=str(exc))\n        except Exception as exc:\n            logger = get_server_logger()\n            logger.log_exception(exc, \"Failed to run workflow via sync API\")\n            raise WorkflowExecutionError(f\"Failed to run workflow: {exc}\")\n\n        final_message = result.final_message.text_content() if result.final_message else \"\"\n        meta = result.meta_info\n\n        logger = get_server_logger()\n        logger.info(\n            \"Workflow execution completed via sync API\",\n            log_type=LogType.WORKFLOW,\n            session_id=meta.session_name,\n            yaml_path=meta.yaml_file,\n        )\n\n        return {\n            \"status\": \"completed\",\n            \"final_message\": final_message,\n            \"token_usage\": meta.token_usage,\n            \"output_dir\": str(meta.output_dir.resolve()),\n        }","sourceCodeStart":165,"sourceCodeEnd":201,"githubUrl":"https://github.com/OpenBMB/ChatDev/blob/4fb2db0ea90375ce1059f44fe03ffbd191a7a169/server/routes/execute_sync.py#L165-L201","documentation":"An unexpected exception escaped the synchronous workflow run (not FileNotFoundError and not ValidationError). It is logged as 'Failed to run workflow via sync API' and re-raised as WorkflowExecutionError with the original message.","triggerScenarios":"POST /workflow/run where the workflow itself or the sync execution machinery raises: engine bugs, IO failures mid-run, serialization errors building the final message.","commonSituations":"Bugs in workflow steps, corrupted state in the session store, disk-full conditions while writing artifacts, version mismatches between workflow definition and engine.","solutions":["Read the server log entry 'Failed to run workflow via sync API' for the underlying traceback and address that","Reproduce with log_level=DEBUG for fuller output","Simplify the workflow to isolate the failing step","Update to the latest server version if the traceback points to engine internals"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":"# pre-flight: validate workflow YAML with the /schema/validate endpoint\nreport = client.schema_validate(open(yaml_file).read())\nassert report.get('valid'), report","typeGuard":null,"tryCatchPattern":"try:\n    result = client.run_workflow_sync(req)\nexcept WorkflowExecutionError as e:\n    capture_server_log('Failed to run workflow via sync API')\n    if transient(str(e)): retry_with_backoff(req)","preventionTips":["Validate workflow YAML before running","Run with log_level=DEBUG when diagnosing; keep server version current"],"tags":["workflow","http-500","internal-error"],"backgroundTag":"workflow-execution-failed","analyzedSha":"4fb2db0ea90375ce1059f44fe03ffbd191a7a169","analyzedAt":"2026-08-27T14:35:29.622Z","schemaVersion":2},"datasetVersion":"2026-08-27T19:17:21.184Z"}