{"record":{"id":"3513bdad7f623c88","repo":"cube-js/cube","slug":"unsupported-archive-format-bzip2-supported-forma","errorCode":null,"errorMessage":"Unsupported archive format: bzip2. Supported formats are gzip (.tar.gz/.tgz), tar and zip.","messagePattern":"Unsupported archive format: bzip2\\. Supported formats are gzip \\(\\.tar\\.gz/\\.tgz\\), tar and zip\\.","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/cubejs-backend-shared/src/http-utils.ts","lineNumber":165,"sourceCode":"    await tar.x({ file: archivePath, cwd, ...tarOptions });\n    return;\n  }\n\n  // zip: the two-byte \"PK\" prefix, shared by a local file header and by the\n  // end-of-central-directory record that an empty archive consists of.\n  if (startsWith(0x50, 0x4b)) {\n    await extractZip(archivePath, { dir: path.resolve(cwd) });\n    return;\n  }\n\n  // Uncompressed tar: \"ustar\" at offset 257.\n  if (bytesRead >= 262 && header.subarray(257, 262).toString('latin1') === 'ustar') {\n    await tar.x({ file: archivePath, cwd, ...tarOptions });\n    return;\n  }\n\n  if (startsWith(0x42, 0x5a, 0x68)) {\n    throw new Error(\n      'Unsupported archive format: bzip2. Supported formats are gzip (.tar.gz/.tgz), tar and zip.'\n    );\n  }\n\n  throw new Error(\n    'Unable to detect archive format from its contents. Supported formats are gzip (.tar.gz/.tgz), tar and zip.'\n  );\n}\n\ntype DownloadAndExtractFile = {\n  showProgress: boolean;\n  cwd: string;\n  skipExtract?: boolean;\n  dstFileName?: string;\n};\n\nexport async function downloadAndExtractFile(url: string, { cwd, skipExtract, dstFileName }: DownloadAndExtractFile) {\n  const request = new Request(url, {","sourceCodeStart":147,"sourceCodeEnd":183,"githubUrl":"https://github.com/cube-js/cube/blob/7d981676b36392fec34088b9afab6bdcad40207c/packages/cubejs-backend-shared/src/http-utils.ts#L147-L183","documentation":"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.","triggerScenarios":"Thrown at packages/cubejs-backend-shared/src/http-utils.ts:165 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","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."],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"7d981676b36392fec34088b9afab6bdcad40207c","analyzedAt":"2026-09-02T03:45:10.400Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T15:18:49.778Z"}