{"record":{"id":"f5de53c1fdcfebce","repo":"apache/iceberg","slug":"unrecognized-version-or-corrupt-state-f5de53","errorCode":null,"errorMessage":"Unrecognized version or corrupt state: ","messagePattern":"Unrecognized version or corrupt state: ","errorType":"exception","errorClass":"IOException","httpStatus":null,"severity":"error","filePath":"flink/v2.3/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.3/flink/src/main/java/org/apache/iceberg/flink/sink/WriteResultSerializer.java#L43-L64","documentation":"WriteResultSerializer.deserialize throws this IOException when the version byte of the serialized payload does not match the expected CURRENT_VERSION, indicating data written by an incompatible serializer version or corrupt/truncated bytes.","triggerScenarios":"Reading a WriteResult-carrying committable from a checkpoint/savepoint produced by a different Iceberg/Flink connector version, or deserializing corrupted byte arrays.","commonSituations":"Iceberg upgrade/downgrade between job restarts from savepoint; state compatibility not enabled; corrupted committed-state storage.","solutions":["Restore with the connector version that originally wrote the checkpoint/savepoint","If the version change is intentional, drain the old job fully and start the new job without restoring committable state","Verify checkpoint storage integrity and fall back to an earlier checkpoint if corruption is suspected"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"try {\n  result = serializer.deserialize(version, view);\n} catch (IOException e) {\n  if (e.getMessage().contains(\"Unrecognized version\")) {\n    LOG.error(\"Incompatible WriteResult serializer version {} — restore with original job's Iceberg version\", version);\n  }\n  throw e;\n}","preventionTips":["Fully drain and finish old jobs before starting new-version jobs instead of cross-version savepoint restores","Enable Flink serializer version migration checks during upgrades","Keep checkpoint/backup history so you can fall back to a compatible checkpoint"],"tags":["flink","serialization","checkpointing","version-compatibility"],"backgroundTag":"checksum-mismatch","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"}