{"record":{"id":"463607c7f97269c4","repo":"ATH-MaaS/Pixelle-Video","slug":"reference-image-path","errorCode":null,"errorMessage":"参考图片不存在: {reference_image_path}","messagePattern":"参考图片不存在: (.+?)","errorType":"validation","errorClass":"FileNotFoundError","httpStatus":null,"severity":"error","filePath":"pixelle_video/services/api_services/video_dashscope.py","lineNumber":186,"sourceCode":"\n        Returns:\n            video_url: 远端视频 URL\n\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,","sourceCodeStart":168,"sourceCodeEnd":204,"githubUrl":"https://github.com/ATH-MaaS/Pixelle-Video/blob/848b054e4fae40dabc62ec58e960b573e83793ac/pixelle_video/services/api_services/video_dashscope.py#L168-L204","documentation":"generate_video validates the optional reference_image_path (a single reference image guiding content/subject) and raises FileNotFoundError when the file is absent. Fail-fast before the API call.","triggerScenarios":"generate_video(..., reference_image_path='ref.jpg', ...) where ref.jpg does not exist on disk.","commonSituations":"Reference image uploaded by a user but stored under a different name; object-storage downloaded copy deleted; case-sensitive filesystem mismatch (Ref.JPG vs ref.jpg on Linux); incorrect mount path.","solutions":["os.path.exists(reference_image_path) pre-check and fix the path or re-provide the image","Re-upload / re-download the reference image if it was lost","Compare exact filename casing on the filesystem (Linux is case-sensitive)","Log the resolved absolute path being passed to spot config errors"],"exampleFix":"// before\nclient.generate_video(prompt, reference_image_path='refs/subject.jpg')  # FileNotFoundError\n// after\nref = 'refs/subject.jpg'\nif not os.path.exists(ref):\n    raise ValueError(f\"Provide a valid reference image, got missing: {ref}\")\nclient.generate_video(prompt, reference_image_path=ref)","handlingStrategy":"validation","validationCode":"import os\nif reference_image_path and not os.path.isfile(reference_image_path):\n    raise FileNotFoundError(f'参考图片不存在: {reference_image_path}')","typeGuard":"def is_existing_file(path) -> bool:\n    return isinstance(path, str) and os.path.isfile(path)","tryCatchPattern":"try:\n    video = client.generate_video(prompt, reference_image_path=ref)\nexcept FileNotFoundError as e:\n    logging.error(f'Reference image missing: {e}')\n    video = None  # or retry without the reference","preventionTips":["Re-download/re-upload reference assets if stored externally","Watch for case-sensitive filename mismatches on Linux","Store references in a stable directory and record absolute paths","Validate user-uploaded references immediately at upload time"],"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"}