{"record":{"id":"22c029061736da3b","repo":"tonhowtf/omniget","slug":"ffmpeg-binary-not-found-after-extraction","errorCode":null,"errorMessage":"FFmpeg binary not found after extraction","messagePattern":"FFmpeg binary not found after extraction","errorType":"exception","errorClass":"anyhow::Error","httpStatus":null,"severity":"error","filePath":"src-tauri/omniget-core/src/core/dependencies.rs","lineNumber":506,"sourceCode":"        if ffprobe_path.exists() {\n            let ffprobe_mac = ffprobe_path.clone();\n            if let Err(e) = tokio::task::spawn_blocking(move || {\n                crate::core::process::std_command(\"xattr\")\n                    .args([\"-d\", \"com.apple.quarantine\"])\n                    .arg(&ffprobe_mac)\n                    .output()\n            })\n            .await\n            .map_err(|e| std::io::Error::other(e.to_string()))\n            .and_then(|r| r)\n            {\n                tracing::warn!(\"Failed to remove quarantine from ffprobe: {}\", e);\n            }\n        }\n    }\n\n    if !ffmpeg_target.exists() {\n        return Err(anyhow!(\"FFmpeg binary not found after extraction\"));\n    }\n\n    let verify = {\n        let target = ffmpeg_target.clone();\n        tokio::task::spawn_blocking(move || {\n            crate::core::process::std_command(&target)\n                .arg(\"-version\")\n                .stdout(Stdio::null())\n                .stderr(Stdio::null())\n                .status()\n        })\n        .await\n        .map_err(|e| anyhow!(\"spawn_blocking failed: {}\", e))?\n    };\n    match verify {\n        Ok(s) if s.success() => {}\n        Ok(s) => {\n            return Err(anyhow!(","sourceCodeStart":488,"sourceCodeEnd":524,"githubUrl":"https://github.com/tonhowtf/omniget/blob/8600b91f4246848bac346874daa9e61c1fc5677a/src-tauri/omniget-core/src/core/dependencies.rs#L488-L524","documentation":"After downloading and extracting the FFmpeg archive, download_ffmpeg() verifies that the expected ffmpeg binary now exists at its target path. If extraction produced no file there — because the archive layout didn't match the expected inner paths or extraction skipped entries — this anyhow error is returned.","triggerScenarios":"The downloaded archive's internal directory structure differs from what extract_zip_ffmpeg/extract expects (vendor changed nesting), so the ffmpeg/ffprobe entries were never copied to bin_dir.","commonSituations":"Upstream FFmpeg release repackaged with different folder nesting; wrong archive type downloaded for the platform; partial/corrupt archive extracted zero entries; antivirus quarantined the extracted binary.","solutions":["Download the archive manually and inspect its internal layout; update the extraction path matching logic to the new structure","Confirm the correct archive variant for the current platform is in the downloads list","Check antivirus/quarantine logs for removal of the extracted binary","Re-run ensure_ffmpeg to force a fresh download and extraction"],"exampleFix":"// before\nfor i in 0..archive.len() {\n    let mut entry = archive.by_index(i)?;\n    // match only by file name\n}\n// after\nfor i in 0..archive.len() {\n    let mut entry = archive.by_index(i)?;\n    let name = entry.name().rsplit('/').next().unwrap_or(\"\");\n    if targets.contains(&name) { /* extract regardless of nesting */ }\n}","handlingStrategy":"validation","validationCode":"// after extraction, before trusting install\nif !bin_dir.join(bin_name(\"ffmpeg\")).exists() {\n    eprintln!(\"extraction produced no ffmpeg binary — check archive layout\");\n}","typeGuard":null,"tryCatchPattern":"match download_ffmpeg().await {\n    Ok(p) => ...,\n    Err(e) if e.to_string().contains(\"not found after extraction\") => {\n        eprintln!(\"archive layout changed; update extraction matching\");\n    }\n    Err(e) => ...,\n}","preventionTips":["Add a unit test that extracts a fixture archive of the real vendor layout","Match archive entries by basename, not full nested path","Re-verify the archive layout after each pinned FFmpeg version bump","Check quarantine/antivirus logs if binaries vanish after extraction"],"tags":["ffmpeg","extraction","filesystem","archive"],"backgroundTag":"file-not-found","analyzedSha":"8600b91f4246848bac346874daa9e61c1fc5677a","analyzedAt":"2026-09-12T14:29:19.317Z","contentChangedAt":"2026-09-12T14:29:19.317Z","schemaVersion":2},"datasetVersion":"2026-09-15T23:17:13.987Z"}