{"record":{"id":"b396c4b811c58a38","repo":"jdx/mise","slug":"brew-cask-unsupported-archive-type-for-b396c4","errorCode":null,"errorMessage":"brew-cask:{}: unsupported archive type for {}","messagePattern":"brew-cask:(.+?): unsupported archive type for (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/system/packages/brew/cask/fetch.rs","lineNumber":294,"sourceCode":"        .and_then(|f| f.to_str())\n        .unwrap_or_default();\n    if is_dmg_archive(archive, filename)? {\n        file::un_dmg(archive, &extract_dir)?;\n    } else {\n        let format = cask_extraction_format(archive, filename)?;\n        if format == ExtractionFormat::Raw {\n            // A direct pkg download may have an opaque URL path while the response's\n            // Content-Disposition and the cask artifact supply its real name. Stage\n            // XAR installers under the declared artifact name; other raw downloads\n            // are executable binaries and retain the original URL filename.\n            let (stage_filename, executable) = raw_cask_artifact_name(cask, archive, filename)?;\n            let dest = extract_dir.join(stage_filename);\n            file::copy(archive, &dest)?;\n            if executable {\n                file::make_executable(&dest)?;\n            }\n        } else if !format.is_archive() {\n            bail!(\n                \"brew-cask:{}: unsupported archive type for {}\",\n                cask.token,\n                filename\n            );\n        } else {\n            file::extract_archive(\n                archive,\n                &extract_dir,\n                format,\n                &ExtractOptions {\n                    pr,\n                    ..Default::default()\n                },\n            )?;\n        }\n    }\n    extract_nested_cask_archives(&extract_dir, pr)?;\n    Ok(extract_dir)","sourceCodeStart":276,"sourceCodeEnd":312,"githubUrl":"https://github.com/jdx/mise/blob/afd2eddd3a50c16190efc1c7e94404b48f72af57/src/system/packages/brew/cask/fetch.rs#L276-L312","documentation":"After download, mise determines an ExtractionFormat for the archive (by cask hints and content sniffing). If the format is neither Raw (a single staged file) nor a supported archive type, extraction cannot proceed and mise aborts. This means the downloaded artifact's format isn't one of the container formats mise can unpack for casks.","triggerScenarios":"extract_archive (via fetch_and_stage) encounters a cask artifact whose detected format reports is_archive() == false and is not Raw — e.g. an installer format mise does not support, or a file whose content doesn't match any known archive signature.","commonSituations":"A cask pointing at a .pkg/.mpkg or other installer type outside the supported set; the URL serving an HTML error page instead of the archive so sniffing fails; upstream changed the artifact format (e.g. zip → proprietary container); cask stanza (url/appcast) out of sync with the actual file.","solutions":["Verify the URL actually serves the intended artifact (a 404/HTML body breaks format detection); fix the URL or proxy in the cask metadata.","Update the cask definition to the currently published artifact format, or switch to an alternate URL mise supports (zip/tar/dmg/git).","Install the app via the brew CLI directly if it requires an installer type mise does not unpack.","Clear the download cache and retry in case a truncated/corrupt cached archive caused misdetection."],"exampleFix":"// before (unsupported container)\n\"url\": \"https://example.com/myapp.custominstaller\"\n// after\n\"url\": \"https://example.com/myapp.zip\"","handlingStrategy":"try-catch","validationCode":"file myapp.zip && file --mime-type myapp.zip  # confirm the URL serves a supported archive before wiring it into a cask","typeGuard":null,"tryCatchPattern":"// Rust caller\nmatch install_cask(token) {\n    Err(e) if e.to_string().contains(\"unsupported archive type\") => {\n        eprintln!(\"artifact format unsupported; install via `brew install --cask {token}` instead\");\n    }\n    Err(e) => return Err(e),\n    Ok(v) => Ok(v),\n}","preventionTips":["Curl the cask URL once and inspect it (file/mime) before adding it to cask metadata.","Use zip/tar/dmg artifacts that mise supports; avoid exotic installer containers.","Bump the cask when upstream changes artifact format."],"tags":["brew","archive","unsupported-format","package-install"],"backgroundTag":"unsupported-operation","analyzedSha":"afd2eddd3a50c16190efc1c7e94404b48f72af57","analyzedAt":"2026-09-09T01:38:25.179Z","contentChangedAt":"2026-09-09T01:38:25.179Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}