{"record":{"id":"bf5a0ac5f0be9621","repo":"apache/iceberg","slug":"unrecognized-version-or-corrupt-state-version-bf5a0a","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/v1.20/flink/src/main/java/org/apache/iceberg/flink/sink/IcebergCommittableSerializer.java","lineNumber":66,"sourceCode":"    view.writeInt(committable.manifest().length);\n    view.write(committable.manifest());\n    return out.toByteArray();\n  }\n\n  @Override\n  public IcebergCommittable deserialize(int version, byte[] serialized) throws IOException {\n    if (version == 1) {\n      DataInputDeserializer view = new DataInputDeserializer(serialized);\n      String jobId = view.readUTF();\n      String operatorId = view.readUTF();\n      long checkpointId = view.readLong();\n      int manifestLen = view.readInt();\n      byte[] manifestBuf;\n      manifestBuf = new byte[manifestLen];\n      view.read(manifestBuf);\n      return new IcebergCommittable(manifestBuf, jobId, operatorId, checkpointId);\n    }\n    throw new IOException(\"Unrecognized version or corrupt state: \" + version);\n  }\n}\n","sourceCodeStart":48,"sourceCodeEnd":69,"githubUrl":"https://github.com/apache/iceberg/blob/86d9c8fc543e7c56c9f624eb725f76c9baff9570/flink/v1.20/flink/src/main/java/org/apache/iceberg/flink/sink/IcebergCommittableSerializer.java#L48-L69","documentation":"IcebergCommittableSerializer.deserialize validates the version byte/int of a serialized IcebergCommittable; anything other than VERSION=1 (the only supported format) throws an IOException 'Unrecognized version or corrupt state'. This guards against deserializing checkpoint state or network payloads written by an incompatible serializer version or a corrupted byte stream.","triggerScenarios":"Restoring a Flink job from a savepoint/checkpoint written by a different Iceberg version whose committable format differs, or deserializing a byte array that was truncated/garbled (corrupt state) so the leading version marker does not equal 1.","commonSituations":"Upgrading or downgrading iceberg-flink-runtime between job restarts while resuming from old state; manually crafting IcebergCommittable bytes; classpath mixing two serializer implementations.","solutions":["Resume the job with the same iceberg-flink-runtime version that produced the checkpoint/savepoint","Discard the incompatible state: restart without savepoint or use --allowNonRestoredState after confirming no committables are lost mid-checkpoint","If a version upgrade is required, drain the pipeline (let the checkpoint commit) before upgrading","Check for duplicate Iceberg jars on the classpath causing the wrong serializer to read the bytes"],"exampleFix":"// before\n./bin/flink run -s flink-savepoint-13t ... (savepoint made with iceberg 1.4, running 1.5 runtime)\n// after\n# run with matching runtime, or start fresh:\n./bin/flink run -s flink-savepoint-13t --jarfile iceberg-flink-runtime-1.4.3.jar ...","handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"try {\n  IcebergCommittable c = serializer.deserialize(version, bytes);\n} catch (IOException e) {\n  if (e.getMessage().startsWith(\"Unrecognized version\")) {\n    // incompatible savepoint/format: fail fast, do not retry\n    throw new StateIncompatibleException(e);\n  }\n  throw e;\n}","preventionTips":["Never resume a job from a savepoint written with a different iceberg-flink-runtime version without testing","Drain checkpoints before upgrading the runtime","Pin exact runtime versions in deployment manifests","Watch for 'Unrecognized version' during upgrade testing in staging"],"tags":["flink","serialization","checkpoint","iceberg"],"backgroundTag":"invalid-argument-format","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"}