paperclipai/paperclip · error · Error

Unsupported zip archive: a compressed entry expands beyond t

Error message

Unsupported zip archive: a compressed entry expands beyond the ${maxEntryDecompressedBytes}-byte per-entry limit.

What it means

Error "Unsupported zip archive: a compressed entry expands beyond the ${maxEntryDecompressedBytes}-byte per-entry limit." thrown in paperclipai/paperclip.

Source

Thrown at packages/shared/src/portability-zip.ts:200

function inflateZipEntry(compressionMethod: number, bytes: Uint8Array, maxEntryDecompressedBytes: number) {
  if (compressionMethod === 0) {
    if (bytes.length > maxEntryDecompressedBytes) {
      throw new Error(
        `Unsupported zip archive: a stored entry exceeds the ${maxEntryDecompressedBytes}-byte per-entry limit.`,
      );
    }
    return bytes;
  }
  if (compressionMethod !== 8) {
    throw new Error("Unsupported zip archive: only STORE and DEFLATE entries are supported.");
  }
  try {
    // maxOutputLength makes zlib throw (ERR_BUFFER_TOO_LARGE) before it allocates
    // past the per-entry ceiling, so a bomb entry never materializes in memory.
    return new Uint8Array(inflateRawSync(bytes, { maxOutputLength: maxEntryDecompressedBytes }));
  } catch (error) {
    if ((error as NodeJS.ErrnoException | undefined)?.code === "ERR_BUFFER_TOO_LARGE") {
      throw new Error(
        `Unsupported zip archive: a compressed entry expands beyond the ${maxEntryDecompressedBytes}-byte per-entry limit.`,
      );
    }
    throw error;
  }
}

export async function readZipArchive(
  source: ArrayBuffer | Uint8Array,
  limits: ReadZipArchiveLimits = DEFAULT_ZIP_LIMITS,
): Promise<{
  rootPath: string | null;
  files: Record<string, CompanyPortabilityFileEntry>;
}> {
  const { maxEntryDecompressedBytes, maxTotalDecompressedBytes } = limits;
  const bytes = source instanceof Uint8Array ? source : new Uint8Array(source);
  const entries: Array<{ path: string; body: CompanyPortabilityFileEntry }> = [];
  let offset = 0;

View on GitHub (pinned to 120ae5428f)

Solutions

  1. Split the archive so decompressed entries stay under the per-entry limit.

When it happens

Trigger: Thrown at packages/shared/src/portability-zip.ts:200 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of paperclipai/paperclip@120ae5428f (2026-08-18). Data as JSON: /api/errors/b5b9a66b84d1d18d. Report an issue: GitHub.