{"record":{"id":"ed3980b201d60a6b","repo":"invoke-ai/InvokeAI","slug":"video-metadata-not-found","errorCode":null,"errorMessage":"Video metadata not found","messagePattern":"Video metadata not found","errorType":"http","errorClass":"HTTPException","httpStatus":404,"severity":"info","filePath":"invokeai/app/api/routers/videos.py","lineNumber":512,"sourceCode":"        return ApiDependencies.invoker.services.videos.get_dto(video_name)\n    except VideoRecordNotFoundException:\n        # See get_image_dto: this is the 404 a workflow's video field drops its reference on,\n        # so only a genuinely missing record may produce it.\n        raise HTTPException(status_code=404)\n\n\n@videos_router.get(\n    \"/i/{video_name}/metadata\", operation_id=\"get_video_metadata\", response_model=Optional[MetadataField]\n)\ndef get_video_metadata(\n    current_user: CurrentUserOrDefault,\n    video_name: str = PathParam(description=\"The name of video to get\"),\n) -> Optional[MetadataField]:\n    _assert_video_read_access(video_name, current_user)\n    try:\n        return ApiDependencies.invoker.services.videos.get_metadata(video_name)\n    except Exception:\n        raise HTTPException(status_code=404)\n\n\n@videos_router.get(\n    \"/i/{video_name}/workflow\", operation_id=\"get_video_workflow\", response_model=WorkflowAndGraphResponse\n)\ndef get_video_workflow(\n    current_user: CurrentUserOrDefault,\n    video_name: str = PathParam(description=\"The name of video whose workflow to get\"),\n) -> WorkflowAndGraphResponse:\n    \"\"\"Gets the workflow and graph saved with a generated video (mirrors the image route).\"\"\"\n    _assert_video_read_access(video_name, current_user)\n    try:\n        workflow = ApiDependencies.invoker.services.videos.get_workflow(video_name)\n        graph = ApiDependencies.invoker.services.videos.get_graph(video_name)\n        return WorkflowAndGraphResponse(workflow=workflow, graph=graph)\n    except Exception:\n        raise HTTPException(status_code=404)\n","sourceCodeStart":494,"sourceCodeEnd":530,"githubUrl":"https://github.com/invoke-ai/InvokeAI/blob/0b6a024f2ff6a86bfb953dcdb9cc504ef7397a06/invokeai/app/api/routers/videos.py#L494-L530","documentation":"Raised by get_video_metadata (GET videos/i/{video_name}/metadata) as HTTP 404 when videos.get_metadata(video_name) raises any exception. It usually means the video record is missing, but because the handler catches Exception broadly, any service error (DB failure, corrupt metadata) is also reported as 404. The response carries no detail body.","triggerScenarios":"Requesting metadata for a deleted/nonexistent video_name; a metadata parse failure on a corrupt record; any database error during the metadata read.","commonSituations":"Videos imported or created by older InvokeAI versions lacking the expected metadata; DB/restore mismatches; probing metadata after a failed upload that never recorded the video.","solutions":["Confirm the video exists via GET videos/i/{video_name} first — if that also 404s, the video is gone, not just the metadata.","Check server logs to distinguish a missing record from a corrupt/unreadable metadata blob.","Re-generate or re-upload the video if its metadata was never written.","If the record exists but metadata 404s, treat it as a service bug and report with server logs."],"exampleFix":"// before\nconst meta = await api.getVideoMetadata(name); // ambiguous 404\n// after\nconst exists = await api.getVideoDto(name).then(() => true, () => false);\nconst meta = exists ? await api.getVideoMetadata(name) : null;","handlingStrategy":"fallback","validationCode":"const exists = await api.getVideoDto(name).then(() => true, () => false);\nif (!exists) return null; // video gone; metadata certainly unavailable","typeGuard":null,"tryCatchPattern":"try {\n  return await api.getVideoMetadata(name);\n} catch (e) {\n  if (e.response?.status === 404) return null; // no metadata available\n  throw e;\n}","preventionTips":["Render metadata panels with a null/empty fallback for videos lacking metadata.","Check the video itself exists before attributing a metadata 404 to corruption.","Keep server logs handy — broad Exception catch means 404 may mask DB errors."],"tags":["http-404","metadata","video","rest-api"],"backgroundTag":"resource-not-found-404","analyzedSha":"0b6a024f2ff6a86bfb953dcdb9cc504ef7397a06","analyzedAt":"2026-08-29T04:46:49.967Z","schemaVersion":2},"datasetVersion":"2026-08-29T07:17:48.351Z"}