{"record":{"id":"6b24180bcd88013c","repo":"apache/hadoop","slug":"corrupted-chunk-encoding-stream","errorCode":null,"errorMessage":"Corrupted chunk encoding stream","messagePattern":"Corrupted chunk encoding stream","errorType":"exception","errorClass":"IOException","httpStatus":null,"severity":"error","filePath":"hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/io/file/tfile/Chunk.java","lineNumber":141,"sourceCode":"        if (lastChunk) return true;\n        readLength();\n      }\n    }\n\n    @Override\n    /*\n     * This method never blocks the caller. Returning 0 does not mean we reach\n     * the end of the stream.\n     */\n    public int available() {\n      return remain;\n    }\n\n    @Override\n    public int read() throws IOException {\n      if (checkEOF()) return -1;\n      int ret = in.read();\n      if (ret < 0) throw new IOException(\"Corrupted chunk encoding stream\");\n      --remain;\n      return ret;\n    }\n\n    @Override\n    public int read(byte[] b) throws IOException {\n      return read(b, 0, b.length);\n    }\n\n    @Override\n    public int read(byte[] b, int off, int len) throws IOException {\n      if ((off | len | (off + len) | (b.length - (off + len))) < 0) {\n        throw new IndexOutOfBoundsException();\n      }\n\n      if (!checkEOF()) {\n        int n = Math.min(remain, len);\n        int ret = in.read(b, off, n);","sourceCodeStart":123,"sourceCodeEnd":159,"githubUrl":"https://github.com/apache/hadoop/blob/2add9630210752f88ceb1bb74eb65e37bf41da8e/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/io/file/tfile/Chunk.java#L123-L159","documentation":"Error \"Corrupted chunk encoding stream\" thrown in apache/hadoop.","triggerScenarios":"Thrown at hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/io/file/tfile/Chunk.java:141 when the library encounters an invalid state.","commonSituations":"Occurs when a chunk's encoding stream is malformed, indicating corrupt compressed data. Verify file integrity; handle IOException and treat the file as corrupt.","solutions":["The chunk encoding stream is corrupted; re-create the file and verify the codec used for reading matches the one used for writing."],"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"}