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

  1. Verify the path exists before calling: Path(image_path).exists()
  2. Pass absolute paths (Path(image_path).resolve()) instead of relative ones
  3. Re-run the upload step if the temp file was cleaned up; do not pass URLs to a local-file API
  4. 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

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


AI-assisted analysis of ATH-MaaS/Pixelle-Video@848b054e4f (2026-08-30). Data as JSON: /api/errors/647ba70ad9e5e326. Report an issue: GitHub.