{"record":{"id":"7c018a1f3db8e139","repo":"can1357/oh-my-pi","slug":"unsupported-multi-volume-rar4-member","errorCode":null,"errorMessage":"Unsupported multi-volume RAR4 member","messagePattern":"Unsupported multi-volume RAR4 member","errorType":"exception","errorClass":"ArchiveError","httpStatus":null,"severity":"error","filePath":"packages/utils/src/ar/rar.ts","lineNumber":507,"sourceCode":"\t\t\tconst dosTime = readUInt32LE(bytes, cursor);\n\t\t\tcursor += 4;\n\t\t\tconst version = bytes[cursor++]!;\n\t\t\tconst methodByte = bytes[cursor++]!;\n\t\t\tconst nameSize = readUInt16LE(bytes, cursor);\n\t\t\tcursor += 2;\n\t\t\tconst attributes = readUInt32LE(bytes, cursor);\n\t\t\tcursor += 4;\n\t\t\tlet packedSize = dataSize;\n\t\t\tlet unpackedSize = unpackedLow;\n\t\t\tif ((flags & 0x100) !== 0) {\n\t\t\t\tneed(cursor, 8, headerEnd, \"RAR4 high sizes\");\n\t\t\t\tpackedSize += readUInt32LE(bytes, cursor) * 0x100000000;\n\t\t\t\tcursor += 4;\n\t\t\t\tunpackedSize += readUInt32LE(bytes, cursor) * 0x100000000;\n\t\t\t\tcursor += 4;\n\t\t\t\tdataEnd = checkedEnd(dataStart, packedSize, bytes.byteLength, \"RAR4 file data\");\n\t\t\t}\n\t\t\tif ((flags & 3) !== 0) throw new ArchiveError(\"Unsupported multi-volume RAR4 member\");\n\t\t\tif ((flags & 4) !== 0) throw new ArchiveError(\"Encrypted RAR4 file data is not supported\");\n\t\t\tif (methodByte < 0x30 || methodByte > 0x35)\n\t\t\t\tthrow new ArchiveError(`Unsupported RAR4 compression method 0x${methodByte.toString(16)}`);\n\t\t\tassertArchivePathBytes(nameSize, \"member path\", options.limits.maxPathBytes);\n\t\t\tneed(cursor, nameSize, headerEnd, \"RAR4 file name\");\n\t\t\tconst nameBytes = bytes.subarray(cursor, cursor + nameSize);\n\t\t\tconst rawPath = (flags & 0x200) !== 0 ? decodeRar4UnicodeName(nameBytes) : LATIN1.decode(nameBytes);\n\t\t\tcursor += nameSize;\n\t\t\tif ((flags & 0x400) !== 0) {\n\t\t\t\tneed(cursor, 8, headerEnd, \"RAR4 salt\");\n\t\t\t\tcursor += 8;\n\t\t\t}\n\t\t\tlet mtimeMs = dosTimeMs(dosTime);\n\t\t\tif ((flags & 0x1000) !== 0) {\n\t\t\t\tneed(cursor, 2, headerEnd, \"RAR4 extended time flags\");\n\t\t\t\tconst timeFlags = readUInt16LE(bytes, cursor);\n\t\t\t\tcursor += 2;\n\t\t\t\tfor (let timeIndex = 0; timeIndex < 4; timeIndex++) {","sourceCodeStart":489,"sourceCodeEnd":525,"githubUrl":"https://github.com/can1357/oh-my-pi/blob/969062200754ea02cfac922e5ebb8c608c079e15/packages/utils/src/ar/rar.ts#L489-L525","documentation":"For RAR4 file headers (type 0x74), flag bits 0 and 1 mark a member as continued from the previous volume / continued in the next volume. Such a member's data is split across volume files, which this parser cannot assemble, so it throws ArchiveError. This is the per-member variant of multi-volume rejection.","triggerScenarios":"Calling records() on any volume of a split RAR4 set — members with the split flags trigger this even if the main-header volume flag check passed (e.g. hand-edited or partial sets).","commonSituations":"Reading volume .part2/.r00 files directly; archives split after creation with a splitter that corrupted header flags; legacy multi-disk archives.","solutions":["Merge/extract the full volume set with unrar or 7-Zip and consume the resulting single files.","Re-create the archive as one volume without -v.","Repackage as zip/tar before parsing.","Catch ArchiveError to detect split members and request all volumes."],"exampleFix":"// before\nawait records(Bun.file(\"data.r00\")) // member split across volumes\n// after: extract full set first\n$`unrar x -y data.part1.rar out/`","handlingStrategy":"try-catch","validationCode":"import { readdirSync } from \"node:fs\";\nconst parts = readdirSync(dir).filter(f => /\\.rar$|\\.r\\d{2}$|\\.part\\d+\\.rar$/i.test(f));\nif (parts.length > 1) throw new Error(\"volume set — merge before parsing\");","typeGuard":null,"tryCatchPattern":"try {\n  const recs = await records(file);\n} catch (err) {\n  if (err instanceof ArchiveError && err.message.includes(\"multi-volume RAR4 member\")) {\n    // merge volumes externally, re-run parse on merged output\n  } else throw err;\n}","preventionTips":["Never feed individual volumes (.r00, .part2.rar) to the parser.","Extract full sets with unrar before ingestion.","Prefer re-creating large data as single archives or non-split formats.","Validate archives with `unrar t` upstream."],"tags":["archive","rar4","multi-volume","split-member"],"backgroundTag":"multi-volume-archive-unsupported","analyzedSha":"969062200754ea02cfac922e5ebb8c608c079e15","analyzedAt":"2026-08-31T10:29:35.737Z","schemaVersion":2},"datasetVersion":"2026-08-31T14:17:45.589Z"}