{"record":{"id":"1be292b6de418731","repo":"jdx/mise","slug":"rar-format-not-supported","errorCode":null,"errorMessage":"rar format not supported","messagePattern":"rar format not supported","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/file.rs","lineNumber":2128,"sourceCode":"        | ExtractionFormat::TarBz2\n        | ExtractionFormat::TarZst\n        | ExtractionFormat::Tar\n        | ExtractionFormat::TarBr\n        | ExtractionFormat::TarLz4\n        | ExtractionFormat::TarSz\n        | ExtractionFormat::Raw => untar(archive, dest, format, opts),\n        ExtractionFormat::Zip => unzip(archive, dest, opts),\n        ExtractionFormat::SevenZip => un7z(archive, dest, opts),\n        ExtractionFormat::Gz\n        | ExtractionFormat::Xz\n        | ExtractionFormat::Bz2\n        | ExtractionFormat::Zst\n        | ExtractionFormat::Br\n        | ExtractionFormat::Lz4\n        | ExtractionFormat::Sz => {\n            bail!(\"extract_archive does not support compressed single-file format: {format}\")\n        }\n        ExtractionFormat::Rar => bail!(\"rar format not supported\"),\n    }\n}\n\npub(crate) fn untar(\n    archive: &Path,\n    dest: &Path,\n    format: ExtractionFormat,\n    opts: &ExtractOptions,\n) -> Result<()> {\n    if !format.is_tar_archive() && format != ExtractionFormat::Raw {\n        bail!(\"untar only supports tar formats, got {}\", format);\n    }\n\n    debug!(\"tar -xf {} -C {}\", archive.display(), dest.display());\n    if let Some(pr) = &opts.pr {\n        pr.set_message(format!(\n            \"extract {}\",\n            archive.file_name().unwrap().to_string_lossy()","sourceCodeStart":2110,"sourceCodeEnd":2146,"githubUrl":"https://github.com/jdx/mise/blob/533346cc374382b41ec5ff70536252b2e96e725c/src/file.rs#L2110-L2146","documentation":"extract_archive explicitly rejects RAR archives with \"rar format not supported\". Despite Rar being a parseable ExtractionFormat enum variant, no rar extraction backend (e.g. unrar/7z library) is integrated.","triggerScenarios":"Calling extract_archive (or untar/open_tar) with ExtractionFormat::Rar, typically from a .rar release asset classified by from_file_name/from_ext.","commonSituations":"A tool vendor publishes Windows builds only as .rar; registry/backend config points at the rar asset.","solutions":["Use a .zip, .7z, or tar.* asset for the tool instead","Convert the rar to a supported format when mirroring/proxying the asset","Extract the rar with an external tool (unrar x / 7z x) in a pre-step, then install from the extracted dir","File/upstream an issue requesting rar support if no alternative asset exists"],"exampleFix":"// before\nasset = \"tool-v1.2.rar\" // extract_archive -> error\n// after\nasset = \"tool-v1.2.zip\" // or run `unrar x asset dest` before install","handlingStrategy":"fallback","validationCode":"if fmt == ExtractionFormat::Rar {\n    // pick a zip/tar asset or run external `unrar x`\n}","typeGuard":null,"tryCatchPattern":"match extract_archive(&archive, &dest, fmt, &opts) {\n    Err(e) if e.to_string().contains(\"rar format not supported\") => {\n        // fallback: `unrar x archive dest` via std::process::Command\n    }\n    other => other?,\n}","preventionTips":["Avoid .rar release assets in backend configs","Require zip/7z/tar.* assets when mirroring tools","Note 7z format is also unsupported via extract_archive's Rar sibling — check un7z availability","Validate asset extensions before download in custom backends"],"tags":["archive","rar","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"}