{"record":{"id":"81fe5ad231b78b7b","repo":"can1357/oh-my-pi","slug":"rpm-package-identity-uses-unsupported-payload","errorCode":null,"errorMessage":"RPM package '${identity}' uses unsupported payload compressor '${metadata.payloadCompressor ?? \"unknown\"}'","messagePattern":"RPM package '(.+?)' uses unsupported payload compressor '(.+?)'","errorType":"validation","errorClass":"ArchiveError","httpStatus":null,"severity":"error","filePath":"packages/utils/src/ar/rpm.ts","lineNumber":215,"sourceCode":"}\n\nasync function decompressPayload(\n\tpayload: Uint8Array,\n\tmetadata: RpmMetadata,\n\tidentity: string,\n\tmaxOutput: number,\n): Promise<Uint8Array> {\n\tconst compressor = metadata.payloadCompressor?.trim().toLowerCase();\n\tlet method = compressor;\n\tif (!method || ![\"gzip\", \"gz\", \"bzip2\", \"bzip\", \"xz\", \"lzma\", \"zstd\", \"zstdio\", \"none\"].includes(method)) {\n\t\tif (isGzip(payload)) method = \"gzip\";\n\t\telse if (isBzip2(payload)) method = \"bzip2\";\n\t\telse if (isXz(payload)) method = \"xz\";\n\t\telse if (isZstd(payload)) method = \"zstd\";\n\t\telse if (sniffLzmaAlone(payload)) method = \"lzma\";\n\t\telse if (sniffCpio(payload)) method = \"none\";\n\t\telse {\n\t\t\tthrow new ArchiveError(\n\t\t\t\t`RPM package '${identity}' uses unsupported payload compressor '${metadata.payloadCompressor ?? \"unknown\"}'`,\n\t\t\t);\n\t\t}\n\t}\n\n\tswitch (method) {\n\t\tcase \"gzip\":\n\t\tcase \"gz\":\n\t\t\treturn gzipDecompress(payload, maxOutput);\n\t\tcase \"bzip2\":\n\t\tcase \"bzip\":\n\t\t\treturn bzip2Decompress(payload, maxOutput);\n\t\tcase \"xz\":\n\t\t\treturn xzDecompress(payload, maxOutput);\n\t\tcase \"zstd\":\n\t\tcase \"zstdio\":\n\t\t\treturn zstdDecompress(payload, maxOutput);\n\t\tcase \"lzma\":","sourceCodeStart":197,"sourceCodeEnd":233,"githubUrl":"https://github.com/can1357/oh-my-pi/blob/969062200754ea02cfac922e5ebb8c608c079e15/packages/utils/src/ar/rpm.ts#L197-L233","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","solutions":["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.","Recompress/rebuild the RPM with a supported compressor (e.g. --define '%_binary_payload w.ufdio' with gzip/xz payload).","If the header claims a compressor the payload does not match, the package is corrupt — re-download it.","Extract with system tools (rpm2cpio <f>.rpm | cpio -idmv) if you only need the contents."],"exampleFix":"// before\nconst entries = await readArchive(rpmBuffer);\n// after: pre-check declared compressor and convert unsupported ones\nconst comp = rpmMetadata.payloadCompressor;\nif (comp === 'zck') rpmBuffer = await convertWithRpm2archive(rpmFile); // then readArchive","handlingStrategy":"fallback","validationCode":"import { readUInt32BE } from './bytes';\n// quick sniff of payload region is internal; pre-check declared compressor via metadata first\nconst meta = await metadata(rpmPath);\nif (meta.payloadCompressor && !['gzip','bzip2','xz','zstd','zstdio','lzma','none'].includes(meta.payloadCompressor)) {\n  // convert with system rpm2archive/rpm2cpio before reading\n}","typeGuard":null,"tryCatchPattern":"try {\n  return await readRpm(path);\n} catch (err) {\n  if (err instanceof ArchiveError && err.message.includes('unsupported payload compressor')) {\n    return await readConvertedViaRpm2cpio(path); // external fallback extraction\n  }\n  throw err;\n}","preventionTips":["Prefer packages built with gzip/xz/zstd payloads in your repositories.","Detect zchunk-compressed RPMs early and route them to rpm2archive conversion.","Keep declared compressor and actual payload in sync when generating packages."],"tags":["rpm","compression","unsupported-codec","archive"],"backgroundTag":"unsupported-compression-format","analyzedSha":"969062200754ea02cfac922e5ebb8c608c079e15","analyzedAt":"2026-08-31T10:29:35.737Z","schemaVersion":2},"datasetVersion":"2026-08-31T14:17:45.589Z"}