apache/hadoop · error · InvalidDecodingException

Failed to validate decoding

Error message

Failed to validate decoding

What it means

Error "Failed to validate decoding" thrown in apache/hadoop.

Source

Thrown at hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/io/erasurecode/rawcoder/DecodingValidator.java:122

          newErasedIndex = i;
          newInputs[i] = null;
          selected = true;
        } else if (newInputs[i] == null) {
          newInputs[i] = inputs[i];
          if (inputs[i] != null) {
            count++;
          }
        }
      }

      // Keep it for testing
      newValidIndexes = CoderUtil.getValidIndexes(newInputs);

      decoder.decode(newInputs, new int[]{newErasedIndex},
          new ByteBuffer[]{buffer});

      if (!buffer.equals(inputs[newErasedIndex])) {
        throw new InvalidDecodingException("Failed to validate decoding");
      }
    } finally {
      toLimits(inputs);
      resetBuffers(outputs);
    }
  }

  /**
   *  Validate outputs decoded from inputs, by decoding an input back from
   *  those outputs and comparing it with the original one.
   * @param inputs input buffers used for decoding
   * @param erasedIndexes indexes of erased units used for decoding
   * @param outputs decoded output buffers
   * @throws IOException raised on errors performing I/O.
   */
  public void validate(ECChunk[] inputs, int[] erasedIndexes, ECChunk[] outputs)
      throws IOException {
    ByteBuffer[] newInputs = CoderUtil.toBuffers(inputs);

View on GitHub (pinned to 2add963021)

Solutions

  1. Re-run with validation logging to find the mismatching block; the encoded/decoded data does not round-trip, indicating a coder bug or corrupt inputs.
  2. Verify the raw coder implementation and its native library version match the expected codec.

When it happens

Trigger: Thrown at hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/io/erasurecode/rawcoder/DecodingValidator.java:122 when the library encounters an invalid state.

Common situations: Occurs when post-decode validation detects the recovered data does not match expectations, indicating a coding bug or bad inputs. Re-check inputs and coder configuration; do not ignore validation failures.


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