cube-js/cube · error · Error
Unsupported archive format: bzip2. Supported formats are gzi
Error message
Unsupported archive format: bzip2. Supported formats are gzip (.tar.gz/.tgz), tar and zip.
What it means
Format guard in extractArchive (http-utils.ts): the downloaded archive's magic bytes match bzip2 (0x42 0x5a 0x68) or none of the supported signatures, so it cannot be extracted. The extractor only supports gzip-compressed tar (.tar.gz/.tgz), plain tar, and zip; it fires when downloadAndExtractFile is given an archive in an unsupported compression format.
Source
Thrown at packages/cubejs-backend-shared/src/http-utils.ts:165
await tar.x({ file: archivePath, cwd, ...tarOptions });
return;
}
// zip: the two-byte "PK" prefix, shared by a local file header and by the
// end-of-central-directory record that an empty archive consists of.
if (startsWith(0x50, 0x4b)) {
await extractZip(archivePath, { dir: path.resolve(cwd) });
return;
}
// Uncompressed tar: "ustar" at offset 257.
if (bytesRead >= 262 && header.subarray(257, 262).toString('latin1') === 'ustar') {
await tar.x({ file: archivePath, cwd, ...tarOptions });
return;
}
if (startsWith(0x42, 0x5a, 0x68)) {
throw new Error(
'Unsupported archive format: bzip2. Supported formats are gzip (.tar.gz/.tgz), tar and zip.'
);
}
throw new Error(
'Unable to detect archive format from its contents. Supported formats are gzip (.tar.gz/.tgz), tar and zip.'
);
}
type DownloadAndExtractFile = {
showProgress: boolean;
cwd: string;
skipExtract?: boolean;
dstFileName?: string;
};
export async function downloadAndExtractFile(url: string, { cwd, skipExtract, dstFileName }: DownloadAndExtractFile) {
const request = new Request(url, {View on GitHub (pinned to 7d981676b3)
Solutions
- Repackage the archive as .tar.gz, .tar, or .zip and re-host it at the download URL.
- If the source only offers bzip2, decompress/recompress it locally before use.
- Verify the URL actually serves the intended archive and not a redirect or error page with different bytes.
Defensive patterns
Strategy: validation
When it happens
Trigger: Thrown at packages/cubejs-backend-shared/src/http-utils.ts:165 when the library encounters an invalid state.
Common situations: See trigger scenarios.
AI-assisted analysis of cube-js/cube@7d981676b3 (2026-09-02).
Data as JSON: /api/errors/3513bdad7f623c88.
Report an issue: GitHub.