ATH-MaaS/Pixelle-Video · error · RuntimeError
API video generation did not create file: {save_path}
Error message
API video generation did not create file: {save_path} What it means
After the provider call (including a content-inspection retry with a neutralized prompt), _generate_video checks that the expected output file exists at save_path. If the provider reported success (or the failure path swallowed the error) but no file was written to disk, this RuntimeError is raised.
Source
Thrown at pixelle_video/services/api_media.py:578
save_path=save_path,
model=model,
duration=safe_duration,
video_ratio=ratio,
**video_options,
)
break
except Exception as exc:
if attempt >= max_safety_retries or not self._is_content_inspection_error(exc):
raise
logger.warning(
"API video generation failed content inspection; "
f"neutralizing prompt and retrying once. provider={provider}, model={model}, error={exc}"
)
prompt_to_use = await self._neutralize_video_prompt(prompt_to_use)
if not os.path.exists(save_path):
raise RuntimeError(f"API video generation did not create file: {save_path}")
return MediaResult(media_type="video", url=save_path, duration=safe_duration)
def _is_content_inspection_error(self, exc: Exception) -> bool:
"""Return True when a provider rejects input because of content inspection."""
message = str(exc).lower()
return any(
marker in message
for marker in (
"datainspectionfailed",
"inappropriate content",
"green net check failed",
"content inspection",
"safety inspection",
"risk control",
)
)
View on GitHub (pinned to 848b054e4f)
Solutions
- Check save_path directory exists and is writable (os.makedirs, permissions)
- Log the provider response to confirm a video URL/result was actually returned
- Retry the generation; if content inspection is the cause, rephrase the prompt
- Verify provider SDK version still writes the file in the expected location
Example fix
// before
result = await gen(prompt=p, output_path=None)
// after
os.makedirs("outputs/videos", exist_ok=True)
result = await gen(prompt=p, output_path="outputs/videos/clip.mp4") Defensive patterns
Strategy: try-catch
Validate before calling
save_path = output_path or default_path
os.makedirs(os.path.dirname(save_path), exist_ok=True)
if not os.access(os.path.dirname(save_path), os.W_OK):
raise PermissionError(f"cannot write to {save_path}") Try / catch
try:
result = await gen(prompt=p)
except RuntimeError as e:
if "did not create file" in str(e):
logging.error("video missing at %s; provider response logged", e)
result = await retry_gen(prompt=p) Prevention
- Pre-create and permission-check the output directory
- Always pass an explicit output_path
- Log the raw provider response for post-mortem
When it happens
Trigger: Provider returns 200/no exception but fails to persist the video; the download/save step silently skips writing; save_path points to an unwritable or wrong directory; async task completed with no usable output.
Common situations: Disk full or permissions issue in save_dir; provider API change where the result URL is empty; network drop during final download; content-policy rejection that does not surface as an exception.
Related errors
- Image file not found: {image_path}
- Video file not found: {video_path}
- API video models require image_path, first_clip_path, or ref
- first_clip_path is only supported for DashScope wan2.7 model
- 文件不存在: {file_path}
AI-assisted analysis of ATH-MaaS/Pixelle-Video@848b054e4f (2026-08-30).
Data as JSON: /api/errors/992ad376ed7d35ad.
Report an issue: GitHub.