{"record":{"id":"d05d68cd46dd76a2","repo":"paperclipai/paperclip","slug":"invalid-zip-archive-unsupported-local-file-header-d05d68","errorCode":null,"errorMessage":"Invalid zip archive: unsupported local file header.","messagePattern":"Invalid zip archive: unsupported local file header\\.","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"ui/src/lib/zip.ts","lineNumber":193,"sourceCode":"  const body = new Uint8Array(bytes.byteLength);\n  body.set(bytes);\n  const stream = new Blob([body]).stream().pipeThrough(new DecompressionStream(\"deflate-raw\"));\n  return new Uint8Array(await new Response(stream).arrayBuffer());\n}\n\nexport async function readZipArchive(source: ArrayBuffer | Uint8Array): Promise<{\n  rootPath: string | null;\n  files: Record<string, CompanyPortabilityFileEntry>;\n}> {\n  const bytes = source instanceof Uint8Array ? source : new Uint8Array(source);\n  const entries: Array<{ path: string; body: CompanyPortabilityFileEntry }> = [];\n  let offset = 0;\n\n  while (offset + 4 <= bytes.length) {\n    const signature = readUint32(bytes, offset);\n    if (signature === 0x02014b50 || signature === 0x06054b50) break;\n    if (signature !== 0x04034b50) {\n      throw new Error(\"Invalid zip archive: unsupported local file header.\");\n    }\n\n    if (offset + 30 > bytes.length) {\n      throw new Error(\"Invalid zip archive: truncated local file header.\");\n    }\n\n    const generalPurposeFlag = readUint16(bytes, offset + 6);\n    const compressionMethod = readUint16(bytes, offset + 8);\n    const compressedSize = readUint32(bytes, offset + 18);\n    const fileNameLength = readUint16(bytes, offset + 26);\n    const extraFieldLength = readUint16(bytes, offset + 28);\n\n    if ((generalPurposeFlag & 0x0008) !== 0) {\n      throw new Error(\"Unsupported zip archive: data descriptors are not supported.\");\n    }\n\n    const nameOffset = offset + 30;\n    const bodyOffset = nameOffset + fileNameLength + extraFieldLength;","sourceCodeStart":175,"sourceCodeEnd":211,"githubUrl":"https://github.com/paperclipai/paperclip/blob/120ae5428fa29bee300bcf806491cd4d965fbb7c/ui/src/lib/zip.ts#L175-L211","documentation":"Browser zip reader structural validation: while walking local file headers, a 4-byte signature appeared that is neither a local file header (0x04034b50) nor a central-directory/EOCD marker, so the bytes are not a zip the reader can walk. Typically a corrupt download or a non-zip file renamed to .zip.","triggerScenarios":"Thrown at ui/src/lib/zip.ts:193 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Provide a valid zip archive; the file appears corrupt or not a real zip. Re-export and retry."],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"120ae5428fa29bee300bcf806491cd4d965fbb7c","analyzedAt":"2026-08-18T22:49:45.177Z","contentChangedAt":"2026-08-18T22:49:45.177Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}