calesthio/OpenMontage · error · ComfyUIError

Execution error: {data}

Error message

Execution error: {data}

What it means

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.

Source

Thrown at tools/_comfyui/client.py:317

                    entry = self._history_entry_if_reachable(prompt_id)
                    if entry is not None:
                        return entry
                    continue
                if not isinstance(raw, str):
                    continue  # binary preview-image frame, not a status message
                try:
                    message = json.loads(raw)
                except json.JSONDecodeError:
                    continue
                data = message.get("data", {})
                if data.get("prompt_id") not in (None, prompt_id):
                    continue  # another job sharing this connection
                msg_type = message.get("type")
                if msg_type == "progress":
                    if on_progress:
                        on_progress(data)
                elif msg_type == "execution_error":
                    raise ComfyUIError(f"Execution error: {data}", prompt_id=prompt_id)
                elif msg_type == "executing" and data.get("node") is None:
                    finished = True
                    break
        finally:
            conn.close()

        if not finished:
            entry = self._history_entry_if_reachable(prompt_id)
            if entry is not None:
                return entry
            raise ComfyUIError(
                f"Prompt {prompt_id} did not complete within {timeout}s "
                f"(websocket wait). The job was not cancelled — resume with "
                f"resume_prompt_id={prompt_id!r} and a longer timeout.",
                prompt_id=prompt_id,
            )

        entry = self._history_entry(prompt_id)

View on GitHub (pinned to 95e1c3d0ab)

Solutions

  1. Inspect the embedded data dict — 'node_type' and 'exception_message' pinpoint the failure
  2. Apply the same fixes as execution errors: memory, models, custom-node versions
  3. Check the ComfyUI server console for the full stack trace for custom node bugs
  4. If errors are transient (rare socket/parse races), resubmit once with the same patched workflow

Example fix

# before
entry = client.wait_ws(prompt_id, timeout=600)

# after
try:
    entry = client.wait_ws(prompt_id, timeout=600)
except ComfyUIError as e:
    print(f"node failure for {e.prompt_id}: {e}")
    raise
Defensive patterns

Strategy: try-catch

Validate before calling

import requests
# submit only when the node types the workflow needs exist server-side
info = requests.get(f"{server_url}/object_info", timeout=10).json()
needed = {n["class_type"] for n in workflow.values()}
missing = needed - info.keys()
if missing:
    raise SystemExit(f"server lacks node types: {missing}")

Try / catch

try:
    entry = client.wait_ws(prompt_id, timeout=timeout)
except ComfyUIError as e:
    if "Execution error" in str(e) and getattr(e, "prompt_id", None) == prompt_id:
        raise SystemExit(f"node crashed server-side: {e}")
    raise

Prevention

When it happens

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

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

Related errors


AI-assisted analysis of calesthio/OpenMontage@95e1c3d0ab (2026-08-15). Data as JSON: /api/errors/8b6fe5896eaf82b6. Report an issue: GitHub.