{"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":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/system/packages/brew/cask/fetch.rs","lineNumber":290,"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":272,"sourceCodeEnd":308,"githubUrl":"https://github.com/jdx/mise/blob/533346cc374382b41ec5ff70536252b2e96e725c/src/system/packages/brew/cask/fetch.rs#L272-L308","documentation":"The brew-cask fetcher staged a cask artifact whose download format is neither one of the handled archive types nor recognized as a supported archive at all. When the format fails the `is_archive()` check and no direct staging path applies, extraction cannot proceed, so the fetch aborts with this error naming the cask token and file. It protects users from attempting to unpack an unknown binary or container format.","triggerScenarios":"Cask `url` points to a file whose format (from extension or detected type) is not in the supported archive set and is not a plain staged file; upstream changed the distribution artifact to a new container format; a cask stanza mislabels the artifact so the fetcher picks the wrong extraction branch in `extract_archive`.","commonSituations":"A cask recipe references a `.pkg`/`.dmg` variant or a new compression format the fetcher doesn't recognize; an upstream release swapped its artifact format between versions; a hand-edited cask definition names the wrong file.","solutions":["Check the cask definition (`token`, `url`, artifact stanzas) and confirm the artifact format is one the fetcher supports","Update the cask definition or fetcher to a version that supports the new archive format","Verify the downloaded file's actual type (`file <filename>`) and fix the cask to point at a supported archive","If the artifact is a plain executable rather than an archive, adjust the cask stanza so it is staged directly instead of extracted"],"exampleFix":"// before: cask expects a zip but upstream now ships a .pkg\nurl \"https://example.com/app.pkg\"\n// after: point at the still-published supported archive\nurl \"https://example.com/app.zip\"","handlingStrategy":"validation","validationCode":"let known = [\"zip\", \"tar.gz\", \"tgz\", \"tar.bz2\", \"dmg\", \"tar.xz\"];\nif !known.iter().any(|ext| filename.ends_with(ext)) {\n    eprintln!(\"skip {}: unsupported archive format\", filename);\n}","typeGuard":"fn is_supported_archive(filename: &str) -> bool {\n    matches!(filename.rsplit('.').next(), Some(\"zip\") | Some(\"gz\") | Some(\"bz2\") | Some(\"xz\") | Some(\"dmg\"))\n}","tryCatchPattern":null,"preventionTips":["Keep cask definitions pinned to artifacts with known, supported formats","Run `file` on the downloaded artifact before staging in CI","Watch upstream release notes for artifact-format changes"],"tags":["brew-cask","archive","extraction","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"}