{"record":{"id":"742fa7094430277d","repo":"cube-js/cube","slug":"tar-skipped-an-entry-while-extracting-code","errorCode":null,"errorMessage":"tar skipped an entry while extracting (${code}): ${message}","messagePattern":"tar skipped an entry while extracting \\((.+?)\\): (.+?)","errorType":"console","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"packages/cubejs-backend-shared/src/http-utils.ts","lineNumber":105,"sourceCode":" * `TAR_ENTRY_ERROR` is not only the path-rejection code — measured, tar reports\n * per-entry write failures through it too (a read-only target raises it once per\n * entry, same as a `..` name does). Both belong on this side of the split: a\n * half-extracted install is a real failure, and escalating it is what the opt-in\n * `exit` setting asks for. Everything else is logged and ignored, as tar treats\n * it.\n */\nconst tarOptions = {\n  preserveOwner: false,\n  onwarn: (code: string, message: string) => {\n    const warning = `tar skipped an entry while extracting (${code}): ${message}`;\n\n    if (code === 'TAR_ENTRY_ERROR') {\n      internalExceptions(new Error(warning));\n\n      return;\n    }\n\n    console.warn(warning);\n  },\n};\n\n/**\n * Extract a downloaded archive into `cwd`, which is created if missing.\n *\n * Dispatches on magic bytes, not the filename, because there is no filename to\n * dispatch on: `streamWithProgress` saves downloads as\n * `crypto.randomBytes(16).toString('hex')`, with no extension.\n *\n * Handles gzip (`.tar.gz` / `.tgz`), uncompressed tar and zip. Two gaps are\n * deliberate and both throw a named error rather than failing obscurely: bzip2,\n * and pre-POSIX v7 tars, which carry no `ustar` magic at offset 257 to detect them\n * by.\n *\n * Neither backend writes outside `cwd`: `tar` strips a leading `/` on extraction and\n * drops entries containing `..`, and `extract-zip` rejects entries that resolve outside\n * the target.","sourceCodeStart":87,"sourceCodeEnd":123,"githubUrl":"https://github.com/cube-js/cube/blob/7d981676b36392fec34088b9afab6bdcad40207c/packages/cubejs-backend-shared/src/http-utils.ts#L87-L123","documentation":"When Cube extracts a downloaded archive (e.g. a driver/native binary via tar), non-fatal tar warnings are logged here with the format 'tar skipped an entry while extracting (<code>): <message>'. TAR_ENTRY_ERROR codes are escalated to internal exceptions; other codes are just printed.","triggerScenarios":"A tar warning callback fires during extractTar with a code other than TAR_ENTRY_ERROR, e.g. a skipped entry, unsupported file type, or duplicate entry while unpacking a downloaded artifact.","commonSituations":"Corrupted or partially downloaded archives; filesystems not supporting certain entries (symlinks, special files); permissions issues causing entries to be skipped.","solutions":["Check the logged <code>/<message> to see which entry was skipped and why","Re-download or clear the cached archive so it is extracted fresh","Check disk space and permissions on the target directory","If functionality breaks because of the skipped entry, report it — otherwise this warning can be ignored"],"exampleFix":null,"handlingStrategy":"retry","validationCode":"// after download, before extract\nconst stat = fs.statSync(archivePath);\nif (stat.size === 0) throw new Error('Downloaded archive is empty; re-download');","typeGuard":null,"tryCatchPattern":"try {\n  extractTar(archive, { cwd: targetDir });\n} catch (e) {\n  // e.g. TAR_ENTRY_ERROR surfaced as internal exception\n  console.error('Extraction failed:', e);\n  fs.rmSync(targetDir, { recursive: true, force: true });\n  // retry with a fresh download\n}","preventionTips":["Verify checksums/sizes of downloaded archives","Ensure target filesystem supports all entry types","Retry extraction once on failure with a clean directory"],"tags":["filesystem","tar","extraction","download"],"backgroundTag":"archive-extraction-skipped-entry","analyzedSha":"7d981676b36392fec34088b9afab6bdcad40207c","analyzedAt":"2026-09-02T03:45:10.400Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T15:18:49.778Z"}