{"record":{"id":"ce673cdd0b6abecc","repo":"ATH-MaaS/Pixelle-Video","slug":"dashscope-generation-failed-e","errorCode":null,"errorMessage":"DashScope generation failed: {e}","messagePattern":"DashScope generation failed: (.+?)","errorType":"exception","errorClass":"RuntimeError","httpStatus":null,"severity":"error","filePath":"pixelle_video/services/api_services/image_client.py","lineNumber":274,"sourceCode":"                        save_dir=save_dir\n                    )\n                else:\n                    # Text to Image\n                    # Assuming default size 1024*1024 or similar\n                    paths = self.dashscope_client.generate_image(\n                        prompt=prompt,\n                        model=model,\n                        size=size,\n                        session_id=session_id,\n                        save_dir=save_dir\n                    )\n                \n                if paths:\n                    generated_local_paths.extend(paths)\n                            \n            except Exception as e:\n                logging.error(f\"DashScope generation failed: {e}\")\n                raise RuntimeError(f\"DashScope generation failed: {e}\") from e\n\n        return generated_local_paths\n","sourceCodeStart":256,"sourceCodeEnd":277,"githubUrl":"https://github.com/ATH-MaaS/Pixelle-Video/blob/848b054e4fae40dabc62ec58e960b573e83793ac/pixelle_video/services/api_services/image_client.py#L256-L277","documentation":"generate_image wraps the DashScope image generation call: any exception from the DashScope SDK is logged and re-raised as RuntimeError('DashScope generation failed: {e}') with the original attached as __cause__.","triggerScenarios":"Any failure inside the DashScope ImageGeneration call: invalid API key, quota exceeded, network timeout, invalid model/size parameters, malformed prompt, or SDK-level errors.","commonSituations":"Expired or wrong DashScope API key; requesting a size unsupported by the model; regional network issues reaching DashScope; model name typo (e.g. wan2.7-image not enabled for the account).","solutions":["Inspect the chained cause (__cause__) for the underlying SDK error","Verify DASHSCOPE_API_KEY validity and account quota","Confirm the model name and size string match DashScope's supported values","Retry with backoff for transient network errors"],"exampleFix":"// before\ntry:\n    paths = gen.generate_image(prompt=p)\nexcept Exception:\n    pass\n// after\ntry:\n    paths = gen.generate_image(prompt=p)\nexcept RuntimeError as e:\n    logging.error(\"cause=%s\", e.__cause__)\n    paths = fallback_provider.generate_image(prompt=p)","handlingStrategy":"try-catch","validationCode":"import os\nassert os.environ.get(\"DASHSCOPE_API_KEY\"), \"DASHSCOPE_API_KEY required\"\nassert model in SUPPORTED_DASHSCOPE_MODELS","typeGuard":null,"tryCatchPattern":"try:\n    paths = gen.generate_image(prompt=p)\nexcept RuntimeError as e:\n    logging.error(\"dashscope failed: %s; cause: %s\", e, e.__cause__)\n    paths = fallback.generate_image(prompt=p)","preventionTips":["Always inspect __cause__ for the root SDK error","Retry with exponential backoff on transient failures","Keep the dashscope SDK updated"],"tags":["network","api-error","image-generation"],"backgroundTag":"upstream-api-failure","analyzedSha":"848b054e4fae40dabc62ec58e960b573e83793ac","analyzedAt":"2026-08-30T03:24:41.468Z","schemaVersion":2},"datasetVersion":"2026-08-30T08:17:16.595Z"}