{"record":{"id":"53d7256eaa606faf","repo":"sgl-project/sglang","slug":"video-generation-failed-error-msg","errorCode":null,"errorMessage":"Video generation failed: {error_msg}","messagePattern":"Video generation failed: (.+?)","errorType":"error_code","errorClass":"RuntimeError","httpStatus":null,"severity":"error","filePath":"python/sglang/multimodal_gen/apps/ComfyUI_SGLDiffusion/core/server_api.py","lineNumber":335,"sourceCode":"                        headers=self.headers,\n                        timeout=30,\n                    )\n                    status_response.raise_for_status()\n                    status = status_response.json()\n\n                    # Reset error counter on successful request\n                    consecutive_errors = 0\n\n                    if status.get(\"status\") == \"completed\":\n                        return status\n                    elif status.get(\"status\") == \"failed\":\n                        error = status.get(\"error\", {})\n                        error_msg = (\n                            error.get(\"message\", \"Unknown error\")\n                            if error\n                            else \"Unknown error\"\n                        )\n                        raise RuntimeError(f\"Video generation failed: {error_msg}\")\n                except requests.exceptions.ConnectionError as e:\n                    # Connection errors - likely server is down\n                    consecutive_errors += 1\n                    if consecutive_errors >= max_consecutive_errors:\n                        raise RuntimeError(\n                            f\"Lost connection to server after {consecutive_errors} consecutive errors. \"\n                            f\"Server may be unavailable: {str(e)}\"\n                        )\n                except requests.exceptions.RequestException as e:\n                    # Other network errors - continue polling but track errors\n                    consecutive_errors += 1\n                    if consecutive_errors >= max_consecutive_errors:\n                        raise RuntimeError(\n                            f\"Network error after {consecutive_errors} consecutive failures: {str(e)}\"\n                        )\n\n                time.sleep(poll_interval)\n","sourceCodeStart":317,"sourceCodeEnd":353,"githubUrl":"https://github.com/sgl-project/sglang/blob/0132848349585cfe6aae51c4941cbae872505f8a/python/sglang/multimodal_gen/apps/ComfyUI_SGLDiffusion/core/server_api.py#L317-L353","documentation":"RuntimeError raised inside generate_video's polling loop when the job status endpoint reports a terminal error: the status payload contains an 'error' object whose message is propagated. It means the server accepted the job but generation itself failed server-side.","triggerScenarios":"The polled job status returns status=error with an error object — e.g. OOM on the GPU, invalid size/fps/seconds parameters, unsupported video model, or a corrupted input frame image.","commonSituations":"Requesting resolutions the video model can't handle; VRAM exhaustion with other jobs running; passing reference images in a format the server rejects.","solutions":["Read the embedded error_msg — it comes from the server and names the real cause.","Fix the reported cause: lower resolution/seconds, free GPU memory, or correct input images.","Check the SGLang Diffusion server logs for the corresponding stack trace.","Retry with simpler parameters to confirm the pipeline works."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":"# validate video params against model limits before submit\nassert width % 16 == 0 and height % 16 == 0, 'dimensions must be multiples of 16'","typeGuard":null,"tryCatchPattern":"try:\n    job = api.generate_video(prompt=p)\nexcept RuntimeError as e:\n    # embedded error_msg names the server-side cause; fix params accordingly\n    handle_generation_error(str(e))","preventionTips":["Keep resolution/seconds within the model's documented envelope.","Free GPU memory before long video jobs.","Surface server error_msg to users instead of swallowing it."],"tags":["video-generation","server-side-failure","polling","sgldiffusion"],"backgroundTag":"async-job-failed","analyzedSha":"0132848349585cfe6aae51c4941cbae872505f8a","analyzedAt":"2026-08-28T05:10:05.995Z","schemaVersion":2},"datasetVersion":"2026-08-28T06:17:29.519Z"}