{"record":{"id":"049b9599ece3d1db","repo":"can1357/oh-my-pi","slug":"unsupported-deb-tar-compression-in-outerentry-p","errorCode":null,"errorMessage":"Unsupported deb tar compression in '${outerEntry.path}'","messagePattern":"Unsupported deb tar compression in '(.+?)'","errorType":"exception","errorClass":"ArchiveError","httpStatus":null,"severity":"error","filePath":"packages/utils/src/ar/deb.ts","lineNumber":131,"sourceCode":"\tconst probeEnd = Math.min(source.size, AR_SIGNATURE.length + AR_HEADER_SIZE + options.limits.maxPathBytes);\n\tlet probe: Uint8Array;\n\ttry {\n\t\tprobe = await source.read(0, probeEnd);\n\t} catch (error) {\n\t\tthrow new ArchiveError(error instanceof Error ? error.message : String(error));\n\t}\n\tif (!sniffDeb(probe)) throw new ArchiveError(\"Invalid deb archive: first member is not debian-binary\");\n\n\tconst outerEntries = await readUnixAr(source, options);\n\tif (outerEntries[0]?.path !== DEBIAN_BINARY) {\n\t\tthrow new ArchiveError(\"Invalid deb archive: first member is not debian-binary\");\n\t}\n\tconst result = new Map<string, ArchiveIndexEntry>();\n\tfor (const outerEntry of outerEntries) {\n\t\tconst tar = classifyTarMember(outerEntry.path);\n\t\tif (!tar) {\n\t\t\tif (outerEntry.path.startsWith(\"control.tar.\") || outerEntry.path.startsWith(\"data.tar.\")) {\n\t\t\t\tthrow new ArchiveError(`Unsupported deb tar compression in '${outerEntry.path}'`);\n\t\t\t}\n\t\t\tupsertArchiveEntry(result, outerEntry);\n\t\t\tcontinue;\n\t\t}\n\t\tconst compressed = await readOuterMember(outerEntry);\n\t\tconst tarBytes = await decompressDebTar(compressed, tar.compression, options);\n\t\tconst innerEntries = readTarEntriesFromBuffer(tarBytes, options);\n\t\tfor (const innerEntry of innerEntries) {\n\t\t\tupsertArchiveEntry(result, tar.kind === \"control\" ? prefixControlEntry(innerEntry) : innerEntry);\n\t\t}\n\t}\n\tensureParentDirectories(result, options.limits);\n\treturn [...result.values()];\n}\n\n/** Read a Debian binary package and expose its control and data tar members. */\nexport const readDeb: FormatReader = async (source, options) => {\n\ttry {","sourceCodeStart":113,"sourceCodeEnd":149,"githubUrl":"https://github.com/can1357/oh-my-pi/blob/969062200754ea02cfac922e5ebb8c608c079e15/packages/utils/src/ar/deb.ts#L113-L149","documentation":"While indexing a Debian .deb package, the reader found an ar member whose name starts with 'control.tar.' or 'data.tar.' but whose compression suffix is not one the library supports (.tar, .gz, .xz, .zst, .bz2, .lzma per classifyTarMember). Debian packages must ship their control/data archives in a recognized compression; anything else cannot be decompressed, so the library fails fast instead of silently skipping the package payload.","triggerScenarios":"Calling readDeb (or the archive index/entry APIs that route through it) on a .deb whose data.tar or control.tar member uses an unrecognized compression suffix — e.g. data.tar.lz4, data.tar.zck, control.tar.br, or a typo like data.tar.gzip. classifyTarMember returns undefined for these, and because the name still looks like a deb tar member, the explicit 'Unsupported deb tar compression' throw fires.","commonSituations":"Packages built with newer or exotic compressors (zstd-chunked/lz4 from some build tools, brotli), hand-repacked .deb files where the member was renamed, or very old/nonstandard tooling that emitted unusual suffixes. Also triggered by corrupt packages where the member name was truncated or mangled.","solutions":["Rebuild the .deb with a supported compression (gzip, xz, zstd, bzip2, lzma, or plain tar), e.g. dpkg-deb -Zxz -b pkg/ out.deb","Inspect the ar member list (ar t pkg.deb) to confirm the exact suffix on control.tar.*/data.tar.*","Convert the member in place: extract, decompress with the appropriate tool (lz4/zstd --ultra -d/etc.), and repack with a supported compressor","If you only need metadata, extract control.tar.* manually instead of routing through the archive reader"],"exampleFix":"// before (package built with unsupported compressor)\n$ dpkg-deb -Zlz4 -b pkg/ out.deb   # produces data.tar.lz4 -> ArchiveError\n// after\n$ dpkg-deb -Zxz -b pkg/ out.deb    # data.tar.xz is supported","handlingStrategy":"validation","validationCode":"import { readArIndex } from '.../ar';\nconst members = await listArMembers(pkgPath); // ar member names\nconst bad = members.filter(n => /^(control|data)\\.tar\\./.test(n) && !/^(control|data)\\.tar(\\.(gz|xz|zst|bz2|lzma))?$/.test(n));\nif (bad.length) throw new Error(`Unsupported deb tar compression: ${bad.join(', ')}`);","typeGuard":"function hasSupportedDebCompression(memberName) {\n  return /^(control|data)\\.tar(\\.(gz|xz|zst|bz2|lzma))?$/.test(memberName);\n}","tryCatchPattern":"try {\n  entries = await readDeb(source);\n} catch (err) {\n  if (err instanceof ArchiveError && err.message.includes('Unsupported deb tar compression')) {\n    // fall back to external dpkg-deb/ar tooling or reject the package\n  } else throw err;\n}","preventionTips":["Build .debs only with supported compressors (dpkg-deb -Z gzip|xz|zst|bzip2|lzma|none)","List ar members (ar t pkg.deb) before processing third-party packages","Reject unusual suffixes (.lz4, .zck, .br) in your ingestion pipeline"],"tags":["deb","archive","unsupported-compression"],"backgroundTag":"unsupported-archive-compression","analyzedSha":"969062200754ea02cfac922e5ebb8c608c079e15","analyzedAt":"2026-08-31T10:29:35.737Z","schemaVersion":2},"datasetVersion":"2026-08-31T14:17:45.589Z"}