{"record":{"id":"4082c50af5a9ff92","repo":"ATH-MaaS/Pixelle-Video","slug":"seedance-status-error-msg","errorCode":null,"errorMessage":"Seedance 视频生成{status}: {error_msg}","messagePattern":"Seedance 视频生成(.+?): (.+?)","errorType":"exception","errorClass":"RuntimeError","httpStatus":null,"severity":"error","filePath":"pixelle_video/services/api_services/video_seedance.py","lineNumber":162,"sourceCode":"    def _poll_until_done(self, task_id: str, max_polls: int = 120, interval: int = 5) -> str:\n        # 同步更新查询接口路径\n        url = f\"{self.base_url}/contents/generations/tasks/{task_id}\"\n        \n        for i in range(max_polls):\n            resp = requests.get(url, headers=self._headers(), timeout=30, proxies=self._proxies())\n            resp.raise_for_status()\n            data = resp.json()\n            \n            status = data.get(\"status\")\n            if status == \"succeeded\":\n                # 根据实际返回体，URL 位于 content.video_url 或 video_url\n                video_url = data.get(\"content\", {}).get(\"video_url\") or data.get(\"video_url\")\n                if not video_url:\n                    raise RuntimeError(f\"Seedance 任务成功但未返回视频 URL: {data}\")\n                return video_url\n            elif status in (\"failed\", \"expired\"):\n                error_msg = data.get(\"error\", {}).get(\"message\") or data.get(\"status_msg\") or \"未知错误\"\n                raise RuntimeError(f\"Seedance 视频生成{status}: {error_msg}\")\n            \n            logger.debug(f\"SeedanceVideoClient: 任务进行中 {task_id}, status={status}, poll={i+1}\")\n            time.sleep(interval)\n            \n        raise TimeoutError(f\"Seedance 视频生成超时 (task_id={task_id})\")\n\n    def _download_video(self, url: str, save_path: str):\n        os.makedirs(os.path.dirname(save_path), exist_ok=True)\n        resp = requests.get(url, stream=True, timeout=120, proxies=self._proxies())\n        resp.raise_for_status()\n        with open(save_path, \"wb\") as f:\n            for chunk in resp.iter_content(chunk_size=8192):\n                if chunk:\n                    f.write(chunk)\n        logger.info(f\"SeedanceVideoClient: 视频已保存: {save_path}\")\n\nif __name__ == \"__main__\":\n    import sys","sourceCodeStart":144,"sourceCodeEnd":180,"githubUrl":"https://github.com/ATH-MaaS/Pixelle-Video/blob/848b054e4fae40dabc62ec58e960b573e83793ac/pixelle_video/services/api_services/video_seedance.py#L144-L180","documentation":"_poll_until_done raises RuntimeError when the task status becomes 'failed' or 'expired', including the API-provided error message (error.message, status_msg, or '未知错误'). This is the remote generation failing server-side, not a client bug.","triggerScenarios":"Poll response has status=='failed' or 'expired' — e.g. content-policy rejection of prompt/image, unsupported image format, model capacity errors, or task TTL exceeded before completion.","commonSituations":"Prompt violates content moderation; input image too large/wrong mime; model overloaded and task expired (120 polls × 5s = 10 min cap may be exceeded server-side); insufficient account quota for the chosen model/duration.","solutions":["Read the embedded error_msg from the exception to identify the server-side cause","If 'expired', retry generation — long queues can outlive the task TTL; consider increasing max_polls/interval","If content-policy failure, revise the prompt or replace the input image","Check quota/billing and model availability in the Volcano Engine console"],"exampleFix":null,"handlingStrategy":"retry","validationCode":null,"typeGuard":null,"tryCatchPattern":"import time\nfor attempt in range(3):\n    try:\n        video = client.generate_video(prompt=p, image_path=img, save_path=out)\n        break\n    except RuntimeError as e:\n        if \"生成failed\" in str(e) or \"生成expired\" in str(e):\n            logging.warning(f\"Seedance task failed/expired (attempt {attempt+1}): {e}\")\n            time.sleep(30)\n        else:\n            raise","preventionTips":["Retry transient failures (expired) with backoff; surface permanent failures (content policy) to the user","Validate prompt/image against content policy before submission","Check quota and model availability for repeated capacity failures"],"tags":["seedance","remote-error","video-generation","content-policy"],"backgroundTag":"remote-job-failed","analyzedSha":"848b054e4fae40dabc62ec58e960b573e83793ac","analyzedAt":"2026-08-30T03:24:41.468Z","schemaVersion":2},"datasetVersion":"2026-08-30T08:17:16.595Z"}