jdx/mise · error · eyre::Report
zip format not supported
Error message
zip format not supported
What it means
open_tar cannot open zip archives - zip is a container with its own central directory and entry table, handled by the unzip function instead. Reaching this error means the caller bypassed the dispatch in extract_archive and sent a zip down the tar path.
Source
Thrown at src/file.rs:2007
// TODO: we probably shouldn't assume raw is tar.gz, but this was to retain existing behavior
ExtractionFormat::TarGz | ExtractionFormat::Raw => Box::new(GzDecoder::new(f)),
ExtractionFormat::TarXz => Box::new(xz2::read::XzDecoder::new(f)),
ExtractionFormat::TarBz2 => Box::new(BzDecoder::new(f)),
ExtractionFormat::TarZst => Box::new(zstd::stream::read::Decoder::new(f)?),
ExtractionFormat::Tar => Box::new(f),
ExtractionFormat::TarBr | ExtractionFormat::TarLz4 | ExtractionFormat::TarSz => {
bail!("{format} format not supported")
}
ExtractionFormat::Gz
| ExtractionFormat::Xz
| ExtractionFormat::Bz2
| ExtractionFormat::Zst
| ExtractionFormat::Br
| ExtractionFormat::Lz4
| ExtractionFormat::Sz => {
bail!("{} is not a tar archive", format)
}
ExtractionFormat::Zip => bail!("zip format not supported"),
ExtractionFormat::SevenZip => bail!("7z format not supported"),
ExtractionFormat::Rar => bail!("rar format not supported"),
})
}
fn reset_dir_mtime_to_now(dir: &Path) -> Result<()> {
let now = FileTime::now();
for entry in WalkDir::new(dir) {
let entry = entry?;
if entry.file_type().is_file() {
set_file_times(entry.path(), now, now)?;
}
}
Ok(())
}
fn strip_archive_path_components(dir: &Path, strip_depth: usize) -> Result<()> {
if strip_depth == 0 {View on GitHub (pinned to 9dcfcaa0dc)
Solutions
- Call extract_archive so zip archives route to unzip
- Branch explicitly: Zip -> unzip, SevenZip -> un7z, tar variants and Raw -> untar
Example fix
// before file::untar(&archive, &dest, ExtractionFormat::Zip, &opts)?; // bails // after file::unzip(&archive, &dest, &opts)?; // or simply: file::extract_archive(&archive, &dest, ExtractionFormat::Zip, &opts)?;
Defensive patterns
Strategy: type-guard
Type guard
fn can_untar(f: ExtractionFormat) -> bool {
f.is_tar_archive() || f == ExtractionFormat::Raw // Zip/SevenZip/Rar/single-file codecs all bail in open_tar
} Prevention
- Use extract_archive so zip archives reach unzip automatically
- In custom dispatch code, branch on the container family (tar vs zip vs 7z) before opening
When it happens
Trigger: A direct untar(archive, dest, ExtractionFormat::Zip, opts) call, or a custom dispatch table that forwards zip archives to untar/open_tar.
Common situations: Copy-pasted dispatch code that assumes all archives are tar; tools shipping both .zip and .tar.gz assets where a matcher picks the zip while the code assumes tar.
Related errors
- extract_archive does not support compressed single-file form
- rar format not supported
- untar only supports tar formats, got {}
- {} is not a tar archive
- strip-components > 1 is not supported
AI-assisted analysis of jdx/mise@9dcfcaa0dc (2026-08-17).
Data as JSON: /api/errors/1f516b6d4eced255.
Report an issue: GitHub.