{"record":{"id":"1fab3a2dd690f8ec","repo":"Radarr/Radarr","slug":"media-file-does-not-exist-filename","errorCode":null,"errorMessage":"Media file does not exist: {filename}","messagePattern":"Media file does not exist: (.+?)","errorType":"exception","errorClass":"FileNotFoundException","httpStatus":null,"severity":"error","filePath":"src/NzbDrone.Core/MediaFiles/MediaInfo/VideoFileInfoReader.cs","lineNumber":55,"sourceCode":"            // We bundle ffprobe for all platforms\n            GlobalFFOptions.Configure(options => options.BinaryFolder = AppDomain.CurrentDomain.BaseDirectory);\n\n            try\n            {\n                _pixelFormats = FFProbe.GetPixelFormats();\n            }\n            catch (Exception e)\n            {\n                _logger.Error(e, \"Failed to get supported pixel formats from ffprobe\");\n                _pixelFormats = new List<FFProbePixelFormat>();\n            }\n        }\n\n        public MediaInfoModel GetMediaInfo(string filename)\n        {\n            if (!_diskProvider.FileExists(filename))\n            {\n                throw new FileNotFoundException(\"Media file does not exist: \" + filename);\n            }\n\n            if (MediaFileExtensions.DiskExtensions\n                .Concat(MediaFileExtensions.StreamingExtensions)\n                .Contains(Path.GetExtension(filename)))\n            {\n                return null;\n            }\n\n            // TODO: Cache media info by path, mtime and length so we don't need to read files multiple times\n            try\n            {\n                _logger.Debug(\"Getting media info from {0}\", filename);\n                var ffprobeOutput = FFProbe.GetStreamJson(filename, ffOptions: new FFOptions { ExtraArguments = \"-probesize 50000000\" });\n\n                var analysis = FFProbe.AnalyseStreamJson(ffprobeOutput);\n                var primaryVideoStream = GetPrimaryVideoStream(analysis);\n","sourceCodeStart":37,"sourceCodeEnd":73,"githubUrl":"https://github.com/Radarr/Radarr/blob/ca451608dc60c6cec754aba8d96bfa30e9468ed5/src/NzbDrone.Core/MediaFiles/MediaInfo/VideoFileInfoReader.cs#L37-L73","documentation":"VideoFileInfoReader.GetMediaInfo checks that the file exists on disk before invoking ffprobe and throws FileNotFoundException if it does not. It is a preflight guard so ffprobe is never launched against a missing path.","triggerScenarios":"GetMediaInfo is called with a path that no longer exists — the file was deleted/moved between the time the job was enqueued and the call, or the path points to an unavailable share.","commonSituations":"Race conditions where an import/aggregation job runs after the file was removed, network share flapping, externally moved/renamed files, or stale DB paths.","solutions":["Verify the path exists with FileExists before calling GetMediaInfo.","Ensure the source share is mounted/available for the whole job lifetime.","Rescan/refresh the movie so paths are reconciled with disk before re-running."],"exampleFix":"// before\nvar info = reader.GetMediaInfo(path);\n\n// after: guard and skip missing files\nif (!_diskProvider.FileExists(path)) { logger.Warn(\"missing: {0}\", path); return null; }\nvar info = reader.GetMediaInfo(path);","handlingStrategy":"validation","validationCode":"if (!_diskProvider.FileExists(filename)) { logger.Warn(\"missing media file: {0}\", filename); return null; }","typeGuard":"static bool IsReadableMediaFile(IDiskProvider d, string p) => d.FileExists(p);","tryCatchPattern":null,"preventionTips":["Check existence before invoking ffprobe.","Keep source shares mounted for the job lifetime.","Rescan movies when disk and DB diverge."],"tags":["media-info","ffprobe","io","filesystem"],"backgroundTag":null,"analyzedSha":"ca451608dc60c6cec754aba8d96bfa30e9468ed5","analyzedAt":"2026-08-13T17:21:54.115Z","schemaVersion":2},"datasetVersion":"2026-08-13T19:17:28.613Z"}