{"record":{"id":"696eeaa507dad1c9","repo":"cypress-io/cypress","slug":"corrupted-download-expected-downloaded-file-to-ha-696eea","errorCode":null,"errorMessage":"Corrupted download\n\nExpected downloaded file to have checksum: ${expectedChecksum}\nComputed checksum: ${checksum}","messagePattern":"Corrupted download\n\nExpected downloaded file to have checksum: (.+?)\nComputed checksum: (.+?)","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"cli/lib/tasks/download.ts","lineNumber":167,"sourceCode":"    debug('only checking expected file checksum %d', expectedChecksum)\n\n    const checksum: string = await util.getFileChecksum(filename)\n\n    if (checksum === expectedChecksum) {\n      debug('downloaded file has the expected checksum ✅')\n\n      return\n    }\n\n    debug('raising error: file checksum mismatch')\n    const text = stripIndent`\n      Corrupted download\n\n      Expected downloaded file to have checksum: ${expectedChecksum}\n      Computed checksum: ${checksum}\n    `\n\n    throw new Error(text)\n  }\n\n  if (expectedSize) {\n    // maybe we don't have a checksum, but at least CDN returns content length\n    // which we can check against the file size\n    debug('only checking expected file size %d', expectedSize)\n\n    const filesize: number = await util.getFileSize(filename)\n\n    if (filesize === expectedSize) {\n      debug('downloaded file has the expected size ✅')\n\n      return\n    }\n\n    debug('raising error: file size mismatch')\n    const text = stripIndent`\n        Corrupted download","sourceCodeStart":149,"sourceCodeEnd":185,"githubUrl":"https://github.com/cypress-io/cypress/blob/0d85fdc91230885bca0a91df278312800a48b727/cli/lib/tasks/download.ts#L149-L185","documentation":"Raised by verifyDownloadedFile() when the CDN response carried only an expected checksum (x-amz-meta-checksum) and the computed SHA of the downloaded file does not match it. Size was not provided by the server in this code path, so checksum is the sole integrity gate. A mismatch means the downloaded bytes differ from the released artifact.","triggerScenarios":"`cypress install` where the server omits a size header but provides x-amz-meta-checksum, and the file written to disk hashes to a different value. Common with custom mirrors or proxies that strip content-length/x-amz-meta-size but keep the checksum header.","commonSituations":"A custom CYPRESS_DOWNLOAD_MIRROR that does not preserve all S3 metadata; a proxy rewriting the body; disk corruption; partial download that happened to hit the same byte count coincidence is not possible here since size is unchecked.","solutions":["Re-run `cypress install` after clearing the download destination and ~/.cache/Cypress.","If using CYPRESS_DOWNLOAD_MIRROR, confirm the mirror serves the official, unmodified zip with intact metadata; switch back to the default or a trusted mirror.","Disable/inspect interfering proxies, TLS-inspecting firewalls, or antivirus that may alter the byte stream.","Provide CYPRESS_INSTALL_BINARY pointing to a verified local copy of cypress.zip."],"exampleFix":"# before: checksum mismatch on install\n# after:\nunset CYPRESS_DOWNLOAD_MIRROR\nrm -rf ~/.cache/Cypress\ncypress install","handlingStrategy":"retry","validationCode":null,"typeGuard":null,"tryCatchPattern":"try {\n  await cypress.install()\n} catch (e) {\n  if (e instanceof Error && /Corrupted download/.test(e.message)) {\n    await fs.remove(process.env.CYPRESS_CACHE_FOLDER || `${os.homedir()}/.cache/Cypress`)\n    await cypress.install()\n  }\n}","preventionTips":["Use the default download source unless a mirror is fully trusted.","Disable TLS-intercepting proxies for download.cypress.io.","Verify free disk space before install."],"tags":["install","download","checksum","network"],"backgroundTag":null,"analyzedSha":"0d85fdc91230885bca0a91df278312800a48b727","analyzedAt":"2026-08-12T16:24:28.056Z","schemaVersion":2},"datasetVersion":"2026-08-12T23:17:12.415Z"}