can1357/oh-my-pi · error · ArchiveError

RPM package '${identity}' uses unsupported payload compresso

Error message

RPM package '${identity}' uses unsupported payload compressor '${metadata.payloadCompressor ?? "unknown"}'

What it means

decompressPayload sniffs the payload's magic bytes (gzip, bzip2, xz, zstd, lzma-alone, raw cpio) and throws when none match, meaning the RPM payload uses a compression format this library does not support. The message reports the declared compressor tag (PayloadCompressor) or 'unknown' when the header lacked it.

Source

Thrown at packages/utils/src/ar/rpm.ts:215

}

async function decompressPayload(
	payload: Uint8Array,
	metadata: RpmMetadata,
	identity: string,
	maxOutput: number,
): Promise<Uint8Array> {
	const compressor = metadata.payloadCompressor?.trim().toLowerCase();
	let method = compressor;
	if (!method || !["gzip", "gz", "bzip2", "bzip", "xz", "lzma", "zstd", "zstdio", "none"].includes(method)) {
		if (isGzip(payload)) method = "gzip";
		else if (isBzip2(payload)) method = "bzip2";
		else if (isXz(payload)) method = "xz";
		else if (isZstd(payload)) method = "zstd";
		else if (sniffLzmaAlone(payload)) method = "lzma";
		else if (sniffCpio(payload)) method = "none";
		else {
			throw new ArchiveError(
				`RPM package '${identity}' uses unsupported payload compressor '${metadata.payloadCompressor ?? "unknown"}'`,
			);
		}
	}

	switch (method) {
		case "gzip":
		case "gz":
			return gzipDecompress(payload, maxOutput);
		case "bzip2":
		case "bzip":
			return bzip2Decompress(payload, maxOutput);
		case "xz":
			return xzDecompress(payload, maxOutput);
		case "zstd":
		case "zstdio":
			return zstdDecompress(payload, maxOutput);
		case "lzma":

View on GitHub (pinned to 9690622007)

Solutions

  1. Check the declared compressor: rpm -qp --qf '%{PAYLOADCOMPRESSOR}\n' <file>.rpm; if it is zck or another unsupported format, use rpm2archive/rpm2cpio to convert the package to a supported form first.
  2. Recompress/rebuild the RPM with a supported compressor (e.g. --define '%_binary_payload w.ufdio' with gzip/xz payload).
  3. If the header claims a compressor the payload does not match, the package is corrupt — re-download it.
  4. Extract with system tools (rpm2cpio <f>.rpm | cpio -idmv) if you only need the contents.

Example fix

// before
const entries = await readArchive(rpmBuffer);
// after: pre-check declared compressor and convert unsupported ones
const comp = rpmMetadata.payloadCompressor;
if (comp === 'zck') rpmBuffer = await convertWithRpm2archive(rpmFile); // then readArchive
Defensive patterns

Strategy: fallback

Validate before calling

import { readUInt32BE } from './bytes';
// quick sniff of payload region is internal; pre-check declared compressor via metadata first
const meta = await metadata(rpmPath);
if (meta.payloadCompressor && !['gzip','bzip2','xz','zstd','zstdio','lzma','none'].includes(meta.payloadCompressor)) {
  // convert with system rpm2archive/rpm2cpio before reading
}

Try / catch

try {
  return await readRpm(path);
} catch (err) {
  if (err instanceof ArchiveError && err.message.includes('unsupported payload compressor')) {
    return await readConvertedViaRpm2cpio(path); // external fallback extraction
  }
  throw err;
}

Prevention

When it happens

Trigger: Reading an RPM whose payload magic bytes match none of the supported sniffers; raised from the metadata/read path via cpio when the sniff chain (isGzip/isBzip2/isXz/isZstd/sniffLzmaAlone/sniffCpio) all fail.

Common situations: Modern RPMs compressed with zchunk ('zck') or other exotic compressors, delta/drpm files, packages with declared compressor differing from actual payload, or payloads produced by non-rpm tooling.

Related errors


AI-assisted analysis of can1357/oh-my-pi@9690622007 (2026-08-31). Data as JSON: /api/errors/81fe5ad231b78b7b. Report an issue: GitHub.