{"record":{"id":"f8c36b150cfc6af5","repo":"tonhowtf/omniget","slug":"failed-to-read-entry-path","errorCode":null,"errorMessage":"Failed to read entry path: {}","messagePattern":"Failed to read entry path: (.+?)","errorType":"exception","errorClass":"anyhow::Error","httpStatus":null,"severity":"error","filePath":"src-tauri/omniget-core/src/core/dependencies.rs","lineNumber":639,"sourceCode":"    let bin_dir = bin_dir.to_path_buf();\n    let ffmpeg_name = ffmpeg_name.to_string();\n    let ffprobe_name = ffprobe_name.to_string();\n\n    tokio::task::spawn_blocking(move || {\n        let file = std::fs::File::open(&archive_path)\n            .map_err(|e| anyhow!(\"Failed to open archive: {}\", e))?;\n        let decompressor = xz2::read::XzDecoder::new(file);\n        let mut archive = tar::Archive::new(decompressor);\n        let targets = [ffmpeg_name.as_str(), ffprobe_name.as_str()];\n\n        for entry_result in archive\n            .entries()\n            .map_err(|e| anyhow!(\"Failed to read tar entries: {}\", e))?\n        {\n            let mut entry = entry_result.map_err(|e| anyhow!(\"Failed to read tar entry: {}\", e))?;\n            let path = entry\n                .path()\n                .map_err(|e| anyhow!(\"Failed to read entry path: {}\", e))?;\n            let file_name = path.file_name().and_then(|n| n.to_str()).unwrap_or(\"\");\n            for target in &targets {\n                if file_name == *target {\n                    let dest = bin_dir.join(format!(\"{}.new\", target));\n                    let mut out = std::fs::File::create(&dest)?;\n                    std::io::copy(&mut entry, &mut out)?;\n                    break;\n                }\n            }\n        }\n        Ok::<(), anyhow::Error>(())\n    })\n    .await\n    .map_err(|e| anyhow!(\"Spawn blocking failed: {}\", e))??;\n    Ok(())\n}\n\n// --- aria2c ---","sourceCodeStart":621,"sourceCodeEnd":657,"githubUrl":"https://github.com/tonhowtf/omniget/blob/8600b91f4246848bac346874daa9e61c1fc5677a/src-tauri/omniget-core/src/core/dependencies.rs#L621-L657","documentation":"For each tar member, extract_tar_xz_ffmpeg calls entry.path() to get the member's path before matching against the ffmpeg/ffprobe names. If the path bytes are not valid data (header read failure) entry.path() returns Err, wrapped into this message. Note that non-UTF-8 names are handled separately via unwrap_or(\"\") and do not trigger this.","triggerScenarios":"tar member whose path header cannot be decoded/read from the underlying xz stream; corruption in the header block; pax/GNU long-name extension data that is malformed.","commonSituations":"Archives with GNU long filenames or unusual encodings produced by nonstandard tarring tools; corrupted mid-stream downloads; hand-crafted archives.","solutions":["Re-download from the official FFmpeg source to rule out corruption","Repack or inspect the archive with tar -tvf to find the offending member","Update the tar crate; long-path/pax handling improves across versions","Fall back to matching on the raw header bytes if entry.path() keeps failing on a known-good archive"],"exampleFix":"// before\nlet path = entry\n    .path()\n    .map_err(|e| anyhow!(\"Failed to read entry path: {}\", e))?;\n// after\nlet path = entry\n    .path()\n    .map_err(|e| anyhow!(\"Failed to read entry path (skipping member): {}\", e))\n    .or_else(|_| entry.path_raw().map(PathBuf::from))?;","handlingStrategy":"type-guard","validationCode":null,"typeGuard":"fn entry_name_ok(e: &tar::Entry<'_, impl std::io::Read>) -> bool {\n    e.path().map(|p| p.file_name().is_some()).unwrap_or(false)\n}","tryCatchPattern":"let path = match entry.path() {\n    Ok(p) => p,\n    Err(_) => continue, // skip unreadable member instead of aborting the whole install\n};","preventionTips":["Treat per-entry path failures as skippable when you only need specific members (ffmpeg/ffprobe)","Use archives produced by standard tooling (GNU tar) to avoid odd header encodings","Keep the tar crate current for pax/GNU long-name support","Log skipped entries so silent data loss is visible"],"tags":["tar","path-parsing","archive-extraction"],"backgroundTag":"file-read-failed","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"}