{"record":{"id":"6b56959825eda56a","repo":"ATH-MaaS/Pixelle-Video","slug":"reference-audio-path","errorCode":null,"errorMessage":"参考音频不存在: {reference_audio_path}","messagePattern":"参考音频不存在: (.+?)","errorType":"validation","errorClass":"FileNotFoundError","httpStatus":null,"severity":"error","filePath":"pixelle_video/services/api_services/video_dashscope.py","lineNumber":194,"sourceCode":"        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:\n                call_kwargs[\"resolution\"] = resolution\n            if video_ratio:","sourceCodeStart":176,"sourceCodeEnd":212,"githubUrl":"https://github.com/ATH-MaaS/Pixelle-Video/blob/848b054e4fae40dabc62ec58e960b573e83793ac/pixelle_video/services/api_services/video_dashscope.py#L176-L212","documentation":"generate_video() validates that reference_audio_path exists on disk before submitting the DashScope task. If the file is missing, a FileNotFoundError naming the path is raised. Note the guard is skipped when reference_audio_path is None/empty and for 'happyhorse' models where audio is intentionally dropped.","triggerScenarios":"generate_video() called with a non-None reference_audio_path that does not exist at os.path.exists() time.","commonSituations":"TTS/audio-preparation step failed upstream; audio written to a temp dir that was cleaned; relative path vs different CWD; container missing the mounted audio directory; wrong extension or path separator on Windows.","solutions":["Verify os.path.exists(reference_audio_path) in the same working directory/process before the call.","Make the path absolute or anchor it to the project base directory.","Confirm the audio-generation step succeeded and flushed/closed the file before calling generate_video.","Check Docker/host volume mounts for the audio directory."],"exampleFix":"// before\nclient.generate_video(prompt=p, reference_audio_path=\"out/tts.mp3\")\n// after\naudio = os.path.abspath(\"out/tts.mp3\")\nassert os.path.isfile(audio), f\"missing reference audio: {audio}\"\nclient.generate_video(prompt=p, reference_audio_path=audio)","handlingStrategy":"validation","validationCode":"if reference_audio_path and not os.path.isfile(reference_audio_path):\n    raise FileNotFoundError(f\"reference audio missing: {reference_audio_path}\")","typeGuard":"def has_reference_audio(p: str | None) -> bool:\n    return p is None or os.path.isfile(p)","tryCatchPattern":"try:\n    client.generate_video(prompt=p, reference_audio_path=audio)\nexcept FileNotFoundError as e:\n    logger.error(\"reference audio missing: %s\", e)\n    raise","preventionTips":["Generate the audio and close/flush the file before calling generate_video.","Use absolute paths and a stable asset directory.","In pipelines, fail the upstream step loudly so missing audio never reaches this call.","When running in Docker, verify audio dir mounts at container start."],"tags":["file-not-found","path-validation","audio"],"backgroundTag":"file-not-found","analyzedSha":"848b054e4fae40dabc62ec58e960b573e83793ac","analyzedAt":"2026-08-30T03:24:41.468Z","schemaVersion":2},"datasetVersion":"2026-08-30T08:17:16.595Z"}