ATH-MaaS/Pixelle-Video · error · RuntimeError
DashScope generation failed: {e}
Error message
DashScope generation failed: {e} What it means
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__.
Source
Thrown at pixelle_video/services/api_services/image_client.py:274
save_dir=save_dir
)
else:
# Text to Image
# Assuming default size 1024*1024 or similar
paths = self.dashscope_client.generate_image(
prompt=prompt,
model=model,
size=size,
session_id=session_id,
save_dir=save_dir
)
if paths:
generated_local_paths.extend(paths)
except Exception as e:
logging.error(f"DashScope generation failed: {e}")
raise RuntimeError(f"DashScope generation failed: {e}") from e
return generated_local_paths
View on GitHub (pinned to 848b054e4f)
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
Example fix
// before
try:
paths = gen.generate_image(prompt=p)
except Exception:
pass
// after
try:
paths = gen.generate_image(prompt=p)
except RuntimeError as e:
logging.error("cause=%s", e.__cause__)
paths = fallback_provider.generate_image(prompt=p) Defensive patterns
Strategy: try-catch
Validate before calling
import os
assert os.environ.get("DASHSCOPE_API_KEY"), "DASHSCOPE_API_KEY required"
assert model in SUPPORTED_DASHSCOPE_MODELS Try / catch
try:
paths = gen.generate_image(prompt=p)
except RuntimeError as e:
logging.error("dashscope failed: %s; cause: %s", e, e.__cause__)
paths = fallback.generate_image(prompt=p) Prevention
- Always inspect __cause__ for the root SDK error
- Retry with exponential backoff on transient failures
- Keep the dashscope SDK updated
When it happens
Trigger: Any failure inside the DashScope ImageGeneration call: invalid API key, quota exceeded, network timeout, invalid model/size parameters, malformed prompt, or SDK-level errors.
Common situations: 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).
Related errors
- DashScope image generation returned no image URLs. output={g
- Image generation failed: {response.code}, {response.message}
- rsp.code
- str(e)
- API image generation returned no result: provider={provider}
AI-assisted analysis of ATH-MaaS/Pixelle-Video@848b054e4f (2026-08-30).
Data as JSON: /api/errors/ce673cdd0b6abecc.
Report an issue: GitHub.