{"record":{"id":"ca3c4c38e5619ee5","repo":"calesthio/OpenMontage","slug":"no-prompt-id-in-response-data","errorCode":null,"errorMessage":"No prompt_id in response: {data}","messagePattern":"No prompt_id in response: (.+?)","errorType":"exception","errorClass":"ComfyUIError","httpStatus":null,"severity":"error","filePath":"tools/_comfyui/client.py","lineNumber":196,"sourceCode":"    def submit(self, workflow: dict) -> str:\n        \"\"\"Queue a workflow for execution.  Returns the ``prompt_id``.\"\"\"\n        resp = requests.post(\n            f\"{self.server_url}/prompt\",\n            json={\"prompt\": workflow, \"client_id\": self.client_id},\n            timeout=30,\n        )\n        try:\n            data = resp.json()\n        except ValueError:\n            data = {}\n        if data.get(\"node_errors\"):\n            raise ComfyUIError(f\"Node errors: {json.dumps(data['node_errors'])}\")\n        if data.get(\"error\"):\n            raise ComfyUIError(f\"Prompt error: {json.dumps(data['error'])}\")\n        resp.raise_for_status()\n        prompt_id = data.get(\"prompt_id\")\n        if not prompt_id:\n            raise ComfyUIError(f\"No prompt_id in response: {data}\")\n        return prompt_id\n\n    def poll(\n        self,\n        prompt_id: str,\n        *,\n        timeout: int = 600,\n        interval: int = 5,\n    ) -> dict:\n        \"\"\"Block until *prompt_id* finishes.  Returns the history entry.\"\"\"\n        deadline = time.time() + timeout\n        while time.time() < deadline:\n            entry = self._history_entry(prompt_id)\n            if entry is not None:\n                return entry\n            time.sleep(interval)\n        raise ComfyUIError(\n            f\"Prompt {prompt_id} did not complete within {timeout}s. \"","sourceCodeStart":178,"sourceCodeEnd":214,"githubUrl":"https://github.com/calesthio/OpenMontage/blob/95e1c3d0ab93482159818560f6a8c8e866b9139f/tools/_comfyui/client.py#L178-L214","documentation":"ComfyUIError raised when the /prompt response parsed successfully and contained no node_errors or error, yet lacks a prompt_id field. prompt_id is the only handle the client has for polling history and websockets, so without it the call cannot proceed. It usually indicates the server responded with something unexpected — an HTML error page that happened to parse, a proxy interposing, or an empty JSON object.","triggerScenarios":"submit() gets a 200 response whose body is {} or an unexpected shape; a reverse proxy returns a JSON body without prompt_id; ComfyUI is behind auth that returned a JSON-formatted denial; a very old/new ComfyUI build with a changed response contract.","commonSituations":"Wrong server_url pointing at a non-ComfyUI service; ComfyUI not fully started when the first submit lands; a port conflict serving a different tool; version mismatch between client expectations and server build.","solutions":["Print the embedded data payload — it shows exactly what the server returned","Curl the server directly (GET {server_url}/system_stats) to confirm a real ComfyUI is listening at that URL","Remove/verify any proxy in front of ComfyUI or whitelist the client in ComfyUI's security config","Restart ComfyUI and wait for its startup log line before submitting"],"exampleFix":"# before\nclient = ComfyUIClient(\"http://localhost:8188\")  # wrong port/service\n\n# after\nimport requests\nassert requests.get(\"http://localhost:8188/system_stats\", timeout=5).ok\nclient = ComfyUIClient(\"http://localhost:8188\")","handlingStrategy":"validation","validationCode":"import requests\nstats = requests.get(f\"{server_url}/system_stats\", timeout=5)\nstats.raise_for_status()  # real ComfyUI responds here\nassert \"comfyui\" in stats.json().get(\"system\", {}).get(\"comfyui_version\", \"\") or stats.ok","typeGuard":"def comfyui_is_alive(server_url: str) -> bool:\n    try:\n        return requests.get(f\"{server_url}/system_stats\", timeout=5).ok\n    except requests.RequestException:\n        return False","tryCatchPattern":"try:\n    prompt_id = client.submit(workflow)\nexcept ComfyUIError as e:\n    if \"No prompt_id\" in str(e):\n        raise SystemExit(f\"server at {client.server_url} is not a healthy ComfyUI — check URL/proxy/startup\")\n    raise","preventionTips":["Health-check GET /system_stats before the first submit","Wait for ComfyUI's startup-complete log before driving it","Ensure no auth layer or proxy rewrites /prompt responses"],"tags":["comfyui","api-contract","server-misconfig"],"backgroundTag":null,"analyzedSha":"95e1c3d0ab93482159818560f6a8c8e866b9139f","analyzedAt":"2026-08-15T06:31:20.014Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}