{"record":{"id":"a90866c084e27d3c","repo":"jdx/mise","slug":"format-format-not-supported","errorCode":null,"errorMessage":"{format} format not supported","messagePattern":"(.+?) format not supported","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/file.rs","lineNumber":1974,"sourceCode":"        }\n        _ => f(),\n    }\n}\n\npub(crate) fn decompress_file(input: &Path, dest: &Path, format: ExtractionFormat) -> Result<()> {\n    if let Some(parent) = dest.parent()\n        && !parent.as_os_str().is_empty()\n    {\n        create_dir_all(parent)?;\n    }\n\n    run_blocking(|| match format {\n        ExtractionFormat::Gz => un_gz(input, dest),\n        ExtractionFormat::Xz => un_xz(input, dest),\n        ExtractionFormat::Zst => un_zst(input, dest),\n        ExtractionFormat::Bz2 => un_bz2(input, dest),\n        ExtractionFormat::Br | ExtractionFormat::Lz4 | ExtractionFormat::Sz => {\n            bail!(\"{format} format not supported\")\n        }\n        _ => bail!(\"unsupported compressed file format: {}\", format),\n    })\n}\n\n#[derive(Debug, Clone, Copy, PartialEq, strum::EnumString, strum::Display)]\npub(crate) enum ExtractionFormat {\n    #[strum(to_string = \"tar.gz\", serialize = \"tgz\")]\n    TarGz,\n    #[strum(serialize = \"gz\")]\n    Gz,\n    #[strum(to_string = \"tar.xz\", serialize = \"txz\")]\n    TarXz,\n    #[strum(serialize = \"xz\")]\n    Xz,\n    #[strum(to_string = \"tar.bz2\", serialize = \"tbz2\", serialize = \"tbz\")]\n    TarBz2,\n    #[strum(serialize = \"bz2\")]","sourceCodeStart":1956,"sourceCodeEnd":1992,"githubUrl":"https://github.com/jdx/mise/blob/533346cc374382b41ec5ff70536252b2e96e725c/src/file.rs#L1956-L1992","documentation":"decompress_file supports single-file decompression only for gz, xz, zst, and bz2. Passing Br (brotli), Lz4, or Sz (snappy) as the format bails with \"{format} format not supported\" — these formats are recognized in the enum but no decompressor is wired in for single-file use.","triggerScenarios":"Calling decompress_file(input, dest, ExtractionFormat::Br | Lz4 | Sz), typically after ExtractionFormat::from_file_name classified a downloaded .br/.lz4/.sz single-file asset.","commonSituations":"Downloading a brotli- or lz4-compressed binary from a tool release and letting mise decompress it; backend config pointing at a .lz4 asset where only tar.lz4-style support was assumed.","solutions":["Choose a differently compressed asset (e.g. .gz, .xz, .zst, .bz2) for the tool version","Decompress the file yourself with a dedicated tool (brotli -d, lz4 -d, snunzip) into dest before/instead of calling decompress_file","If this is inside a backend, change the asset URL or format mapping to a supported compression","Add an actual decompressor integration upstream if brotli/lz4/snappy single-file support is genuinely needed"],"exampleFix":"// before\nformat = ExtractionFormat::from_ext(\"lz4\")?; // decompress_file -> error\n// after\nformat = ExtractionFormat::from_ext(\"gz\")?; // or decompress externally first","handlingStrategy":"fallback","validationCode":"if matches!(fmt, ExtractionFormat::Br | ExtractionFormat::Lz4 | ExtractionFormat::Sz) {\n    // decompress externally or pick a supported asset\n}","typeGuard":null,"tryCatchPattern":"match decompress_file(&input, &dest, fmt) {\n    Err(e) if e.to_string().contains(\"format not supported\") => {\n        // fallback: shell out to `brotli -d` / `lz4 -d` or download a gz/xz/zst/bz2 asset\n    }\n    other => other?,\n}","preventionTips":["Only call decompress_file for gz/xz/zst/bz2 assets","Check ExtractionFormat::is_compressed_file() plus explicit Br/Lz4/Sz exclusion first","Prefer release assets in supported compressions when configuring backends","Keep a external-decompressor fallback for brotli/lz4/snappy"],"tags":["archive","decompression","unsupported-format"],"backgroundTag":"unsupported-operation","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"}