{"record":{"id":"a129e6bd250df5f4","repo":"ATH-MaaS/Pixelle-Video","slug":"ref-image-path","errorCode":null,"errorMessage":"参考图片不存在: {ref_image_path}","messagePattern":"参考图片不存在: (.+?)","errorType":"validation","errorClass":"FileNotFoundError","httpStatus":null,"severity":"error","filePath":"pixelle_video/services/api_services/video_dashscope.py","lineNumber":189,"sourceCode":"\n        Raises:\n            FileNotFoundError: 输入图片不存在\n            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            }","sourceCodeStart":171,"sourceCodeEnd":207,"githubUrl":"https://github.com/ATH-MaaS/Pixelle-Video/blob/848b054e4fae40dabc62ec58e960b573e83793ac/pixelle_video/services/api_services/video_dashscope.py#L171-L207","documentation":"generate_video iterates the reference_image_paths list and raises FileNotFoundError for the first entry that does not exist on disk. Same fail-fast validation, applied per-element of the multi-reference list.","triggerScenarios":"generate_video(..., reference_image_paths=['a.jpg','b.jpg','c.jpg'], ...) where any listed file is missing — the error message names the offending ref_image_path.","commonSituations":"Batch paths built from a config/database where some files were purged; one item in the list has a typo; moved directory after the list was built; partial upload of a reference set.","solutions":["Loop over reference_image_paths with os.path.exists and filter/fix missing entries before calling","Re-upload the missing reference images and rebuild the list","Log all resolved paths to find which entry is stale","Make list construction defensive (only include files that exist) if missing refs are acceptable"],"exampleFix":"// before\npaths = ['refs/a.jpg', 'refs/b.jpg', 'refs/gone.jpg']\nclient.generate_video(prompt, reference_image_paths=paths)  # FileNotFoundError: refs/gone.jpg\n// after\npaths = [p for p in paths if os.path.exists(p)]\nif paths:\n    client.generate_video(prompt, reference_image_paths=paths)","handlingStrategy":"validation","validationCode":"import os\nmissing = [p for p in (reference_image_paths or []) if p and not os.path.isfile(p)]\nif missing:\n    raise FileNotFoundError(f'参考图片不存在: {missing}')","typeGuard":"def all_files_exist(paths) -> bool:\n    return all(isinstance(p, str) and os.path.isfile(p) for p in (paths or []))","tryCatchPattern":"try:\n    video = client.generate_video(prompt, reference_image_paths=refs)\nexcept FileNotFoundError as e:\n    logging.error(f'Reference image missing: {e}')\n    refs = [p for p in refs if os.path.isfile(p)]  # drop stale entries and retry\n    video = client.generate_video(prompt, reference_image_paths=refs) if refs else None","preventionTips":["Filter reference lists for existing files before submitting","Persist reference sets with absolute, stable paths","Log every path in the list when debugging batch failures","Validate list contents right after building them from config/DB"],"tags":["file-not-found","input-validation","path"],"backgroundTag":"file-not-found","analyzedSha":"848b054e4fae40dabc62ec58e960b573e83793ac","analyzedAt":"2026-08-30T03:24:41.468Z","schemaVersion":2},"datasetVersion":"2026-08-30T08:17:16.595Z"}