{"record":{"id":"5d4f0ffa77163433","repo":"arduino/Arduino","slug":"crc-doesn-t-match-file-is-corrupted-it-may-be-a","errorCode":null,"errorMessage":"CRC doesn't match, file is corrupted. It may be a temporary problem, please retry later.","messagePattern":"CRC doesn't match, file is corrupted\\. It may be a temporary problem, please retry later\\.","errorType":"exception","errorClass":"Exception","httpStatus":null,"severity":"error","filePath":"arduino-core/src/cc/arduino/contributions/DownloadableContributionsDownloader.java","lineNumber":101,"sourceCode":"      // Test checksum\n      progress.setStatus(tr(\"Verifying archive integrity...\"));\n      progressListener.onProgress(progress);\n      if (hasChecksum(contribution)) {\n        String checksum = contribution.getChecksum();\n        String algo = checksum.split(\":\")[0];\n        String crc = FileHash.hash(outputFile.toFile(), algo);\n        if (!crc.equalsIgnoreCase(checksum)) {\n          // If the file has not been downloaded it may be a leftover of\n          // a previous download that failed. In this case delete it and\n          // try to download it again.\n          if (!downloaded) {\n            Files.delete(outputFile);\n            downloaded = true; // Redundant to avoid loops in case delete fails\n            continue;\n          }\n\n          // Otherwise throw the error.\n          throw new Exception(tr(\"CRC doesn't match, file is corrupted. It may be a temporary problem, please retry later.\"));\n        }\n      }\n\n      // Download completed successfully\n      break;\n    }\n\n    contribution.setDownloaded(true);\n    contribution.setDownloadedFile(outputFile.toFile());\n    return outputFile.toFile();\n  }\n\n  private boolean hasChecksum(DownloadableContribution contribution) {\n    String checksum = contribution.getChecksum();\n    if (checksum == null || checksum.isEmpty()) {\n      return false;\n    }\n","sourceCodeStart":83,"sourceCodeEnd":119,"githubUrl":"https://github.com/arduino/Arduino/blob/a0df6e0e83b652c72bc78b0a1376c54d6ebc3bee/arduino-core/src/cc/arduino/contributions/DownloadableContributionsDownloader.java#L83-L119","documentation":"During download(), the downloader verifies the checksum (CRC) of the downloaded file each iteration. When the checksum does not match after a resumed/retried download, it deletes the file and throws this Exception, indicating the transfer is corrupt and likely transient.","triggerScenarios":"download() completes a transfer (possibly after resume attempts) whose computed checksum does not match contribution.getChecksum(); the code deletes the bad file and throws.","commonSituations":"Unstable network connections or interrupted downloads producing partial/corrupt archives; a resumed download resuming from a stale offset; proxy or antivirus mangling the payload; the published checksum on the index changed while an old cached file remains.","solutions":["Simply retry the download later — the message itself says the corruption is often temporary.","Delete the partially downloaded file from the staging folder and re-run the install/update so a fresh download starts.","Disable resume (call with noResume=true) to force a clean full download.","Check for a proxy/VPN/antivirus intercepting traffic and try a different network; verify the index checksum matches the published package."],"exampleFix":null,"handlingStrategy":"retry","validationCode":null,"typeGuard":null,"tryCatchPattern":"try { downloader.download(c, progress, status, listener, false, true); } catch (Exception e) { if (e.getMessage().startsWith(\"CRC doesn't match\")) { deletePartialFile(c); retryWithNoResume(c); } else { throw e; } }","preventionTips":["Use a stable network connection for large package downloads.","Disable download resume when resuming is suspected of causing corruption.","Verify staging folder contents after interrupted downloads."],"tags":["arduino","download","checksum","network"],"backgroundTag":"checksum-mismatch","analyzedSha":"a0df6e0e83b652c72bc78b0a1376c54d6ebc3bee","analyzedAt":"2026-09-06T10:13:38.901Z","contentChangedAt":"2026-09-06T10:13:38.901Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}