{"record":{"id":"ccdf32642fc6f432","repo":"can1357/oh-my-pi","slug":"unsupported-compressed-rar4-symlink-path","errorCode":null,"errorMessage":"Unsupported compressed RAR4 symlink '${path}'","messagePattern":"Unsupported compressed RAR4 symlink '(.+?)'","errorType":"exception","errorClass":"ArchiveError","httpStatus":null,"severity":"error","filePath":"packages/utils/src/ar/rar.ts","lineNumber":554,"sourceCode":"\t\t\t\t\tconst count = mode & 3;\n\t\t\t\t\tneed(cursor, count, headerEnd, \"RAR4 extended time precision\");\n\t\t\t\t\tfor (let index = 0; index < count; index++) {\n\t\t\t\t\t\tremainder |= bytes[cursor++]! << ((index + 3 - count) * 8);\n\t\t\t\t\t}\n\t\t\t\t\tpreciseMs += remainder / 10000;\n\t\t\t\t\tif (timeIndex === 0) mtimeMs = preciseMs;\n\t\t\t\t}\n\t\t\t}\n\t\t\tassertArchiveMemberSize(unpackedSize, rawPath, options.limits);\n\t\t\tconst path = normalizeArchiveEntryPath(rawPath);\n\t\t\tif (path) {\n\t\t\t\tconst directory = ((flags >>> 5) & 7) === 7;\n\t\t\t\tconst mode = hostOs === 3 ? attributes : undefined;\n\t\t\t\tlet linkTarget: string | undefined;\n\t\t\t\tlet linkResolveTarget: boolean | undefined;\n\t\t\t\tif (mode !== undefined && (mode & 0xf000) === 0xa000) {\n\t\t\t\t\tif (methodByte !== 0x30 || packedSize !== unpackedSize)\n\t\t\t\t\t\tthrow new ArchiveError(`Unsupported compressed RAR4 symlink '${path}'`);\n\t\t\t\t\tassertArchivePathBytes(packedSize, \"link target\", options.limits.maxPathBytes);\n\t\t\t\t\tconst canonical = canonicalLinkTarget(path, LATIN1.decode(bytes.subarray(dataStart, dataEnd)));\n\t\t\t\t\tlinkTarget = canonical.target;\n\t\t\t\t\tlinkResolveTarget = canonical.resolveTarget;\n\t\t\t\t}\n\t\t\t\trecords.push({\n\t\t\t\t\tformat: 4,\n\t\t\t\t\tpath,\n\t\t\t\t\tdataStart,\n\t\t\t\t\tpackedSize,\n\t\t\t\t\tunpackedSize,\n\t\t\t\t\tmethod: methodByte - 0x30,\n\t\t\t\t\tversion,\n\t\t\t\t\tdictionarySize: rar4Dictionary(flags),\n\t\t\t\t\tsolid: (flags & 0x10) !== 0,\n\t\t\t\t\tcrc: dataCrc,\n\t\t\t\t\tisDirectory: directory,\n\t\t\t\t\tmtimeMs,","sourceCodeStart":536,"sourceCodeEnd":572,"githubUrl":"https://github.com/can1357/oh-my-pi/blob/969062200754ea02cfac922e5ebb8c608c079e15/packages/utils/src/ar/rar.ts#L536-L572","documentation":"When a RAR4 member's Unix mode indicates a symlink (S_IFLNK, 0xa000), the parser expects the link target to be stored uncompressed (method 0x30 'store') with packed size equal to unpacked size, since it reads the target as raw bytes from the data area. A symlink stored with any compression method, or with mismatched sizes, cannot be read this way, so it throws ArchiveError naming the member path.","triggerScenarios":"Calling records() on a RAR4 archive that contains a symbolic link whose target data was compressed (created by tools/settings that compress symlink payloads instead of storing them).","commonSituations":"Unix archives of directory trees containing symlinks packed by non-WinRAR tools (e.g. some Linux rar ports) that compress link targets; old tar-to-rar conversions.","solutions":["Re-create the archive with WinRAR/rar so symlinks are stored uncompressed (standard behavior), or use -m0/store for the link entries.","Extract externally with unrar and repackage; resolve symlinks to real files or a manifest before archiving.","If you control the pipeline, replace symlinks with regular files (or record targets in a side file) before compression.","Catch ArchiveError per path and skip/handle symlink members via an external extractor."],"exampleFix":"// before: tool compressed symlink payload\n$`some-rar a archive.rar tree/` // compressed symlink target\n// after\n$`rar a -m0 archive.rar tree/` // store, keeps symlink targets raw","handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"try {\n  const recs = await records(file);\n} catch (err) {\n  if (err instanceof ArchiveError && err.message.startsWith(\"Unsupported compressed RAR4 symlink\")) {\n    // re-pack with WinRAR/rar or extract externally; the message names the offending path\n  } else throw err;\n}","preventionTips":["Create RAR4 archives with standard WinRAR/rar, which stores symlink targets uncompressed.","Avoid third-party rar tools that compress symlink payloads.","Replace or flatten symlinks before archiving when the toolchain is untrusted.","The error message includes the member path — surface it to users for quick triage."],"tags":["archive","rar4","symlink","unsupported-feature"],"backgroundTag":"unsupported-symlink-encoding","analyzedSha":"969062200754ea02cfac922e5ebb8c608c079e15","analyzedAt":"2026-08-31T10:29:35.737Z","schemaVersion":2},"datasetVersion":"2026-08-31T14:17:45.589Z"}