{"record":{"id":"54c84528930aa685","repo":"ATH-MaaS/Pixelle-Video","slug":"video-file-not-found-video-path","errorCode":null,"errorMessage":"Video file not found: {video_path}","messagePattern":"Video file not found: (.+?)","errorType":"exception","errorClass":"FileNotFoundError","httpStatus":null,"severity":"error","filePath":"pixelle_video/services/api_asset_analysis.py","lineNumber":116,"sourceCode":"        if not image_file.exists():\n            raise FileNotFoundError(f\"Image file not found: {image_path}\")\n\n        return await self._query_vlm(\n            prompt=prompt or self.IMAGE_PROMPT,\n            image_paths=[str(image_file)],\n            model=model,\n        )\n\n    async def analyze_video(\n        self,\n        video_path: str,\n        model: Optional[str] = None,\n        prompt: Optional[str] = None,\n        **_: object,\n    ) -> str:\n        video_file = Path(video_path)\n        if not video_file.exists():\n            raise FileNotFoundError(f\"Video file not found: {video_path}\")\n\n        return await self._query_vlm(\n            prompt=prompt or self.VIDEO_PROMPT,\n            image_paths=[],\n            video_paths=[str(video_file)],\n            model=model,\n        )\n\n    async def __call__(self, asset_path: str, asset_type: Optional[str] = None, **kwargs) -> str:\n        path = Path(asset_path)\n        resolved_type = asset_type or self._get_asset_type(path)\n        if resolved_type == \"image\":\n            return await self.analyze_image(asset_path, **kwargs)\n        if resolved_type == \"video\":\n            return await self.analyze_video(asset_path, **kwargs)\n        raise ValueError(f\"Unsupported asset type for VLM analysis: {asset_path}\")\n\n    async def _query_vlm(","sourceCodeStart":98,"sourceCodeEnd":134,"githubUrl":"https://github.com/ATH-MaaS/Pixelle-Video/blob/848b054e4fae40dabc62ec58e960b573e83793ac/pixelle_video/services/api_asset_analysis.py#L98-L134","documentation":"analyze_video checks Path(video_path).exists() before delegating to _query_vlm and raises FileNotFoundError for missing video files. Same pre-flight pattern as analyze_image but for video assets.","triggerScenarios":"Calling analyze_video with a path that does not exist on disk — deleted/moved temp file, wrong extension, URL passed instead of local path, or relative path broken by CWD change.","commonSituations":"Upload pipeline stores video under a temp dir that was cleaned; assets recorded before upload finished; path truncated or extension stripped by an earlier processing step.","solutions":["Check Path(video_path).exists() before invoking analyze_video","Use absolute resolved paths when storing asset references at upload time","Ensure video upload/encoding completed before the pipeline analyzes the asset","Do not pass URLs — download the media to a local file first"],"exampleFix":"# before\nawait analyzer.analyze_video(video_path=\"https://cdn.example.com/clip.mp4\")\n# after\nlocal = Path(\"/tmp/uploads/clip.mp4\")  # downloaded beforehand\nawait analyzer.analyze_video(video_path=str(local))","handlingStrategy":"validation","validationCode":"from pathlib import Path\nv = Path(video_path)\nif not v.is_file():\n    raise FileNotFoundError(f\"video missing before analysis: {v}\")","typeGuard":"def video_exists(path: str) -> bool:\n    return Path(path).is_file()","tryCatchPattern":"try:\n    desc = await analyzer.analyze_video(video_path)\nexcept FileNotFoundError:\n    desc = await reupload_and_analyze_video(video_path)","preventionTips":["Download remote media to local files before calling the analyzer","Verify upload/encoding completed before enqueueing analysis","Use absolute paths and confirm persistence of temp files for the task duration"],"tags":["file-not-found","filesystem","video"],"backgroundTag":"file-not-found","analyzedSha":"848b054e4fae40dabc62ec58e960b573e83793ac","analyzedAt":"2026-08-30T03:24:41.468Z","schemaVersion":2},"datasetVersion":"2026-08-30T08:17:16.595Z"}