{"record":{"id":"678c0c1e57c6fe25","repo":"ATH-MaaS/Pixelle-Video","slug":"rsp-code","errorCode":"rsp.code","errorMessage":"万象视频 API 错误: status={rsp.status_code}, code={rsp.code}, message={rsp.message}","messagePattern":"万象视频 API 错误: status=(.+?), code=(.+?), message=(.+?)","errorType":"exception","errorClass":"RuntimeError","httpStatus":null,"severity":"error","filePath":"pixelle_video/services/api_services/video_dashscope.py","lineNumber":359,"sourceCode":"                call_kwargs[\"negative_prompt\"] = negative_prompt\n            if resolution:\n                call_kwargs[\"resolution\"] = resolution\n            if video_ratio:\n                call_kwargs[\"ratio\"] = video_ratio\n            if prompt_extend is not None:\n                call_kwargs[\"prompt_extend\"] = prompt_extend\n            if watermark is not None:\n                call_kwargs[\"watermark\"] = watermark\n            if seed is not None:\n                call_kwargs[\"seed\"] = seed\n\n            rsp = self._with_network_retry(\n                \"submit task\",\n                lambda: VideoSynthesis.call(**call_kwargs),\n            )\n\n        if rsp.status_code != HTTPStatus.OK:\n            raise RuntimeError(\n                f\"万象视频 API 错误: status={rsp.status_code}, \"\n                f\"code={rsp.code}, message={rsp.message}\"\n            )\n\n        video_url = self._extract_video_url(rsp)\n        if not video_url:\n            task_id = self._extract_task_id(rsp)\n            task_status = self._extract_task_status(rsp)\n            if not task_id:\n                raise RuntimeError(\n                    \"万象视频 API 未返回 video_url 或 task_id，无法查询结果: \"\n                    f\"status={rsp.status_code}, code={rsp.code}, message={rsp.message}, \"\n                    f\"task_status={task_status}\"\n                )\n\n            logger.info(f\"DashscopeVideoClient: 任务已提交 task_id={task_id}, status={task_status}; 等待生成完成...\")\n            rsp = self._with_network_retry(\n                f\"wait task {task_id}\",","sourceCodeStart":341,"sourceCodeEnd":377,"githubUrl":"https://github.com/ATH-MaaS/Pixelle-Video/blob/848b054e4fae40dabc62ec58e960b573e83793ac/pixelle_video/services/api_services/video_dashscope.py#L341-L377","documentation":"After VideoSynthesis.call() returns, the client checks rsp.status_code == HTTPStatus.OK. Any non-OK status is converted into a RuntimeError carrying the HTTP status, the DashScope business error code, and the API message. This surfaces server-side rejections (auth, quota, invalid params, content moderation) from the 万象视频/DashScope API.","triggerScenarios":"DashScope responds non-200 to the submit call: invalid/expired API key, insufficient quota or billing, disallowed content flagged by moderation, malformed parameters (bad media URL, unsupported model/params), or service-side rejection.","commonSituations":"DASHSCOPE_API_KEY revoked or from wrong workspace; model name deprecated or region-restricted; media URLs unreachable by DashScope (private URLs without public access); free-tier quota exhausted; prompt triggering content filter.","solutions":["Read rsp.message/rsp.code in the exception text — it names the concrete API rejection reason.","Verify DASHSCOPE_API_KEY validity, workspace, and billing/quota status in the DashScope console.","Ensure media URLs are publicly reachable (or use base64/uploaded URLs) — DashScope must download them.","Retry only if the message indicates transient throttling/service error; fix params otherwise.","Confirm the model name is still supported in your region/SDK version."],"exampleFix":"// before\nvideo = client.generate_video(model=model, prompt=p, image_path=img)  # surfaces RuntimeError\n// after\ntry:\n    video = client.generate_video(model=model, prompt=p, image_path=img)\nexcept RuntimeError as e:\n    logger.error(\"dashscope submit failed: %s\", e)  # inspect code/message\n    raise","handlingStrategy":"try-catch","validationCode":"if not os.environ.get(\"DASHSCOPE_API_KEY\"):\n    raise ValueError(\"DASHSCOPE_API_KEY not set\")\n# ensure referenced media URLs are publicly reachable\nfor url in media_urls:\n    if url.startswith(\"http\") and not is_publicly_fetchable(url):\n        raise ValueError(f\"media URL not reachable by dashscope: {url}\")","typeGuard":"def submit_rsp_ok(rsp) -> bool:\n    return getattr(rsp, \"status_code\", None) == 200","tryCatchPattern":"try:\n    video = client.generate_video(...)\nexcept RuntimeError as e:\n    # message contains status/code/message from dashscope\n    if \"Throttling\" in str(e) or \"429\" in str(e):\n        time.sleep(backoff); retry()\n    else:\n        logger.error(\"dashscope rejected submit: %s\", e)\n        raise","preventionTips":["Validate DASHSCOPE_API_KEY and quota before long batch runs.","Host media on publicly reachable URLs (or pre-upload via DashScope).","Screen prompts/inputs against content-moderation policies.","Check model availability/deprecation for your region and SDK version."],"tags":["dashscope","api-error","http-status","network"],"backgroundTag":"api-error-response","analyzedSha":"848b054e4fae40dabc62ec58e960b573e83793ac","analyzedAt":"2026-08-30T03:24:41.468Z","schemaVersion":2},"datasetVersion":"2026-08-30T08:17:16.595Z"}