{"record":{"id":"77e4d5390a207c4d","repo":"ATH-MaaS/Pixelle-Video","slug":"ref-video-path","errorCode":null,"errorMessage":"参考视频不存在: {ref_video_path}","messagePattern":"参考视频不存在: (.+?)","errorType":"validation","errorClass":"FileNotFoundError","httpStatus":null,"severity":"error","filePath":"pixelle_video/services/api_services/video_dashscope.py","lineNumber":192,"sourceCode":"            RuntimeError: API 调用或下载失败\n        \"\"\"\n        if VideoSynthesis is None:\n            raise RuntimeError(\"dashscope package not installed. Run: pip install dashscope\")\n\n        if image_path and not os.path.exists(image_path):\n            raise FileNotFoundError(f\"输入图片不存在: {image_path}\")\n        if last_image_path and not os.path.exists(last_image_path):\n            raise FileNotFoundError(f\"尾帧图片不存在: {last_image_path}\")\n        if first_clip_path and not os.path.exists(first_clip_path):\n            raise FileNotFoundError(f\"输入视频片段不存在: {first_clip_path}\")\n        if reference_image_path and not os.path.exists(reference_image_path):\n            raise FileNotFoundError(f\"参考图片不存在: {reference_image_path}\")\n        for ref_image_path in reference_image_paths or []:\n            if ref_image_path and not os.path.exists(ref_image_path):\n                raise FileNotFoundError(f\"参考图片不存在: {ref_image_path}\")\n        for ref_video_path in reference_video_paths or []:\n            if ref_video_path and not os.path.exists(ref_video_path):\n                raise FileNotFoundError(f\"参考视频不存在: {ref_video_path}\")\n        if reference_audio_path and not os.path.exists(reference_audio_path):\n            raise FileNotFoundError(f\"参考音频不存在: {reference_audio_path}\")\n        if audio_path and not os.path.exists(audio_path):\n            raise FileNotFoundError(f\"驱动音频不存在: {audio_path}\")\n\n        logger.info(f\"DashscopeVideoClient: model={model}, prompt={prompt[:60]}...\")\n\n        if self._is_text_to_video_model(model):\n            call_kwargs = {\n                \"api_key\": self.api_key,\n                \"model\": model,\n                \"prompt\": prompt,\n                \"duration\": duration,\n                \"watermark\": watermark,\n            }\n            if negative_prompt:\n                call_kwargs[\"negative_prompt\"] = negative_prompt\n            if resolution:","sourceCodeStart":174,"sourceCodeEnd":210,"githubUrl":"https://github.com/ATH-MaaS/Pixelle-Video/blob/848b054e4fae40dabc62ec58e960b573e83793ac/pixelle_video/services/api_services/video_dashscope.py#L174-L210","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","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."],"exampleFix":"// before\nclient.generate_video(prompt=p, reference_video_paths=[\"assets/ref.mp4\"])\n// after\nref = os.path.abspath(\"assets/ref.mp4\")\nif not os.path.exists(ref):\n    raise FileNotFoundError(f\"check path/cwd: {ref}\")\nclient.generate_video(prompt=p, reference_video_paths=[ref])","handlingStrategy":"validation","validationCode":"missing = [p for p in (reference_video_paths or []) if p and not os.path.exists(p)]\nif missing:\n    raise FileNotFoundError(f\"reference videos missing: {missing}\")","typeGuard":"def has_ref_videos(paths: list[str] | None) -> bool:\n    return all(os.path.isfile(p) for p in (paths or []) if p)","tryCatchPattern":"try:\n    client.generate_video(prompt=p, reference_video_paths=refs)\nexcept FileNotFoundError as e:\n    logger.error(\"missing reference video: %s\", e)\n    raise","preventionTips":["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."],"tags":["file-not-found","path-validation","video"],"backgroundTag":"file-not-found","analyzedSha":"848b054e4fae40dabc62ec58e960b573e83793ac","analyzedAt":"2026-08-30T03:24:41.468Z","schemaVersion":2},"datasetVersion":"2026-08-30T08:17:16.595Z"}