cypress-io/cypress · error · Error
Corrupted download Expected downloaded file to have checksu
Error message
Corrupted download
Expected downloaded file to have checksum: ${expectedChecksum}
Computed checksum: ${checksum}
Expected downloaded file to have size: ${expectedSize}
Computed size: ${filesize} What it means
Raised by verifyDownloadedFile() during Cypress binary installation when the downloaded cypress.zip has BOTH a mismatched checksum and a mismatched file size versus the x-amz-meta-checksum / x-amz-meta-size (or content-length) headers served by the download CDN. It means the bytes on disk are not the bytes the release pipeline published, indicating a truncated, corrupt, or tampered download.
Source
Thrown at cli/lib/tasks/download.ts:143
debug('downloaded file has the expected checksum and size ✅')
return
}
debug('raising error: checksum or file size mismatch')
const text = stripIndent`
Corrupted download
Expected downloaded file to have checksum: ${expectedChecksum}
Computed checksum: ${checksum}
Expected downloaded file to have size: ${expectedSize}
Computed size: ${filesize}
`
debug(text)
throw new Error(text)
},
)
}
if (expectedChecksum) {
debug('only checking expected file checksum %d', expectedChecksum)
const checksum: string = await util.getFileChecksum(filename)
if (checksum === expectedChecksum) {
debug('downloaded file has the expected checksum ✅')
return
}
debug('raising error: file checksum mismatch')
const text = stripIndent`
Corrupted downloadView on GitHub (pinned to 0d85fdc912)
Solutions
- Re-run `cypress install` (or reinstall the cypress npm package) so the binary downloads fresh.
- Clear the Cypress cache (rm -rf of the CYPRESS_CACHE_FOLDER, default ~/.cache/Cypress) and the npm cache, then reinstall.
- If behind a proxy, verify HTTPS_PROXY/HTTP_PROXY and the proxy's max body size; try a direct connection or a trusted mirror via CYPRESS_DOWNLOAD_MIRROR.
- Set CYPRESS_INSTALL_BINARY to a known-good local zip or trusted URL to bypass the CDN path entirely.
Example fix
# before: install fails with checksum+size mismatch # after: rm -rf ~/.cache/Cypress cypress install
Defensive patterns
Strategy: retry
Try / catch
async function installWithRetry(retries = 2) {
for (let attempt = 0; attempt <= retries; attempt++) {
try {
await installBinary()
return
} catch (e) {
if (e instanceof Error && /Corrupted download/.test(e.message) && attempt < retries) {
await fs.remove(cacheFolder)
continue
}
throw e
}
}
} Prevention
- Pin a known-good binary via CYPRESS_INSTALL_BINARY in environments with flaky networks.
- Keep CYPRESS_CACHE_FOLDER on stable storage with enough free space.
- Avoid mirrors you do not control for the binary download.
When it happens
Trigger: Running `cypress install` or npm/yarn postinstall where the network drops mid-download but the connection closes cleanly, or a transparent proxy/CDN cache serves a stale or partial artifact. Triggered only when the server response included both x-amz-meta-checksum and a size header.
Common situations: Flaky corporate proxies or VPNs truncating large responses; a corrupted npm cache; a mirror (CYPRESS_DOWNLOAD_MIRROR) serving a wrong/incomplete artifact; disk filling up mid-write; antivirus rewriting the streamed zip.
Related errors
- Corrupted download Expected downloaded file to have checksu
- Corrupted download Expected downloaded file to have size: $
- Refusing to extract entry outside of destination: ${entry.fi
- Refusing to extract symlink with target larger than ${MAX_SY
- Refusing to extract symlink pointing outside of destination:
AI-assisted analysis of cypress-io/cypress@0d85fdc912 (2026-08-12).
Data as JSON: /api/errors/98d3c504ee0a81b5.
Report an issue: GitHub.