invoke-ai/InvokeAI · warning · HTTPException
Video record not found
Error message
Video record not found
What it means
Raised by get_video_dto (GET videos/i/{video_name}) as a bare HTTP 404 when the service throws VideoRecordNotFoundException. This is the canonical 'video record missing' response — the comment notes it is the 404 a workflow's video field drops its reference on, so only a genuinely missing record may produce it (read-access failures raise earlier, not this). No detail body is attached.
Source
Thrown at invokeai/app/api/routers/videos.py:498
_assert_video_owner(video_name, current_user)
try:
return ApiDependencies.invoker.services.videos.update(video_name, video_changes)
except Exception:
raise HTTPException(status_code=400, detail="Failed to update video")
@videos_router.get("/i/{video_name}", operation_id="get_video_dto", response_model=VideoDTO)
def get_video_dto(
current_user: CurrentUserOrDefault,
video_name: str = PathParam(description="The name of video to get"),
) -> VideoDTO:
_assert_video_read_access(video_name, current_user)
try:
return ApiDependencies.invoker.services.videos.get_dto(video_name)
except VideoRecordNotFoundException:
# See get_image_dto: this is the 404 a workflow's video field drops its reference on,
# so only a genuinely missing record may produce it.
raise HTTPException(status_code=404)
@videos_router.get(
"/i/{video_name}/metadata", operation_id="get_video_metadata", response_model=Optional[MetadataField]
)
def get_video_metadata(
current_user: CurrentUserOrDefault,
video_name: str = PathParam(description="The name of video to get"),
) -> Optional[MetadataField]:
_assert_video_read_access(video_name, current_user)
try:
return ApiDependencies.invoker.services.videos.get_metadata(video_name)
except Exception:
raise HTTPException(status_code=404)
@videos_router.get(
"/i/{video_name}/workflow", operation_id="get_video_workflow", response_model=WorkflowAndGraphResponseView on GitHub (pinned to 0b6a024f2f)
Solutions
- List current videos (GET videos) and use an existing video_name.
- If a workflow references the video, re-link the workflow's video field to an existing video or remove the stale node.
- Check whether a concurrent delete (batch/uncategorized cleanup) removed the video and treat the 404 as expected.
- Verify the name against the frontend cache after a refresh, not from a stale copy.
Example fix
// before
const dto = await api.getVideoDto(name); // throws on missing
// after
try {
const dto = await api.getVideoDto(name);
} catch (e) {
if (e.status === 404) return null; // record genuinely gone
throw e;
} Defensive patterns
Strategy: try-catch
Validate before calling
const videos = await api.listVideos(); const exists = videos.some(v => v.video_name === name); if (!exists) return null;
Try / catch
try {
return await api.getVideoDto(name);
} catch (e) {
if (e.response?.status === 404) return null; // record genuinely missing
throw e;
} Prevention
- Prune workflow references when deleting videos so graphs don't hold stale names.
- Re-resolve video names from list endpoints instead of cached/bookmarked values.
- Handle 404-with-empty-body explicitly; this endpoint sends no detail string.
When it happens
Trigger: GET videos/i/{video_name} where the video record was deleted (by delete_video, batch delete, or delete_uncategorized_videos), the name is wrong, or the workflow graph still references a video name that no longer exists.
Common situations: Workflows or saved graphs referencing videos pruned from the gallery; stale bookmarks/links after cleanup; typos in video_name; restoring a database without its media or vice versa.
Related errors
- System prompt not found
- Failed to update video
- Video metadata not found
- Video workflow not found
- Video URLs not found
AI-assisted analysis of invoke-ai/InvokeAI@0b6a024f2f (2026-08-29).
Data as JSON: /api/errors/ccdb659d6fd00264.
Report an issue: GitHub.