can1357/oh-my-pi · error · ArchiveError

ARJ member '${memberPath}' has invalid no-data method sizes

Error message

ARJ member '${memberPath}' has invalid no-data method sizes

What it means

This ArchiveError is thrown when an ARJ member uses a no-data compression method (8 = no data / descriptorless, 9) but the declared sizes are inconsistent: the uncompressed size must be 0 and the packed data range must also be empty. The library requires that no-data members carry no bytes at all.

Source

Thrown at packages/utils/src/ar/arj.ts:193

		let output: Uint8Array;
		switch (this.#method) {
			case 0:
				if (packed.byteLength !== size)
					throw new ArchiveError(`ARJ member '${memberPath}' has inconsistent stored size`);
				output = packed.slice();
				break;
			case 1:
			case 2:
			case 3:
				output = decompressLhStatic(packed, size, 26_624, 5, 17, `ARJ method ${this.#method}`);
				break;
			case 4:
				output = decompressArjMethod4(packed, size);
				break;
			case 8:
			case 9:
				if (size !== 0 || packed.byteLength !== 0) {
					throw new ArchiveError(`ARJ member '${memberPath}' has invalid no-data method sizes`);
				}
				output = new Uint8Array(0);
				break;
			default:
				throw new ArchiveError(`ARJ member '${memberPath}' uses unsupported compression method ${this.#method}`);
		}
		if (output.byteLength !== size)
			throw new ArchiveError(`ARJ member '${memberPath}' extracted to an unexpected size`);
		if (this.#method !== 8 && crc32(output) !== this.#crc) {
			throw new ArchiveError(`ARJ member '${memberPath}' failed CRC32 verification`);
		}
		return output;
	}
}

function normalizeHostPath(rawPath: string, hostOs: number): string {
	let path = rawPath.replaceAll("\\", "/");
	if (hostOs === 1) path = path.replaceAll(">", "/");

View on GitHub (pinned to 9690622007)

Solutions

  1. Inspect the member's local header: ensure size and packedSize are both 0 for method 8/9 members.
  2. Repack the archive with a compliant ARJ tool so directory entries are encoded with zero sizes.
  3. Catch ArchiveError and skip the offending member path rather than aborting the whole extraction.
  4. Report the archive to its producer if headers systematically disagree with the method field.

Example fix

// before
const data = await member.read(0, member.path);
// after
try {
  const data = await member.read(0, member.path);
} catch (e) {
  if (e instanceof ArchiveError && e.message.includes('invalid no-data method sizes')) {
    console.warn(`skipping malformed no-data member: ${member.path}`);
  } else throw e;
}
Defensive patterns

Strategy: validation

Validate before calling

if ((member.method === 8 || member.method === 9) && (member.size !== 0 || member.packedSize !== 0)) {
  throw new Error(`no-data member ${member.path} has non-zero sizes; header corrupt`);
}

Type guard

function isNoDataMember(m: { method: number; size: number; packedSize: number }): boolean {
  return (m.method === 8 || m.method === 9) && m.size === 0 && m.packedSize === 0;
}

Try / catch

try {
  const data = await member.read(size, path);
} catch (e) {
  if (e instanceof ArchiveError && e.message.includes('no-data method sizes')) {
    // skip malformed placeholder/directory entry
  } else throw e;
}

Prevention

When it happens

Trigger: Calling member.read(size, memberPath) on an ARJ member whose method is 8 or 9 where either size !== 0 or packedSize !== 0 in the local header.

Common situations: Directories or placeholder entries mis-encoded with non-zero sizes by a buggy archiver; corrupted headers; archives created by tools that store directory entries with nonzero reserved sizes.

Related errors


AI-assisted analysis of can1357/oh-my-pi@9690622007 (2026-08-31). Data as JSON: /api/errors/f4fcbf9fcdd64129. Report an issue: GitHub.