{"record":{"id":"3f4d5116ab467233","repo":"google-gemini/gemini-cli","slug":"unsupported-file-extension-for-extraction-file","errorCode":null,"errorMessage":"Unsupported file extension for extraction: ${file}","messagePattern":"Unsupported file extension for extraction: (.+?)","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/cli/src/config/extensions/github.ts","lineNumber":573,"sourceCode":"        }\n        const file = fs.createWriteStream(dest);\n        res.pipe(file);\n        file.on('finish', () => file.close(resolve as () => void));\n      })\n      .on('error', reject);\n  });\n}\n\nexport async function extractFile(file: string, dest: string): Promise<void> {\n  if (file.endsWith('.tar.gz')) {\n    await tar.x({\n      file,\n      cwd: dest,\n    });\n  } else if (file.endsWith('.zip')) {\n    await extract(file, { dir: dest });\n  } else {\n    throw new Error(`Unsupported file extension for extraction: ${file}`);\n  }\n}\n","sourceCodeStart":555,"sourceCodeEnd":576,"githubUrl":"https://github.com/google-gemini/gemini-cli/blob/5024443c7217464a66e98f80d73172a26440bd8f/packages/cli/src/config/extensions/github.ts#L555-L576","documentation":"Thrown by extractFile() when the archive name is neither .tar.gz (handled by tar.x) nor .zip (handled by extract). The function is used to unpack downloaded release assets, so any other archive format is unsupported.","triggerScenarios":"A GitHub release asset with an extension like .tar, .tar.bz2, .gz (non-tarball), .7z, .rar, or no extension is passed to extractFile.","commonSituations":"An extension publishes assets in a format the installer does not handle; a release provides a single-file .gz rather than a .tar.gz; case-sensitive extension mismatch (.ZIP, .TAR.GZ).","solutions":["Repackage the asset as .tar.gz or .zip on the release.","Add a branch to extractFile for the new format and a matching extractor dependency.","Normalize the filename to lowercase before the endsWith checks if case is the issue."],"exampleFix":"// before\nif (file.endsWith('.tar.gz')) { ... } else if (file.endsWith('.zip')) { ... } else throw ...;\n// after\nconst lower = file.toLowerCase();\nif (lower.endsWith('.tar.gz')) { ... } else if (lower.endsWith('.tgz')) { ... } else if (lower.endsWith('.zip')) { ... } else throw ...;","handlingStrategy":"validation","validationCode":"const SUPPORTED = ['.tar.gz', '.zip'];\nfunction isSupportedArchive(file: string): boolean {\n  const f = file.toLowerCase();\n  return SUPPORTED.some((ext) => f.endsWith(ext));\n}","typeGuard":"function isSupportedArchive(file: string): boolean { const f = file.toLowerCase(); return f.endsWith('.tar.gz') || f.endsWith('.zip'); }","tryCatchPattern":null,"preventionTips":["Publish release assets only as .tar.gz or .zip.","Normalize the filename case before the extension check."],"tags":["extensions","installation","archive","validation"],"backgroundTag":null,"analyzedSha":"5024443c7217464a66e98f80d73172a26440bd8f","analyzedAt":"2026-08-12T06:01:53.711Z","schemaVersion":2},"datasetVersion":"2026-08-12T13:17:24.610Z"}