diegosouzapw/OmniRoute · error · Error

Could not parse ZIP archive — file may be corrupt or not a v

Error message

Could not parse ZIP archive — file may be corrupt or not a valid ZIP

What it means

Error "Could not parse ZIP archive — file may be corrupt or not a valid ZIP" thrown in diegosouzapw/OmniRoute.

Source

Thrown at src/lib/oauth/utils/jsonZipExtract.ts:39

  if (name.includes("..")) return false;
  if (path.isAbsolute(name)) return false;
  if (/[\r\n\0]/.test(name)) return false;
  return true;
}

export function extractJsonZip(
  zipBuffer: Buffer,
  options: ExtractZipOptions = {}
): ExtractedZipFile[] {
  const maxFiles = options.maxFiles ?? DEFAULT_MAX_FILES;
  const maxFileSize = options.maxFileSizeBytes ?? DEFAULT_MAX_FILE_SIZE;
  const maxTotal = options.maxTotalSizeBytes ?? DEFAULT_MAX_TOTAL;

  let unzipped: Unzipped;
  try {
    unzipped = unzipSync(new Uint8Array(zipBuffer));
  } catch {
    throw new Error("Could not parse ZIP archive — file may be corrupt or not a valid ZIP");
  }

  const entries = Object.entries(unzipped).filter(([, data]) => data !== undefined);
  const jsonEntries = entries.filter(([name]) => name.toLowerCase().endsWith(".json"));

  if (jsonEntries.length === 0) {
    throw new Error("ZIP archive contains no .json files");
  }

  if (jsonEntries.length > maxFiles) {
    throw new Error(
      `ZIP archive contains ${jsonEntries.length} .json files — max allowed is ${maxFiles}`
    );
  }

  let totalBytes = 0;
  const result: ExtractedZipFile[] = [];

View on GitHub (pinned to a179ffed5b)

When it happens

Trigger: Thrown at src/lib/oauth/utils/jsonZipExtract.ts:39 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of diegosouzapw/OmniRoute@a179ffed5b (2026-08-25). Data as JSON: /api/errors/cd5feb37b95199a4. Report an issue: GitHub.