{"record":{"id":"eb323d34b6424ace","repo":"apache/iceberg","slug":"unsupported-version-eb323d","errorCode":null,"errorMessage":"Unsupported version: ","messagePattern":"Unsupported version: ","errorType":"exception","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"flink/v2.3/flink/src/main/java/org/apache/iceberg/flink/source/split/IcebergSourceSplit.java","lineNumber":179,"sourceCode":"\n      serializedBytesCache = out.getCopyOfBuffer();\n      out.clear();\n    }\n\n    return serializedBytesCache;\n  }\n\n  private static void writeTaskJson(DataOutputSerializer out, String taskJson, int version)\n      throws IOException {\n    switch (version) {\n      case 2:\n        out.writeUTF(taskJson);\n        break;\n      case 3:\n        SerializerHelper.writeLongUTF(out, taskJson);\n        break;\n      default:\n        throw new IllegalArgumentException(\"Unsupported version: \" + version);\n    }\n  }\n\n  static IcebergSourceSplit deserializeV2(byte[] serialized, boolean caseSensitive)\n      throws IOException {\n    return deserialize(serialized, caseSensitive, 2);\n  }\n\n  static IcebergSourceSplit deserializeV3(byte[] serialized, boolean caseSensitive)\n      throws IOException {\n    return deserialize(serialized, caseSensitive, 3);\n  }\n\n  private static IcebergSourceSplit deserialize(\n      byte[] serialized, boolean caseSensitive, int version) throws IOException {\n    DataInputDeserializer in = new DataInputDeserializer(serialized);\n    int fileOffset = in.readInt();\n    long recordOffset = in.readLong();","sourceCodeStart":161,"sourceCodeEnd":197,"githubUrl":"https://github.com/apache/iceberg/blob/86d9c8fc543e7c56c9f624eb725f76c9baff9570/flink/v2.3/flink/src/main/java/org/apache/iceberg/flink/source/split/IcebergSourceSplit.java#L161-L197","documentation":"writeTaskJson writes the task JSON string to the split's DataOutputSerializer using the format version requested by serialize(). Only versions 1-3 are handled; any other version value reaches the default branch and throws IllegalArgumentException with 'Unsupported version: '.","triggerScenarios":"Internal call serialize(version) with a version other than 1, 2, or 3 - practically only reachable if serializer code introduces a new version without updating writeTaskJson, or if a caller invokes the internal path with a wrong constant.","commonSituations":"Mismatched iceberg-flink module versions where one component writes a newer format version than the other supports; hand-rolled or patched serializer constants.","solutions":["Use the official serializeV1/serializeV2/serializeV3 entry points, which pin correct version constants.","Align iceberg-flink versions across the cluster/jar so writer and reader agree on the split format version.","If you patched the serializer, add the new version case to writeTaskJson before using the new constant."],"exampleFix":null,"handlingStrategy":"validation","validationCode":"if (version < 1 || version > 3) throw new IllegalArgumentException('split serialize version must be 1-3');","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Only call the public serializeV1/V2/V3 wrappers, never the internal versioned path","Keep writer and reader iceberg-flink versions aligned","Add a matching case in writeTaskJson before introducing a new format version constant"],"tags":["flink","serialization","versioning"],"backgroundTag":"invalid-enum-value","analyzedSha":"86d9c8fc543e7c56c9f624eb725f76c9baff9570","analyzedAt":"2026-09-12T00:46:39.097Z","contentChangedAt":"2026-09-12T00:46:39.097Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}