apache/iceberg · error · IOException

Unrecognized version or corrupt state: ${version}

Error message

Unrecognized version or corrupt state: ${version}

What it means

WriteResultSerializer prefixes serialized WriteResults with a version byte; deserialize throws this IOException when the version byte is neither the current expected version nor matches known formats, indicating the payload was produced by an incompatible serializer version or the byte stream is corrupted.

Source

Thrown at flink/v2.1/flink/src/main/java/org/apache/iceberg/flink/sink/WriteResultSerializer.java:61

    byte[] result = InstantiationUtil.serializeObject(writeResult);
    view.write(result);
    return out.toByteArray();
  }

  @Override
  public WriteResult deserialize(int version, byte[] serialized) throws IOException {
    if (version == 1) {
      DataInputDeserializer view = new DataInputDeserializer(serialized);
      byte[] resultBuf = new byte[serialized.length];
      view.read(resultBuf);
      try {
        return InstantiationUtil.deserializeObject(
            resultBuf, IcebergCommittableSerializer.class.getClassLoader());
      } catch (ClassNotFoundException cnc) {
        throw new IOException("Could not deserialize the WriteResult object", cnc);
      }
    }
    throw new IOException("Unrecognized version or corrupt state: " + version);
  }
}

View on GitHub (pinned to 86d9c8fc54)

Solutions

  1. Restore the job using the same Iceberg version that wrote the checkpoint, drain it cleanly, then upgrade without in-flight state.
  2. Recreate the write pipeline (start without the old savepoint) so committables are re-serialized in the current format.
  3. Verify checkpoint integrity; re-run from an earlier healthy checkpoint if corruption is suspected.
Defensive patterns

Strategy: fallback

Try / catch

try {
  return serializer.deserialize(version, bytes);
} catch (IOException e) {
  if (e.getMessage().startsWith("Unrecognized version or corrupt state")) {
    // fall back to an earlier checkpoint or restart without this savepoint
  }
  throw e;
}

Prevention

When it happens

Trigger: Reading committables from a checkpoint/savepoint created by a different Iceberg version whose serializer version differs; byte-offset corruption or truncated input in the committable stream.

Common situations: Restoring a Flink job with an older/newer iceberg-flink runtime over state written by another version; manually patched state; network/storage corruption of checkpoint data.

Related errors


AI-assisted analysis of apache/iceberg@86d9c8fc54 (2026-09-12). Data as JSON: /api/errors/d76e368b88e66df2. Report an issue: GitHub.