vercel-labs/skills · error · Error

Zip entry checksum mismatch

Error message

Zip entry checksum mismatch

What it means

Thrown after successfully decompressing a zip entry when crc32(contents) does not equal the expectedChecksum from the zip header. CRC validation is the last integrity gate in readZipArchive; a mismatch means the bytes changed between what the archiver wrote and what was decompressed here. Almost always corruption in transit or on disk rather than a code bug.

Source

Thrown at src/archive.ts:391

    }

    const compressed = buffer.subarray(dataOffset, dataOffset + compressedSize);
    let contents: Buffer;
    if (method === 0) {
      contents = compressed;
    } else if (method === 8) {
      contents = inflateRawSync(compressed, {
        maxOutputLength: uncompressedSize + 1,
      });
    } else {
      throw new Error(`Unsupported zip compression method: ${method}`);
    }

    if (contents.byteLength !== uncompressedSize) {
      throw new Error('Zip entry size mismatch');
    }
    if (crc32(contents) !== expectedChecksum) {
      throw new Error('Zip entry checksum mismatch');
    }
    files.set(fileName, new Uint8Array(contents));
  }

  if (offset !== centralDirectory.offset + centralDirectory.size) {
    throw new Error('Invalid zip central directory size');
  }

  return files;
}

View on GitHub (pinned to 435076e789)

Solutions

  1. Re-download the archive from the original source and retry extraction
  2. Verify with unzip -t (or zip -T) to confirm the file is corrupt
  3. Clear any local/CI cache holding the bad artifact
  4. If the source archive itself is bad, regenerate it at the origin

Example fix

# before
skills add https://example.com/skills.zip  # Zip entry checksum mismatch

# after
rm -rf ~/.cache/skills && skills add https://example.com/skills.zip
Defensive patterns

Strategy: validation

Validate before calling

// Confirm CRC integrity before handing the file to the library
import { execFileSync } from 'node:child_process';
function assertZipCrc(path: string): void {
  execFileSync('unzip', ['-t', path], { stdio: 'pipe' });
}

Type guard

null

Try / catch

try {
  await extractArchive(file);
} catch (err) {
  if (err instanceof Error && err.message === 'Zip entry checksum mismatch') {
    await rm(file); // discard corrupt artifact, then re-download
  } else throw err;
}

Prevention

When it happens

Trigger: Extracting a zip whose entry bytes were altered/truncated after creation — interrupted downloads, corrupted cache, disk errors, or a server/proxy serving a truncated body that still parses as a valid zip structure.

Common situations: CI cache serving stale/corrupt zips, flaky networks truncating responses, partial uploads to a hosting provider, or mixing up offsets when zips are regenerated in place.

Related errors


AI-assisted analysis of vercel-labs/skills@435076e789 (2026-08-28). Data as JSON: /api/errors/2a5498609b3bc71e. Report an issue: GitHub.