{"record":{"id":"8b6fe5896eaf82b6","repo":"calesthio/OpenMontage","slug":"execution-error-data","errorCode":null,"errorMessage":"Execution error: {data}","messagePattern":"Execution error: (.+?)","errorType":"exception","errorClass":"ComfyUIError","httpStatus":null,"severity":"error","filePath":"tools/_comfyui/client.py","lineNumber":317,"sourceCode":"                    entry = self._history_entry_if_reachable(prompt_id)\n                    if entry is not None:\n                        return entry\n                    continue\n                if not isinstance(raw, str):\n                    continue  # binary preview-image frame, not a status message\n                try:\n                    message = json.loads(raw)\n                except json.JSONDecodeError:\n                    continue\n                data = message.get(\"data\", {})\n                if data.get(\"prompt_id\") not in (None, prompt_id):\n                    continue  # another job sharing this connection\n                msg_type = message.get(\"type\")\n                if msg_type == \"progress\":\n                    if on_progress:\n                        on_progress(data)\n                elif msg_type == \"execution_error\":\n                    raise ComfyUIError(f\"Execution error: {data}\", prompt_id=prompt_id)\n                elif msg_type == \"executing\" and data.get(\"node\") is None:\n                    finished = True\n                    break\n        finally:\n            conn.close()\n\n        if not finished:\n            entry = self._history_entry_if_reachable(prompt_id)\n            if entry is not None:\n                return entry\n            raise ComfyUIError(\n                f\"Prompt {prompt_id} did not complete within {timeout}s \"\n                f\"(websocket wait). The job was not cancelled — resume with \"\n                f\"resume_prompt_id={prompt_id!r} and a longer timeout.\",\n                prompt_id=prompt_id,\n            )\n\n        entry = self._history_entry(prompt_id)","sourceCodeStart":299,"sourceCodeEnd":335,"githubUrl":"https://github.com/calesthio/OpenMontage/blob/95e1c3d0ab93482159818560f6a8c8e866b9139f/tools/_comfyui/client.py#L299-L335","documentation":"ComfyUIError raised inside wait_ws when the ComfyUI websocket pushes an execution_error message for this prompt_id. It is the streaming equivalent of the history-based execution error: the server reported a node failure while the client was listening on the socket. The message data (node type, exception, traceback hint) is embedded, and prompt_id is attached so callers can correlate.","triggerScenarios":"wait_ws() is awaiting a run and a node raises server-side — same root causes as the polled variant (OOM, missing model, custom node exception) — but detected via the websocket 'execution_error' frame instead of history polling.","commonSituations":"Identical to the history variant; surfaces faster since the push arrives immediately when the node fails rather than on the next poll tick; multi-client setups where the socket also relays other jobs' errors (filtered here by prompt_id).","solutions":["Inspect the embedded data dict — 'node_type' and 'exception_message' pinpoint the failure","Apply the same fixes as execution errors: memory, models, custom-node versions","Check the ComfyUI server console for the full stack trace for custom node bugs","If errors are transient (rare socket/parse races), resubmit once with the same patched workflow"],"exampleFix":"# before\nentry = client.wait_ws(prompt_id, timeout=600)\n\n# after\ntry:\n    entry = client.wait_ws(prompt_id, timeout=600)\nexcept ComfyUIError as e:\n    print(f\"node failure for {e.prompt_id}: {e}\")\n    raise","handlingStrategy":"try-catch","validationCode":"import requests\n# submit only when the node types the workflow needs exist server-side\ninfo = requests.get(f\"{server_url}/object_info\", timeout=10).json()\nneeded = {n[\"class_type\"] for n in workflow.values()}\nmissing = needed - info.keys()\nif missing:\n    raise SystemExit(f\"server lacks node types: {missing}\")","typeGuard":null,"tryCatchPattern":"try:\n    entry = client.wait_ws(prompt_id, timeout=timeout)\nexcept ComfyUIError as e:\n    if \"Execution error\" in str(e) and getattr(e, \"prompt_id\", None) == prompt_id:\n        raise SystemExit(f\"node crashed server-side: {e}\")\n    raise","preventionTips":["Validate node availability via /object_info before submitting","Keep one websocket per prompt to avoid cross-talk error frames","Watch the ComfyUI console alongside wait_ws for full tracebacks"],"tags":["comfyui","websocket","execution-error"],"backgroundTag":null,"analyzedSha":"95e1c3d0ab93482159818560f6a8c8e866b9139f","analyzedAt":"2026-08-15T06:31:20.014Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}