{"record":{"id":"589bdde7d0ba1532","repo":"calesthio/OpenMontage","slug":"seedream-task-status-error-msg","errorCode":null,"errorMessage":"Seedream task {status}: {error_msg}","messagePattern":"Seedream task (.+?): (.+?)","errorType":"exception","errorClass":"RuntimeError","httpStatus":null,"severity":"error","filePath":"tools/graphics/seedream_image.py","lineNumber":216,"sourceCode":"                f\"https://queue.fal.run/bytedance/seedream/requests/\"\n                f\"{request_id}/status\"\n            )\n            elapsed = 0.0\n            while elapsed < 300:\n                status_resp = requests.get(\n                    status_url,\n                    headers=headers,\n                    timeout=30,\n                )\n                status_resp.raise_for_status()\n                status_data = status_resp.json()\n                status = status_data.get(\"status\")\n\n                if status == \"COMPLETED\":\n                    break\n                elif status in (\"FAILED\", \"CANCELLED\"):\n                    error_msg = status_data.get(\"error\", \"Unknown error\")\n                    raise RuntimeError(f\"Seedream task {status}: {error_msg}\")\n\n                time.sleep(10)\n                elapsed += 10\n\n            if elapsed >= 300:\n                raise RuntimeError(\n                    f\"Seedream task timed out after {300}s\"\n                )\n\n            result_resp = requests.get(\n                f\"https://queue.fal.run/bytedance/seedream/requests/\"\n                f\"{request_id}\",\n                headers=headers,\n                timeout=30,\n            )\n            result_resp.raise_for_status()\n            result_data = result_resp.json()\n","sourceCodeStart":198,"sourceCodeEnd":234,"githubUrl":"https://github.com/calesthio/OpenMontage/blob/95e1c3d0ab93482159818560f6a8c8e866b9139f/tools/graphics/seedream_image.py#L198-L234","documentation":"Raised when the polled Seedream queue task reports status 'FAILED' or 'CANCELLED'. The message embeds the status and the API-supplied 'error' field (defaulting to 'Unknown error' when absent). This is the server-side generation actually failing — moderation rejection, invalid parameters, or upstream model error.","triggerScenarios":"Prompt or reference image tripped content moderation; image reference URL unreachable by the backend; internal Seedream model error during render; task manually cancelled in the fal dashboard.","commonSituations":" borderline NSFW or celebrity-likeness prompts; expired/signed reference URLs passed after their TTL; occasional upstream capacity errors that look like permanent failures.","solutions":["Read the embedded error message — moderation vs internal error have different fixes","For moderation: soften or rephrase the prompt, or swap the reference image","For transient upstream errors: retry the same inputs once or twice","For 'CANCELLED': check whether another process/dashboard cancelled the request"],"exampleFix":null,"handlingStrategy":"retry","validationCode":"null","typeGuard":null,"tryCatchPattern":"try:\n    paths = seedream_run(inputs)\nexcept RuntimeError as e:\n    msg = str(e)\n    if \"FAILED\" in msg or \"CANCELLED\" in msg:\n        if \"moderation\" in msg.lower():\n            inputs = soften_prompt(inputs)  # rephrase and resubmit\n        else:\n            retry_with_backoff(seedream_run, inputs, attempts=2)  # transient upstream\n    else:\n        raise","preventionTips":["Read the embedded error field before deciding retry vs rephrase","Keep prompts clear of moderation-sensitive terms for bulk jobs","Treat repeated identical FAILED errors as permanent; don't loop"],"tags":["seedream","fal","generation-failure","moderation","retryable"],"backgroundTag":null,"analyzedSha":"95e1c3d0ab93482159818560f6a8c8e866b9139f","analyzedAt":"2026-08-15T06:31:20.014Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}