{"record":{"id":"60731593f7f0d4d0","repo":"apache/hadoop","slug":"terminating-due-to-a-checksum-error","errorCode":null,"errorMessage":"Terminating due to a checksum error.{}","messagePattern":"Terminating due to a checksum error\\.(.+?)","errorType":"exception","errorClass":"IOException","httpStatus":null,"severity":"error","filePath":"hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/datanode/BlockReceiver.java","lineNumber":674,"sourceCode":"            + checksumReceivedLen + \" but expected length is \" + checksumLen);\n      }\n\n      if (checksumReceivedLen > 0 && shouldVerifyChecksum()) {\n        try {\n          verifyChunks(dataBuf, checksumBuf);\n        } catch (IOException ioe) {\n          // checksum error detected locally. there is no reason to continue.\n          if (responder != null) {\n            try {\n              ((PacketResponder) responder.getRunnable()).enqueue(seqno,\n                  lastPacketInBlock, offsetInBlock,\n                  Status.ERROR_CHECKSUM);\n              // Wait until the responder sends back the response\n              // and interrupt this thread.\n              Thread.sleep(3000);\n            } catch (InterruptedException e) { }\n          }\n          throw new IOException(\"Terminating due to a checksum error.\" + ioe);\n        }\n \n        if (needsChecksumTranslation) {\n          // overwrite the checksums in the packet buffer with the\n          // appropriate polynomial for the disk storage.\n          translateChunks(dataBuf, checksumBuf);\n        }\n      }\n\n      if (checksumReceivedLen == 0 && !streams.isTransientStorage()) {\n        // checksum is missing, need to calculate it\n        checksumBuf = ByteBuffer.allocate(checksumLen);\n        diskChecksum.calculateChunkedSums(dataBuf, checksumBuf);\n      }\n      \n      // by this point, the data in the buffer uses the disk checksum\n\n      final boolean shouldNotWriteChecksum = checksumReceivedLen == 0","sourceCodeStart":656,"sourceCodeEnd":692,"githubUrl":"https://github.com/apache/hadoop/blob/2add9630210752f88ceb1bb74eb65e37bf41da8e/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/datanode/BlockReceiver.java#L656-L692","documentation":"Error \"Terminating due to a checksum error.{}\" thrown in apache/hadoop.","triggerScenarios":"The DataNode detects a checksum error in data received during a block write and terminates the write to avoid persisting corrupt data.","commonSituations":"The DataNode aborted a block write after detecting a checksum error in received data. Inspect the pipeline for faulty disks or memory on upstream nodes.","solutions":["Identify and replace the failing hardware: run disk checks and memory tests on the DataNode reporting the checksum error and its upstream peer.","Re-write the affected block from a healthy replica after the faulty component is fixed; the NameNode will re-replicate once the corrupt replica is reported."],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"2add9630210752f88ceb1bb74eb65e37bf41da8e","analyzedAt":"2026-08-22T19:55:07.957Z","schemaVersion":2},"datasetVersion":"2026-08-22T20:17:22.307Z"}