{"record":{"id":"d76e368b88e66df2","repo":"apache/iceberg","slug":"unrecognized-version-or-corrupt-state-version-d76e36","errorCode":null,"errorMessage":"Unrecognized version or corrupt state: ${version}","messagePattern":"Unrecognized version or corrupt state: (.+?)","errorType":"exception","errorClass":"IOException","httpStatus":null,"severity":"error","filePath":"flink/v2.1/flink/src/main/java/org/apache/iceberg/flink/sink/WriteResultSerializer.java","lineNumber":61,"sourceCode":"    byte[] result = InstantiationUtil.serializeObject(writeResult);\n    view.write(result);\n    return out.toByteArray();\n  }\n\n  @Override\n  public WriteResult deserialize(int version, byte[] serialized) throws IOException {\n    if (version == 1) {\n      DataInputDeserializer view = new DataInputDeserializer(serialized);\n      byte[] resultBuf = new byte[serialized.length];\n      view.read(resultBuf);\n      try {\n        return InstantiationUtil.deserializeObject(\n            resultBuf, IcebergCommittableSerializer.class.getClassLoader());\n      } catch (ClassNotFoundException cnc) {\n        throw new IOException(\"Could not deserialize the WriteResult object\", cnc);\n      }\n    }\n    throw new IOException(\"Unrecognized version or corrupt state: \" + version);\n  }\n}\n","sourceCodeStart":43,"sourceCodeEnd":64,"githubUrl":"https://github.com/apache/iceberg/blob/86d9c8fc543e7c56c9f624eb725f76c9baff9570/flink/v2.1/flink/src/main/java/org/apache/iceberg/flink/sink/WriteResultSerializer.java#L43-L64","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","solutions":["Restore the job using the same Iceberg version that wrote the checkpoint, drain it cleanly, then upgrade without in-flight state.","Recreate the write pipeline (start without the old savepoint) so committables are re-serialized in the current format.","Verify checkpoint integrity; re-run from an earlier healthy checkpoint if corruption is suspected."],"exampleFix":null,"handlingStrategy":"fallback","validationCode":null,"typeGuard":null,"tryCatchPattern":"try {\n  return serializer.deserialize(version, bytes);\n} catch (IOException e) {\n  if (e.getMessage().startsWith(\"Unrecognized version or corrupt state\")) {\n    // fall back to an earlier checkpoint or restart without this savepoint\n  }\n  throw e;\n}","preventionTips":["Drain jobs cleanly (stop-with-savepoint) before upgrading Iceberg versions.","Pin iceberg-flink runtime version per job and record it in job metadata.","Enable checkpoint integrity checks (checksums) on state backend storage."],"tags":["flink","serialization","version-skew","checkpointing"],"backgroundTag":"unexpected-response-shape","analyzedSha":"86d9c8fc543e7c56c9f624eb725f76c9baff9570","analyzedAt":"2026-09-12T00:46:39.097Z","contentChangedAt":"2026-09-12T00:46:39.097Z","schemaVersion":2},"datasetVersion":"2026-09-14T16:17:12.679Z"}