diegosouzapw/OmniRoute · error

ZIP archive contains no .json files

Error message

ZIP archive contains no .json files

What it means

Error "ZIP archive contains no .json files" thrown in diegosouzapw/OmniRoute.

Source

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

  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[] = [];

  for (const [entryName, data] of jsonEntries) {
    const baseName = path.basename(entryName);

    if (!isSafeEntryName(baseName)) {
      throw new Error(
        `ZIP entry "${baseName}" has an unsafe filename (must be a .json file without path traversal)`
      );

View on GitHub (pinned to a179ffed5b)

When it happens

Trigger: Thrown at src/lib/oauth/utils/jsonZipExtract.ts:46 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/4ad3f83549bb301d. Report an issue: GitHub.