can1357/oh-my-pi · error · ArchiveError
Unsupported deb tar compression in '${outerEntry.path}'
Error message
Unsupported deb tar compression in '${outerEntry.path}' What it means
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.
Source
Thrown at packages/utils/src/ar/deb.ts:131
const probeEnd = Math.min(source.size, AR_SIGNATURE.length + AR_HEADER_SIZE + options.limits.maxPathBytes);
let probe: Uint8Array;
try {
probe = await source.read(0, probeEnd);
} catch (error) {
throw new ArchiveError(error instanceof Error ? error.message : String(error));
}
if (!sniffDeb(probe)) throw new ArchiveError("Invalid deb archive: first member is not debian-binary");
const outerEntries = await readUnixAr(source, options);
if (outerEntries[0]?.path !== DEBIAN_BINARY) {
throw new ArchiveError("Invalid deb archive: first member is not debian-binary");
}
const result = new Map<string, ArchiveIndexEntry>();
for (const outerEntry of outerEntries) {
const tar = classifyTarMember(outerEntry.path);
if (!tar) {
if (outerEntry.path.startsWith("control.tar.") || outerEntry.path.startsWith("data.tar.")) {
throw new ArchiveError(`Unsupported deb tar compression in '${outerEntry.path}'`);
}
upsertArchiveEntry(result, outerEntry);
continue;
}
const compressed = await readOuterMember(outerEntry);
const tarBytes = await decompressDebTar(compressed, tar.compression, options);
const innerEntries = readTarEntriesFromBuffer(tarBytes, options);
for (const innerEntry of innerEntries) {
upsertArchiveEntry(result, tar.kind === "control" ? prefixControlEntry(innerEntry) : innerEntry);
}
}
ensureParentDirectories(result, options.limits);
return [...result.values()];
}
/** Read a Debian binary package and expose its control and data tar members. */
export const readDeb: FormatReader = async (source, options) => {
try {View on GitHub (pinned to 9690622007)
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
Example fix
// before (package built with unsupported compressor) $ dpkg-deb -Zlz4 -b pkg/ out.deb # produces data.tar.lz4 -> ArchiveError // after $ dpkg-deb -Zxz -b pkg/ out.deb # data.tar.xz is supported
Defensive patterns
Strategy: validation
Validate before calling
import { readArIndex } from '.../ar';
const members = await listArMembers(pkgPath); // ar member names
const bad = members.filter(n => /^(control|data)\.tar\./.test(n) && !/^(control|data)\.tar(\.(gz|xz|zst|bz2|lzma))?$/.test(n));
if (bad.length) throw new Error(`Unsupported deb tar compression: ${bad.join(', ')}`); Type guard
function hasSupportedDebCompression(memberName) {
return /^(control|data)\.tar(\.(gz|xz|zst|bz2|lzma))?$/.test(memberName);
} Try / catch
try {
entries = await readDeb(source);
} catch (err) {
if (err instanceof ArchiveError && err.message.includes('Unsupported deb tar compression')) {
// fall back to external dpkg-deb/ar tooling or reject the package
} else throw err;
} Prevention
- 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
When it happens
Trigger: 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.
Common situations: 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.
Related errors
- LZH member '${memberPath}' uses unsupported dynamic-Huffman
- LZH member '${memberPath}' uses unsupported compression meth
- Unsupported RAR4 PPMd compressed block
- archive destination exists: ${destSession}
- archive destination exists: ${legacyDestSession}
AI-assisted analysis of can1357/oh-my-pi@9690622007 (2026-08-31).
Data as JSON: /api/errors/049b9599ece3d1db.
Report an issue: GitHub.