{"record":{"id":"895c4f67f195a718","repo":"Comfy-Org/ComfyUI","slug":"message","errorCode":null,"errorMessage":"{message}","messagePattern":"\\{message\\}","errorType":"exception","errorClass":"Exception","httpStatus":null,"severity":"error","filePath":"comfy_api_nodes/nodes_sora.py","lineNumber":147,"sourceCode":"        if image is not None:\n            if get_number_of_images(image) != 1:\n                raise ValueError(\"Currently only one input image is supported.\")\n            files_input = {\"input_reference\": (\"image.png\", tensor_to_bytesio(image), \"image/png\")}\n        initial_response = await sync_op(\n            cls,\n            endpoint=ApiEndpoint(path=\"/proxy/openai/v1/videos\", method=\"POST\"),\n            data=Sora2GenerationRequest(\n                model=model,\n                prompt=prompt,\n                seconds=str(duration),\n                size=size,\n            ),\n            files=files_input,\n            response_model=Sora2GenerationResponse,\n            content_type=\"multipart/form-data\",\n        )\n        if initial_response.error:\n            raise Exception(initial_response.error[\"message\"])\n\n        model_time_multiplier = 1 if model == \"sora-2\" else 2\n        await poll_op(\n            cls,\n            poll_endpoint=ApiEndpoint(path=f\"/proxy/openai/v1/videos/{initial_response.id}\"),\n            response_model=Sora2GenerationResponse,\n            status_extractor=lambda x: x.status,\n            poll_interval=8.0,\n            estimated_duration=int(45 * (duration / 4) * model_time_multiplier),\n        )\n        return IO.NodeOutput(\n            await download_url_to_video_output(f\"/proxy/openai/v1/videos/{initial_response.id}/content\", cls=cls),\n        )\n\n\nclass OpenAISoraExtension(ComfyExtension):\n    @override\n    async def get_node_list(self) -> list[type[IO.ComfyNode]]:","sourceCodeStart":129,"sourceCodeEnd":165,"githubUrl":"https://github.com/Comfy-Org/ComfyUI/blob/1c6d8d45b3693bfbb32385b410d813a7fd6be216/comfy_api_nodes/nodes_sora.py#L129-L165","documentation":"Raised by the Sora-2 node when the initial generation response carries an `error` field. The OpenAI proxy returns submission errors (auth, quota, invalid parameters, moderation) inline in the response body rather than via HTTP status, and the node re-raises the embedded message verbatim as a generic Exception.","triggerScenarios":"POST to /proxy/openai/v1/videos returning a Sora2GenerationResponse with error set — invalid OpenAI/API key, insufficient credits, disallowed prompt content, or unsupported parameter combination.","commonSituations":"Missing or expired OpenAI API key configured for the proxy; account billing/quota exhausted; prompt triggering content moderation; using unsupported duration/size combos for the model.","solutions":["Read the embedded message: auth errors → fix API key, quota → top up billing, moderation → adjust prompt","Verify the OpenAI API key configured for the ComfyUI proxy endpoint","For parameter errors, check model-specific constraints (size, duration) before the prompt content"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":"import os\nassert os.environ.get(\"OPENAI_API_KEY\"), \"OpenAI API key required for Sora nodes\"","typeGuard":null,"tryCatchPattern":"try:\n    out = await sora_execute(...)\nexcept Exception as e:\n    msg = str(e)\n    if \"api key\" in msg.lower() or \"authentication\" in msg.lower():\n        fix_openai_credentials()\n    elif \"quota\" in msg.lower() or \"billing\" in msg.lower():\n        raise RuntimeError(\"OpenAI quota exhausted\") from e\n    else:\n        raise","preventionTips":["Verify the OpenAI key and billing status before batch video jobs","Errors arrive in a 200 response body — always inspect the error field, not just HTTP status","Classify by message keywords (auth/quota/moderation) to pick the right remedy"],"tags":["sora","openai","api-error","auth","moderation"],"backgroundTag":null,"analyzedSha":"1c6d8d45b3693bfbb32385b410d813a7fd6be216","analyzedAt":"2026-08-14T19:37:18.893Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}