{"record":{"id":"b74aeb073aedd68f","repo":"apache/iceberg","slug":"unsupported-version-b74aeb","errorCode":null,"errorMessage":"Unsupported version: ","messagePattern":"Unsupported version: ","errorType":"validation","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"flink/v2.2/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.2/flink/src/main/java/org/apache/iceberg/flink/source/split/IcebergSourceSplit.java#L161-L197","documentation":"IcebergSourceSplit.writeTaskJson serializes the TableScan task JSON differently per version (2 = writeUTF, 3 = writeLongUTF for large payloads). This IllegalArgumentException is thrown for any other version value.","triggerScenarios":"An internal/programmatic call to serialize with a version other than 2 or 3 (serialize(1) goes through a different Java-serialization path; anything else hits this).","commonSituations":"Custom fork or test code calling serialize/writeTaskJson with a wrong version constant; version constant typos.","solutions":["Only use serialize(2) or serialize(3) (serializeV2/serializeV3 helpers)","Use the public IcebergSourceSplitSerializer instead of calling writeTaskJson directly","Fix any hardcoded version constant to 2 or 3"],"exampleFix":"// before\nbyte[] bytes = split.serialize(4);\n// after\nbyte[] bytes = split.serializeV3();","handlingStrategy":"validation","validationCode":"// only call supported versions\nif (version != 2 && version != 3) {\n  throw new IllegalArgumentException(\"Use serializeV2()/serializeV3() only\");\n}","typeGuard":null,"tryCatchPattern":"try {\n  byte[] bytes = split.serializeV3();\n} catch (IllegalArgumentException e) {\n  LOG.error(\"Unsupported split serialization version requested\", e);\n  throw e;\n}","preventionTips":["Always use the serializeV2()/serializeV3() helpers instead of raw serialize(n)","Use version 3 for large task JSON (>64KB) to avoid writeUTF limits","Don't call package-private writeTaskJson from outside the split class"],"tags":["flink","serialization","version-incompatibility","illegal-argument"],"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-14T16:17:12.679Z"}