invoke-ai/InvokeAI · info · HTTPException

Video thumbnail not found

Error message

Video thumbnail not found

What it means

Raised by get_video_thumbnail as HTTP 404 when videos.get_path(video_name, thumbnail=True) throws — i.e. no thumbnail path could be resolved for the video. Typically the video record doesn't exist, or a first-frame thumbnail was never generated for it. The handler catches Exception broadly, so service errors also surface as this 404.

Source

Thrown at invokeai/app/api/routers/videos.py:704

@videos_router.get(
    "/i/{video_name}/thumbnail",
    operation_id="get_video_thumbnail",
    response_class=Response,
    responses={
        200: {"description": "Return the video thumbnail", "content": {"image/webp": {}}},
        404: {"description": "Video not found"},
    },
)
def get_video_thumbnail(
    current_user: CurrentMediaUserOrDefault,
    video_name: str = PathParam(description="The name of thumbnail file to get"),
) -> Response:
    """Returns the first-frame WebP thumbnail of an authorized video."""
    _assert_video_read_access(video_name, current_user)
    try:
        path = ApiDependencies.invoker.services.videos.get_path(video_name, thumbnail=True)
    except Exception:
        raise HTTPException(status_code=404)
    try:
        with open(path, "rb") as thumbnail_file:
            thumbnail = thumbnail_file.read()
    except OSError:
        raise HTTPException(status_code=404)

    return Response(
        thumbnail,
        media_type="image/webp",
        headers={"Cache-Control": _get_video_cache_control()},
    )


@videos_router.get("/i/{video_name}/urls", operation_id="get_video_urls", response_model=VideoUrlsDTO)
def get_video_urls(
    current_user: CurrentUserOrDefault,
    video_name: str = PathParam(description="The name of the video whose URL to get"),
) -> VideoUrlsDTO:

View on GitHub (pinned to 0b6a024f2f)

Solutions

  1. Fall back to a placeholder image in the UI when the thumbnail 404s instead of retrying.
  2. Verify the video exists via the DTO endpoint; if it does but the thumbnail 404s, the thumbnail is missing — regenerate or accept fallback.
  3. Check server logs for the underlying path-resolution exception.
  4. Ensure the thumbnails directory exists and is writable on the server.

Example fix

// before
img.src = `/api/v1/videos/i/${name}/thumbnail`; // broken image icon on 404
// after
img.onerror = () => { img.src = PLACEHOLDER_WEBP; };
img.src = `/api/v1/videos/i/${name}/thumbnail`;
Defensive patterns

Strategy: fallback

Try / catch

img.onerror = () => { img.src = PLACEHOLDER; }; // 404 on thumbnail falls back to placeholder

Prevention

When it happens

Trigger: Requesting the WebP thumbnail of a nonexistent/deleted video; a video whose thumbnail was never generated (imported externally, generation failed); path-resolution service error.

Common situations: Gallery grids loading thumbnails for items deleted concurrently; videos uploaded without server-side thumbnail generation; DB restore where thumbnail files were pruned.

Related errors


AI-assisted analysis of invoke-ai/InvokeAI@0b6a024f2f (2026-08-29). Data as JSON: /api/errors/b4b558ae4797b75a. Report an issue: GitHub.