ATH-MaaS/Pixelle-Video · error · FileNotFoundError
参考视频不存在: {ref_video_path}
Error message
参考视频不存在: {ref_video_path} What it means
DashscopeVideoClient.generate_video() validates every reference_video_paths entry with os.path.exists() before calling the DashScope API. If a provided reference video file does not exist on local disk, a FileNotFoundError is raised with the offending path in the message. This is a fail-fast guard so an invalid path never reaches the network call.
Source
Thrown at pixelle_video/services/api_services/video_dashscope.py:192
RuntimeError: API 调用或下载失败
"""
if VideoSynthesis is None:
raise RuntimeError("dashscope package not installed. Run: pip install dashscope")
if image_path and not os.path.exists(image_path):
raise FileNotFoundError(f"输入图片不存在: {image_path}")
if last_image_path and not os.path.exists(last_image_path):
raise FileNotFoundError(f"尾帧图片不存在: {last_image_path}")
if first_clip_path and not os.path.exists(first_clip_path):
raise FileNotFoundError(f"输入视频片段不存在: {first_clip_path}")
if reference_image_path and not os.path.exists(reference_image_path):
raise FileNotFoundError(f"参考图片不存在: {reference_image_path}")
for ref_image_path in reference_image_paths or []:
if ref_image_path and not os.path.exists(ref_image_path):
raise FileNotFoundError(f"参考图片不存在: {ref_image_path}")
for ref_video_path in reference_video_paths or []:
if ref_video_path and not os.path.exists(ref_video_path):
raise FileNotFoundError(f"参考视频不存在: {ref_video_path}")
if reference_audio_path and not os.path.exists(reference_audio_path):
raise FileNotFoundError(f"参考音频不存在: {reference_audio_path}")
if audio_path and not os.path.exists(audio_path):
raise FileNotFoundError(f"驱动音频不存在: {audio_path}")
logger.info(f"DashscopeVideoClient: model={model}, prompt={prompt[:60]}...")
if self._is_text_to_video_model(model):
call_kwargs = {
"api_key": self.api_key,
"model": model,
"prompt": prompt,
"duration": duration,
"watermark": watermark,
}
if negative_prompt:
call_kwargs["negative_prompt"] = negative_prompt
if resolution:View on GitHub (pinned to 848b054e4f)
Solutions
- Print the path and run ls/os.path.exists on it in the same process/CWD that calls generate_video.
- Switch to absolute paths (os.path.abspath) or anchor relative paths to a known base directory.
- Check that the upstream step that generates the reference video actually succeeded and wrote to this path.
- Verify volume mounts when running in Docker (the file may exist on host but not in the container).
- Check filename spelling/case, especially on case-sensitive Linux filesystems.
Example fix
// before
client.generate_video(prompt=p, reference_video_paths=["assets/ref.mp4"])
// after
ref = os.path.abspath("assets/ref.mp4")
if not os.path.exists(ref):
raise FileNotFoundError(f"check path/cwd: {ref}")
client.generate_video(prompt=p, reference_video_paths=[ref]) Defensive patterns
Strategy: validation
Validate before calling
missing = [p for p in (reference_video_paths or []) if p and not os.path.exists(p)]
if missing:
raise FileNotFoundError(f"reference videos missing: {missing}") Type guard
def has_ref_videos(paths: list[str] | None) -> bool:
return all(os.path.isfile(p) for p in (paths or []) if p) Try / catch
try:
client.generate_video(prompt=p, reference_video_paths=refs)
except FileNotFoundError as e:
logger.error("missing reference video: %s", e)
raise Prevention
- Always pass absolute paths built with os.path.abspath.
- Assert file existence right after the upstream step that creates the asset.
- Mount all asset directories in containers and smoke-test paths at startup.
- Normalize path separators across OSes with os.path.normpath.
When it happens
Trigger: generate_video() is called with reference_video_paths containing a non-empty string whose file is missing, deleted, or on a different mount/container than the one the service runs in.
Common situations: Relative paths resolved against a different working directory; files produced by an upstream step that failed silently; Docker volume not mounted; path stored with stale absolute prefix from another machine; typo in filename or extension case mismatch.
Understand the failure class
Background: "File not found" and ENOENT errors: why libraries can't find a file that should exist — this error's family across 50 libraries.
Related errors
- Video file not found: {video_path}
- 参考音频不存在: {reference_audio_path}
- 驱动音频不存在: {audio_path}
- frame_template is required to determine media size
- str(e)
AI-assisted analysis of ATH-MaaS/Pixelle-Video@848b054e4f (2026-08-30).
Data as JSON: /api/errors/77e4d5390a207c4d.
Report an issue: GitHub.