ATH-MaaS/Pixelle-Video · error · FileNotFoundError
Image file not found: {image_path}
Error message
Image file not found: {image_path} What it means
analyze_image checks Path(image_path).exists() before sending the file to the VLM API and raises FileNotFoundError when it does not exist on disk. This is a pre-flight check so the API call is not wasted on a missing file.
Source
Thrown at pixelle_video/services/api_asset_analysis.py:99
"provider": provider,
"model": model,
"media_type": "asset_analysis",
"ability_type": "vlm_asset_analysis",
"ability_types": ["vlm_asset_analysis"],
})
return models
async def analyze_image(
self,
image_path: str,
model: Optional[str] = None,
prompt: Optional[str] = None,
**_: object,
) -> str:
image_file = Path(image_path)
if not image_file.exists():
raise FileNotFoundError(f"Image file not found: {image_path}")
return await self._query_vlm(
prompt=prompt or self.IMAGE_PROMPT,
image_paths=[str(image_file)],
model=model,
)
async def analyze_video(
self,
video_path: str,
model: Optional[str] = None,
prompt: Optional[str] = None,
**_: object,
) -> str:
video_file = Path(video_path)
if not video_file.exists():
raise FileNotFoundError(f"Video file not found: {video_path}")
View on GitHub (pinned to 848b054e4f)
Solutions
- Verify the path exists before calling: Path(image_path).exists()
- Pass absolute paths (Path(image_path).resolve()) instead of relative ones
- Re-run the upload step if the temp file was cleaned up; do not pass URLs to a local-file API
- Check the service's working directory if relative paths are involved
Example fix
# before
await analyzer.analyze_image("uploads/cat.jpg") # relative, CWD changed
# after
from pathlib import Path
p = Path("uploads/cat.jpg").resolve()
if not p.exists():
raise FileNotFoundError(p)
await analyzer.analyze_image(str(p)) Defensive patterns
Strategy: validation
Validate before calling
from pathlib import Path
p = Path(image_path)
if not p.is_file():
raise FileNotFoundError(f"image missing before analysis: {p}") Type guard
def image_exists(path: str) -> bool:
return Path(path).is_file() Try / catch
try:
desc = await analyzer.analyze_image(image_path)
except FileNotFoundError:
desc = await reupload_and_analyze(image_path) Prevention
- Store absolute resolved paths at upload time and pass those through the pipeline
- Check file existence before each stage that consumes an asset
- Don't clean temp upload directories while a task is still running
When it happens
Trigger: Calling analyze_image (directly or through the asset-analysis __call__ from setup_environment) with a path that doesn't exist: deleted temp files, relative paths resolved from the wrong working directory, or stale asset entries.
Common situations: Temporary upload directories cleaned before analysis; using a URL instead of a local file path; running the service from a different CWD so relative paths break; files moved between upload and pipeline execution.
Understand the failure class
Background: "File not found" and ENOENT errors: why libraries can't find a file that should exist — this error's family across 50 libraries.
Related errors
- Video file not found: {video_path}
- 文件不存在: {file_path}
- Template not found: {template_path}
- Generated media file not found: {local_path}
- The workflow file does not exist: {workflow_path}
AI-assisted analysis of ATH-MaaS/Pixelle-Video@848b054e4f (2026-08-30).
Data as JSON: /api/errors/647ba70ad9e5e326.
Report an issue: GitHub.