{"record":{"id":"1f516b6d4eced255","repo":"jdx/mise","slug":"zip-format-not-supported","errorCode":null,"errorMessage":"zip format not supported","messagePattern":"zip format not supported","errorType":"exception","errorClass":"eyre::Report","httpStatus":null,"severity":"error","filePath":"src/file.rs","lineNumber":2007,"sourceCode":"        // TODO: we probably shouldn't assume raw is tar.gz, but this was to retain existing behavior\n        ExtractionFormat::TarGz | ExtractionFormat::Raw => Box::new(GzDecoder::new(f)),\n        ExtractionFormat::TarXz => Box::new(xz2::read::XzDecoder::new(f)),\n        ExtractionFormat::TarBz2 => Box::new(BzDecoder::new(f)),\n        ExtractionFormat::TarZst => Box::new(zstd::stream::read::Decoder::new(f)?),\n        ExtractionFormat::Tar => Box::new(f),\n        ExtractionFormat::TarBr | ExtractionFormat::TarLz4 | ExtractionFormat::TarSz => {\n            bail!(\"{format} format not supported\")\n        }\n        ExtractionFormat::Gz\n        | ExtractionFormat::Xz\n        | ExtractionFormat::Bz2\n        | ExtractionFormat::Zst\n        | ExtractionFormat::Br\n        | ExtractionFormat::Lz4\n        | ExtractionFormat::Sz => {\n            bail!(\"{} is not a tar archive\", format)\n        }\n        ExtractionFormat::Zip => bail!(\"zip format not supported\"),\n        ExtractionFormat::SevenZip => bail!(\"7z format not supported\"),\n        ExtractionFormat::Rar => bail!(\"rar format not supported\"),\n    })\n}\n\nfn reset_dir_mtime_to_now(dir: &Path) -> Result<()> {\n    let now = FileTime::now();\n    for entry in WalkDir::new(dir) {\n        let entry = entry?;\n        if entry.file_type().is_file() {\n            set_file_times(entry.path(), now, now)?;\n        }\n    }\n    Ok(())\n}\n\nfn strip_archive_path_components(dir: &Path, strip_depth: usize) -> Result<()> {\n    if strip_depth == 0 {","sourceCodeStart":1989,"sourceCodeEnd":2025,"githubUrl":"https://github.com/jdx/mise/blob/9dcfcaa0dc8747a2577d3270b69bb9d8313b2807/src/file.rs#L1989-L2025","documentation":"open_tar cannot open zip archives - zip is a container with its own central directory and entry table, handled by the unzip function instead. Reaching this error means the caller bypassed the dispatch in extract_archive and sent a zip down the tar path.","triggerScenarios":"A direct untar(archive, dest, ExtractionFormat::Zip, opts) call, or a custom dispatch table that forwards zip archives to untar/open_tar.","commonSituations":"Copy-pasted dispatch code that assumes all archives are tar; tools shipping both .zip and .tar.gz assets where a matcher picks the zip while the code assumes tar.","solutions":["Call extract_archive so zip archives route to unzip","Branch explicitly: Zip -> unzip, SevenZip -> un7z, tar variants and Raw -> untar"],"exampleFix":"// before\nfile::untar(&archive, &dest, ExtractionFormat::Zip, &opts)?; // bails\n\n// after\nfile::unzip(&archive, &dest, &opts)?;\n// or simply: file::extract_archive(&archive, &dest, ExtractionFormat::Zip, &opts)?;","handlingStrategy":"type-guard","validationCode":null,"typeGuard":"fn can_untar(f: ExtractionFormat) -> bool {\n    f.is_tar_archive() || f == ExtractionFormat::Raw // Zip/SevenZip/Rar/single-file codecs all bail in open_tar\n}","tryCatchPattern":null,"preventionTips":["Use extract_archive so zip archives reach unzip automatically","In custom dispatch code, branch on the container family (tar vs zip vs 7z) before opening"],"tags":["archive","extraction","zip","rust","mise"],"backgroundTag":"unsupported-archive-format","analyzedSha":"9dcfcaa0dc8747a2577d3270b69bb9d8313b2807","analyzedAt":"2026-08-17T14:28:50.624Z","schemaVersion":2},"datasetVersion":"2026-08-21T13:17:26.733Z"}