paperclipai/paperclip · error · Error
Unsupported zip archive: a stored entry exceeds the ${maxEnt
Error message
Unsupported zip archive: a stored entry exceeds the ${maxEntryDecompressedBytes}-byte per-entry limit. What it means
Error "Unsupported zip archive: a stored entry exceeds the ${maxEntryDecompressedBytes}-byte per-entry limit." thrown in paperclipai/paperclip.
Source
Thrown at packages/shared/src/portability-zip.ts:185
}
// Size caps applied while expanding an archive. Callers use the module defaults;
// the limits are parameterizable so the guard can be exercised in tests without
// allocating hundreds of megabytes.
export interface ReadZipArchiveLimits {
maxEntryDecompressedBytes: number;
maxTotalDecompressedBytes: number;
}
const DEFAULT_ZIP_LIMITS: ReadZipArchiveLimits = {
maxEntryDecompressedBytes: MAX_ZIP_ENTRY_DECOMPRESSED_BYTES,
maxTotalDecompressedBytes: MAX_ZIP_TOTAL_DECOMPRESSED_BYTES,
};
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.`,
);
}View on GitHub (pinned to 120ae5428f)
Solutions
- Split the archive so each entry is under the per-entry byte limit.
When it happens
Trigger: Thrown at packages/shared/src/portability-zip.ts:185 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/db777b7a59cb6ef3.
Report an issue: GitHub.