diegosouzapw/OmniRoute · error · Error

SHA256 checksum mismatch for

Error message

SHA256 checksum mismatch for ${assetName}

What it means

Integrity failure in downloadRelease: the archive downloaded successfully but its SHA256 does not match the expected value from the release checksums file (asset name embedded). Indicates a truncated/corrupted download or, rarely, a tampered/mismatched asset — the corrupted archive is deleted and the install aborted.

Solutions

  1. Retry the download — truncation is the usual cause
  2. Clear any partial files in the version dir and re-run
  3. Report if checksums consistently mismatch (possible upstream tamper)
Defensive patterns

Strategy: retry

When it happens

Trigger: Thrown at src/lib/versionManager/binaryManager.ts:166 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/f4906dd0db2c056c. Report an issue: GitHub.

Appendix: source

Thrown at src/lib/versionManager/binaryManager.ts:166

  const ext = platform === "windows" ? ".zip" : ".tar.gz";
  const assetName = `CLIProxyAPI_${release.version}_${platform}_${arch}${ext}`;
  const asset = release.assets.find((a) => a.name === assetName);
  if (!asset) throw new Error(`No asset for ${platform}/${arch}`);

  const versionDir = path.join(targetDir, `cliproxyapi-${version}`);
  await fs.mkdir(versionDir, { recursive: true });

  const archivePath = path.join(versionDir, assetName);
  await downloadFile(asset.url, archivePath, signal);

  const checksums = await getChecksums(version);
  if (checksums.size > 0) {
    const expected = checksums.get(assetName);
    if (expected) {
      const valid = await verifyChecksum(archivePath, expected);
      if (!valid) {
        await fs.unlink(archivePath);
        throw new Error(`SHA256 checksum mismatch for ${assetName}`);
      }
    }
  }

  if (platform === "windows") {
    // Already inside the `platform === "windows"` branch of the single value
    // detected above (or threaded in via `target`) — pass the corresponding
    // NodeJS.Platform literal directly rather than calling os.platform() again.
    await extractZip(archivePath, versionDir, "win32");
  } else {
    await extractTarGz(archivePath, versionDir);
  }

  await fs.unlink(archivePath).catch(() => {});

  const binary = findBinaryInDir(versionDir);
  if (!binary) throw new Error(`Binary not found in extracted archive`);

View on GitHub (pinned to a179ffed5b)