{"record":{"id":"19658307f82bbf43","repo":"can1357/oh-my-pi","slug":"rpm-package-identity-has-an-invalid-uncompres","errorCode":null,"errorMessage":"RPM package '${identity}' has an invalid uncompressed CPIO payload","messagePattern":"RPM package '(.+?)' has an invalid uncompressed CPIO payload","errorType":"validation","errorClass":"ArchiveError","httpStatus":null,"severity":"error","filePath":"packages/utils/src/ar/rpm.ts","lineNumber":238,"sourceCode":"\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\":\n\t\t\tif (!sniffLzmaAlone(payload)) throw new ArchiveError(`RPM package '${identity}' has a malformed LZMA payload`);\n\t\t\treturn lzmaAloneDecompress(payload, maxOutput);\n\t\tcase \"none\":\n\t\t\tif (!sniffCpio(payload))\n\t\t\t\tthrow new ArchiveError(`RPM package '${identity}' has an invalid uncompressed CPIO payload`);\n\t\t\treturn payload;\n\t\tdefault:\n\t\t\tthrow new ArchiveError(`RPM package '${identity}' uses unsupported payload compressor '${method}'`);\n\t}\n}\n\nasync function readRpmArchive(source: ByteSource, options: FormatReadOptions): Promise<ArchiveIndexEntry[]> {\n\tconst initial = await readExact(source, 0, RPM_LEAD_SIZE + RPM_HEADER_INTRO_SIZE, \"lead and signature header\");\n\tif (!sniffRpm(initial)) throw new ArchiveError(\"Invalid RPM package: bad lead magic\");\n\tconst major = initial[4]!;\n\tconst packageType = (initial[6]! << 8) | initial[7]!;\n\tif (major < 3 || packageType > 1) throw new ArchiveError(\"Unsupported RPM package lead version or type\");\n\tconst signatureType = (initial[78]! << 8) | initial[79]!;\n\tif (signatureType !== RPM_SIGNATURE_TYPE_HEADER) {\n\t\tthrow new ArchiveError(`Unsupported RPM signature type ${signatureType}; only header signatures are supported`);\n\t}\n\tconst leadNameEnd = initial.subarray(10, 76).indexOf(0);\n\tconst leadNameBytes = initial.subarray(10, leadNameEnd < 0 ? 76 : 10 + leadNameEnd);","sourceCodeStart":220,"sourceCodeEnd":256,"githubUrl":"https://github.com/can1357/oh-my-pi/blob/969062200754ea02cfac922e5ebb8c608c079e15/packages/utils/src/ar/rpm.ts#L220-L256","documentation":"The payload was classified as uncompressed ('none'), but sniffCpio does not recognize the bytes as a CPIO archive (newc/old ascii-style magic), so the reader rejects them instead of returning a bogus entry list. An RPM with method 'none' must contain a raw CPIO payload.","triggerScenarios":"decompressPayload hits case \"none\" and sniffCpio(payload) returns false — i.e. the payload lacks the CPIO magic ('070701'/'070707') despite the compression sniff concluding 'none'.","commonSituations":"Packages produced by custom build tooling that wrote a non-CPIO payload without compression, corrupted files where payload bytes were altered, or payloads in cpio variants this sniffer does not recognize.","solutions":["Rebuild the RPM so its uncompressed payload is a valid CPIO archive (rpmbuild uses cpio internally; avoid hand-rolled payload writers).","Check the payload magic bytes with a hexdump to identify the actual format.","Extract with rpm2cpio | cpio as a fallback and confirm the package itself is valid.","Re-download and checksum-verify — corruption can also scramble a valid CPIO payload."],"exampleFix":null,"handlingStrategy":"validation","validationCode":"async function startsWithCpioMagic(path: string, payloadOffset: number): Promise<boolean> {\n  const b = new Uint8Array(await Bun.file(path).slice(payloadOffset, payloadOffset + 6).arrayBuffer());\n  const s = new TextDecoder().decode(b);\n  return s.startsWith('070701') || s.startsWith('070707');\n}","typeGuard":"function looksLikeCpio(head: Uint8Array): boolean {\n  const ascii = String.fromCharCode(...head.slice(0, 6));\n  return ascii === '070701' || ascii === '070707';\n}","tryCatchPattern":"try {\n  return await readRpm(path);\n} catch (err) {\n  if (err instanceof ArchiveError && err.message.includes('invalid uncompressed CPIO payload')) {\n    throw new Error('RPM payload is neither compressed nor a valid CPIO archive — package corrupt');\n  }\n  throw err;\n}","preventionTips":["Only feed packages produced by rpmbuild or equivalent trusted tooling.","Checksum-verify files before parsing; payload corruption triggers this error.","Avoid hand-rolled RPM writers that emit non-CPIO uncompressed payloads."],"tags":["rpm","cpio","archive","malformed-payload"],"backgroundTag":"malformed-compression-payload","analyzedSha":"969062200754ea02cfac922e5ebb8c608c079e15","analyzedAt":"2026-08-31T10:29:35.737Z","schemaVersion":2},"datasetVersion":"2026-08-31T14:17:45.589Z"}