{"record":{"id":"101c2011ebeaeeb4","repo":"different-ai/openwork","slug":"unsupported-zip-compression-method-entry-method","errorCode":null,"errorMessage":"Unsupported ZIP compression method ${entry.method} for ${entry.name}.","messagePattern":"Unsupported ZIP compression method (.+?) for (.+?)\\.","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"apps/desktop/electron/workspace-archive.mjs","lineNumber":234,"sourceCode":"\nfunction readZipEntryData(buffer, entry) {\n  if (entry.uncompressedSize > MAX_ENTRY_UNCOMPRESSED_BYTES) throw new Error(`Archive entry exceeds the ${MAX_ENTRY_UNCOMPRESSED_BYTES}-byte limit.`);\n  const cursor = entry.localOffset;\n  if (buffer.readUInt32LE(cursor) !== ZIP_LOCAL_FILE_HEADER) {\n    throw new Error(`Invalid ZIP local header for ${entry.name}.`);\n  }\n  const nameLength = buffer.readUInt16LE(cursor + 26);\n  const extraLength = buffer.readUInt16LE(cursor + 28);\n  const dataStart = cursor + 30 + nameLength + extraLength;\n  const compressed = buffer.subarray(dataStart, dataStart + entry.compressedSize);\n  if (entry.method === 0) return compressed;\n  if (entry.method === 8) {\n    return zlib.inflateRawSync(compressed, {\n      finishFlush: zlib.constants.Z_SYNC_FLUSH,\n      maxOutputLength: MAX_ENTRY_UNCOMPRESSED_BYTES,\n    });\n  }\n  throw new Error(`Unsupported ZIP compression method ${entry.method} for ${entry.name}.`);\n}\n\nfunction isSafeArchivePath(name) {\n  if (!name || name.startsWith(\"/\") || /^[A-Za-z]:/.test(name)) return false;\n  const normalized = normalizeZipPath(name);\n  return !normalized.split(\"/\").some((part) => part === \"..\" || part === \"\");\n}\n\nfunction defaultOpenworkConfig(targetDir, preset = \"starter\") {\n  return {\n    version: 1,\n    workspace: {\n      name: path.basename(targetDir) || \"Workspace\",\n      createdAt: nowMs(),\n      preset,\n    },\n    authorizedRoots: [targetDir],\n    reload: null,","sourceCodeStart":216,"sourceCodeEnd":252,"githubUrl":"https://github.com/different-ai/openwork/blob/2b7df46e8ae1517d64c896c7793d2d52ec845669/apps/desktop/electron/workspace-archive.mjs#L216-L252","documentation":"readZipEntryData only supports stored (method 0) and deflate (method 8) entries. Any other compression method recorded in the central directory (bzip2, LZMA, AES-encrypted pseudo-methods, etc.) is rejected with this error naming the entry and method id.","triggerScenarios":"importWorkspaceConfig on an archive where an entry uses a compression method other than 0 or 8, e.g. `zip -Z bzip2`, 7-Zip with LZMA, or an encrypted AES zip.","commonSituations":"Re-compressing an export with 7-Zip using non-deflate codecs; archives encrypted with zip crypto/AES (methods 99/51); legacy tools producing implode/shrink entries.","solutions":["Repack the archive with standard deflate: `zip -Z deflate` or re-run exportWorkspaceConfig","Remove encryption — export a plaintext workspace archive instead","Extract with an external tool and re-zip only the supported entries (opencode.json, .opencode/)"],"exampleFix":"// before\n7z a -m0=lzma ws.zip .opencode/  # method 14 -> throws\n// after\n7z a -m0=Deflate ws.zip opencode.json .opencode/  # method 8 -> imports","handlingStrategy":"validation","validationCode":"// inspect compression methods via `zipinfo -v` before import; only methods 0 (store) and 8 (deflate) are supported","typeGuard":"function usesSupportedMethod(entry) {\n  return entry.method === 0 || entry.method === 8;\n}","tryCatchPattern":"try {\n  await importWorkspaceConfig({ archivePath, targetDir });\n} catch (err) {\n  if (String(err.message).startsWith('Unsupported ZIP compression method')) {\n    // repack archive with standard deflate, then retry\n  } else throw err;\n}","preventionTips":["Always repack exports with deflate (`zip -Z deflate`)","Never re-zip exports with 7-Zip LZMA/bzip2 codecs","Do not password-protect/AES-encrypt workspace archives"],"tags":["zip","compression","unsupported-codec"],"backgroundTag":"unsupported-zip-compression-method","analyzedSha":"2b7df46e8ae1517d64c896c7793d2d52ec845669","analyzedAt":"2026-09-01T07:59:23.713Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}