apache/hadoop · error · IOException

Corrupted chunk encoding stream

Error message

Corrupted chunk encoding stream

What it means

Error "Corrupted chunk encoding stream" thrown in apache/hadoop.

Source

Thrown at hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/io/file/tfile/Chunk.java:141

        if (lastChunk) return true;
        readLength();
      }
    }

    @Override
    /*
     * This method never blocks the caller. Returning 0 does not mean we reach
     * the end of the stream.
     */
    public int available() {
      return remain;
    }

    @Override
    public int read() throws IOException {
      if (checkEOF()) return -1;
      int ret = in.read();
      if (ret < 0) throw new IOException("Corrupted chunk encoding stream");
      --remain;
      return ret;
    }

    @Override
    public int read(byte[] b) throws IOException {
      return read(b, 0, b.length);
    }

    @Override
    public int read(byte[] b, int off, int len) throws IOException {
      if ((off | len | (off + len) | (b.length - (off + len))) < 0) {
        throw new IndexOutOfBoundsException();
      }

      if (!checkEOF()) {
        int n = Math.min(remain, len);
        int ret = in.read(b, off, n);

View on GitHub (pinned to 2add963021)

Solutions

  1. The chunk encoding stream is corrupted; re-create the file and verify the codec used for reading matches the one used for writing.

When it happens

Trigger: 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.

Common situations: Occurs when a chunk's encoding stream is malformed, indicating corrupt compressed data. Verify file integrity; handle IOException and treat the file as corrupt.


AI-assisted analysis of apache/hadoop@2add963021 (2026-08-22). Data as JSON: /api/errors/6b24180bcd88013c. Report an issue: GitHub.