{"record":{"id":"6a79b20d33cfad1b","repo":"apache/druid","slug":"unknown-version-s-6a79b2","errorCode":null,"errorMessage":"Unknown version[%s]","messagePattern":"Unknown version\\[(.+?)\\]","errorType":"validation","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"processing/src/main/java/org/apache/druid/segment/data/GenericIndexed.java","lineNumber":207,"sourceCode":"      ObjectStrategy<T> strategy,\n      @Nullable SegmentFileMapper fileMapper\n  )\n  {\n    byte versionFromBuffer = buffer.get();\n\n    if (VERSION_ONE == versionFromBuffer) {\n      return createGenericIndexedVersionOne(buffer, strategy);\n    } else if (VERSION_TWO == versionFromBuffer) {\n      if (fileMapper == null) {\n        throw DruidException.defensive(\n            \"use read(ByteBuffer buffer, ObjectStrategy<T> strategy, SegmentFileMapper fileMapper)\"\n            + \" with non-null fileMapper to read version 2 indexed.\"\n        );\n      }\n      return createGenericIndexedVersionTwo(buffer, strategy, fileMapper);\n    }\n\n    throw new IAE(\"Unknown version[%s]\", versionFromBuffer);\n  }\n\n  public static <T> GenericIndexed<T> fromArray(T[] objects, ObjectStrategy<T> strategy)\n  {\n    return fromIterable(Arrays.asList(objects), strategy);\n  }\n\n  public static GenericIndexed<ResourceHolder<ByteBuffer>> ofCompressedByteBuffers(\n      Iterable<ByteBuffer> buffers,\n      CompressionStrategy compression,\n      int bufferSize,\n      ByteOrder order,\n      Closer closer\n  )\n  {\n    return fromIterableVersionOne(\n        buffers,\n        GenericIndexedWriter.compressedByteBuffersWriteObjectStrategy(compression, bufferSize, closer),","sourceCodeStart":189,"sourceCodeEnd":225,"githubUrl":"https://github.com/apache/druid/blob/9b90983fd291f26935af934383ce360473179e4d/processing/src/main/java/org/apache/druid/segment/data/GenericIndexed.java#L189-L225","documentation":"GenericIndexed.read() dispatches on a version byte read from the serialized header; only versions 1 and 2 are supported. When the buffer's version byte is anything else, it throws IAE 'Unknown version'. This almost always means the data being read is not a GenericIndexed (wrong offset, wrong file, or corrupt/truncated data), since persisted files are written by this same class.","triggerScenarios":"read(ByteBuffer, ObjectStrategy, ObjectMapper) or read(ByteBuffer, ObjectStrategy) with a buffer whose first byte is not 1 or 2; misaligned reads where the buffer does not start at a GenericIndexed header.","commonSituations":"Reading a segment file written by an incompatible/newer Druid version, pointing at the wrong file offset after a format change, or corrupted segment files on disk.","solutions":["Verify the buffer is positioned exactly at the start of the GenericIndexed blob (check offsets in the segment metadata).","Confirm the segment was written by a compatible Druid version; re-ingest or re-version segments if the format is newer.","Validate segment files for corruption (checksums, druid segment validation tools) and re-download/re-generate them."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":"byte version = buffer.get(buffer.position());\nif (version != 1 && version != 2) throw new IOException(\"Not a GenericIndexed blob, version byte=\" + version);","typeGuard":"boolean looksLikeGenericIndexed(ByteBuffer buf) { int p = buf.position(); byte v = buf.get(p); return v == 1 || v == 2; }","tryCatchPattern":"try { return GenericIndexed.read(buffer, strategy, mapper); } catch (IAE e) { throw new SegmentCorruptException(\"Unknown GenericIndexed version; segment may be corrupt or from an incompatible Druid version\", e); }","preventionTips":["Ensure buffers are positioned exactly at the GenericIndexed header","Keep Druid versions consistent between writing and reading nodes","Validate segment files after download/load"],"tags":["java","deserialization","segment-format"],"backgroundTag":"invalid-enum-value","analyzedSha":"9b90983fd291f26935af934383ce360473179e4d","analyzedAt":"2026-09-07T13:32:30.957Z","contentChangedAt":"2026-09-07T13:32:30.957Z","schemaVersion":2},"datasetVersion":"2026-09-17T15:17:12.973Z"}