{"record":{"id":"20c22ac86ba0a429","repo":"ATH-MaaS/Pixelle-Video","slug":"first-clip-path","errorCode":null,"errorMessage":"输入视频片段不存在: {first_clip_path}","messagePattern":"输入视频片段不存在: (.+?)","errorType":"validation","errorClass":"FileNotFoundError","httpStatus":null,"severity":"error","filePath":"pixelle_video/services/api_services/video_dashscope.py","lineNumber":184,"sourceCode":"            reference_audio_path: 可选参考音频/音色路径（r2v）\n            audio_path: 可选驱动音频本地路径（wan2.7）\n\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,","sourceCodeStart":166,"sourceCodeEnd":202,"githubUrl":"https://github.com/ATH-MaaS/Pixelle-Video/blob/848b054e4fae40dabc62ec58e960b573e83793ac/pixelle_video/services/api_services/video_dashscope.py#L166-L202","documentation":"generate_video raises FileNotFoundError when first_clip_path (the input video segment for video-to-video continuation) points to a non-existent file. Fail-fast validation before any API request.","triggerScenarios":"generate_video(..., first_clip_path='clip.mp4', ...) where the clip file is missing — e.g. the video was generated in a previous run into another directory, or the extension/name differs.","commonSituations":"Pipeline where the clip comes from a prior generation step that output to a different save_path; file overwritten/removed by cleanup jobs; wrong cwd for relative paths; not copying the clip into the container.","solutions":["Check os.path.exists(first_clip_path) before calling and correct the path","Ensure the previous step that produced the clip wrote to the expected save_path","Use absolute paths in pipeline configuration","In Docker/K8s, mount the directory holding the clip"],"exampleFix":"// before\nclient.generate_video(prompt, first_clip_path='tmp/clip.mp4')  # FileNotFoundError\n// after\nclip = os.path.abspath('tmp/clip.mp4')\nassert os.path.exists(clip), f\"clip missing: {clip}\"\nclient.generate_video(prompt, first_clip_path=clip)","handlingStrategy":"validation","validationCode":"import os\nif first_clip_path and not os.path.isfile(first_clip_path):\n    raise FileNotFoundError(f'输入视频片段不存在: {first_clip_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, first_clip_path=clip)\nexcept FileNotFoundError as e:\n    logging.error(f'Input clip missing: {e}')\n    video = None  # regenerate or locate the clip first","preventionTips":["Confirm the prior step's save_path matches the path you pass","Use absolute paths for inter-step file handoff","Don't clean temp directories mid-pipeline; clean at job end","In containers, mount clip directories read-write for upstream, read for downstream"],"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"}