{"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":null,"httpStatus":null,"severity":"error","filePath":"src/file.rs","lineNumber":2198,"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":2180,"sourceCodeEnd":2216,"githubUrl":"https://github.com/jdx/mise/blob/533346cc374382b41ec5ff70536252b2e96e725c/src/file.rs#L2180-L2216","documentation":"open_tar rejects Zip archives with \"zip format not supported\" — the tar reader cannot handle zip containers. Zip must be routed through unzip(); reaching this bail means zip escaped the dispatch in extract_archive and landed in the tar path.","triggerScenarios":"Calling untar/open_tar directly with ExtractionFormat::Zip (or the alias Vsix), bypassing extract_archive's unzip dispatch.","commonSituations":"Custom install code assumes all archives are tarballs; a .vsix (zip) extension asset is passed to untar; refactored dispatch dropped the extract_archive layer.","solutions":["Call extract_archive, which dispatches Zip to unzip automatically","Call unzip directly for known-zip archives","Correct format detection so the archive is classified as Zip and dispatched appropriately","For raw zip bytes, extract with the zip crate directly rather than the tar reader"],"exampleFix":"// before\nuntar(&archive, &dest, ExtractionFormat::Zip, &opts)?;\n// after\nunzip(&archive, &dest, &opts)?; // or extract_archive(...)","handlingStrategy":"validation","validationCode":"if matches!(fmt, ExtractionFormat::Zip) {\n    unzip(&archive, &dest, &opts)?;\n} else {\n    untar(&archive, &dest, fmt, &opts)?;\n}","typeGuard":"fn is_zip(f: ExtractionFormat) -> bool {\n    matches!(f, ExtractionFormat::Zip) // includes .vsix alias\n}","tryCatchPattern":"match untar(&archive, &dest, fmt, &opts) {\n    Err(e) if e.to_string().contains(\"zip format not supported\") => {\n        unzip(&archive, &dest, &opts)?;\n    }\n    other => other?,\n}","preventionTips":["Route Zip (and .vsix) exclusively through extract_archive/unzip","Never call untar with formats outside is_tar_archive() || Raw","Handle the vsix->zip alias in format detection logic","Test custom installers against both tarball and zip assets"],"tags":["archive","zip","format-mismatch","wrong-function"],"backgroundTag":"incompatible-source-type","analyzedSha":"533346cc374382b41ec5ff70536252b2e96e725c","analyzedAt":"2026-09-17T13:35:38.149Z","contentChangedAt":"2026-09-17T13:35:38.149Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}