{"record":{"id":"472cc528873d25d5","repo":"can1357/oh-my-pi","slug":"arj-member-memberpath-failed-crc32-verificati","errorCode":null,"errorMessage":"ARJ member '${memberPath}' failed CRC32 verification","messagePattern":"ARJ member '(.+?)' failed CRC32 verification","errorType":"exception","errorClass":"ArchiveError","httpStatus":null,"severity":"error","filePath":"packages/utils/src/ar/arj.ts","lineNumber":203,"sourceCode":"\t\t\t\toutput = decompressLhStatic(packed, size, 26_624, 5, 17, `ARJ method ${this.#method}`);\n\t\t\t\tbreak;\n\t\t\tcase 4:\n\t\t\t\toutput = decompressArjMethod4(packed, size);\n\t\t\t\tbreak;\n\t\t\tcase 8:\n\t\t\tcase 9:\n\t\t\t\tif (size !== 0 || packed.byteLength !== 0) {\n\t\t\t\t\tthrow new ArchiveError(`ARJ member '${memberPath}' has invalid no-data method sizes`);\n\t\t\t\t}\n\t\t\t\toutput = new Uint8Array(0);\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\tthrow new ArchiveError(`ARJ member '${memberPath}' uses unsupported compression method ${this.#method}`);\n\t\t}\n\t\tif (output.byteLength !== size)\n\t\t\tthrow new ArchiveError(`ARJ member '${memberPath}' extracted to an unexpected size`);\n\t\tif (this.#method !== 8 && crc32(output) !== this.#crc) {\n\t\t\tthrow new ArchiveError(`ARJ member '${memberPath}' failed CRC32 verification`);\n\t\t}\n\t\treturn output;\n\t}\n}\n\nfunction normalizeHostPath(rawPath: string, hostOs: number): string {\n\tlet path = rawPath.replaceAll(\"\\\\\", \"/\");\n\tif (hostOs === 1) path = path.replaceAll(\">\", \"/\");\n\telse if (hostOs === 4) path = path.replaceAll(\":\", \"/\");\n\treturn path;\n}\n\n/** Probe whether bytes begin with a CRC-framed ARJ main header. */\nexport function sniffArj(bytes: Uint8Array): boolean {\n\tif (bytes.byteLength < 34 || bytes[0] !== ARJ_SIGNATURE_0 || bytes[1] !== ARJ_SIGNATURE_1) return false;\n\tconst size = u16(bytes, 2);\n\tif (size < 30 || size > ARJ_MAX_BASIC_HEADER || bytes.byteLength < size + 8) return false;\n\tconst body = bytes.subarray(4, 4 + size);","sourceCodeStart":185,"sourceCodeEnd":221,"githubUrl":"https://github.com/can1357/oh-my-pi/blob/969062200754ea02cfac922e5ebb8c608c079e15/packages/utils/src/ar/arj.ts#L185-L221","documentation":"This ArchiveError is thrown when the CRC32 of the decompressed member data does not match the CRC stored in the member's local header. Method-8 members are exempt (no data). This is the library's end-to-end integrity check: the bytes decoded successfully but are not the bytes that were archived.","triggerScenarios":"Calling member.read(size, memberPath) on any member with data (methods 0–4) where crc32(output) !== the header CRC — i.e. corrupted stored data or a faulty/buggy decompression path.","commonSituations":"Silent disk corruption, incomplete downloads, transmission errors, archives modified after creation, or hardware faults (bad RAM) flipping bits during decompression.","solutions":["Obtain a fresh copy of the archive — CRC failure almost always means the data is damaged.","Verify with the official arj tool (arj t) to confirm which members are bad.","If only one member fails, extract other members and re-acquire the damaged file from its original source.","Re-create the archive from known-good source files.","If failures are reproducible across machines on the same archive, suspect the producing tool rather than your hardware."],"exampleFix":"// before\nconst data = await member.read(member.size, member.path);\nprocess(data);\n// after\ntry {\n  const data = await member.read(member.size, member.path);\n  process(data);\n} catch (e) {\n  if (e instanceof ArchiveError && e.message.includes('CRC32')) {\n    throw new Error(`member ${member.path} is corrupt (CRC mismatch); re-download the archive`);\n  }\n  throw e;\n}","handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"try {\n  const data = await member.read(size, path);\n} catch (e) {\n  if (e instanceof ArchiveError && e.message.includes('CRC32')) {\n    throw new Error(`member ${path} failed integrity check; re-download the archive`);\n  }\n  throw e;\n}","preventionTips":["Always treat CRC failures as data corruption, never retry the same bytes","Verify archives with the official tool before processing","Keep checksums of source archives to detect bad transfers","Avoid reading archives over unreliable network mounts; copy locally first"],"tags":["archive","crc","integrity","corruption","arj"],"backgroundTag":"checksum-mismatch","analyzedSha":"969062200754ea02cfac922e5ebb8c608c079e15","analyzedAt":"2026-08-31T10:29:35.737Z","schemaVersion":2},"datasetVersion":"2026-08-31T14:17:45.589Z"}