{"record":{"id":"3d93f4712e1f340c","repo":"apache/druid","slug":"unknown-version-s-3d93f4","errorCode":null,"errorMessage":"Unknown version[%s]","messagePattern":"Unknown version\\[(.+?)\\]","errorType":"exception","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"processing/src/main/java/org/apache/druid/segment/data/VSizeColumnarInts.java","lineNumber":213,"sourceCode":"\n  public static VSizeColumnarInts readFromByteBuffer(ByteBuffer buffer)\n  {\n    byte versionFromBuffer = buffer.get();\n\n    if (VERSION == versionFromBuffer) {\n      int numBytes = buffer.get();\n      int size = buffer.getInt();\n      ByteBuffer bufferToUse = buffer.asReadOnlyBuffer();\n      bufferToUse.limit(bufferToUse.position() + size);\n      buffer.position(bufferToUse.limit());\n\n      return new VSizeColumnarInts(\n          bufferToUse,\n          numBytes\n      );\n    }\n\n    throw new IAE(\"Unknown version[%s]\", versionFromBuffer);\n  }\n\n  @Override\n  public void close()\n  {\n    // Do nothing\n  }\n\n  @Override\n  public void inspectRuntimeShape(RuntimeShapeInspector inspector)\n  {\n    inspector.visit(\"buffer\", buffer);\n  }\n}\n","sourceCodeStart":195,"sourceCodeEnd":228,"githubUrl":"https://github.com/apache/druid/blob/9b90983fd291f26935af934383ce360473179e4d/processing/src/main/java/org/apache/druid/segment/data/VSizeColumnarInts.java#L195-L228","documentation":"VSizeColumnarInts.readFromByteBuffer reads a version byte and deserializes accordingly; a version byte matching no known version throws this IAE. It means the buffer is not a valid serialized VSizeColumnarInts — corrupted, misaligned, or written by an incompatible format/version.","triggerScenarios":"Calling VSizeColumnarInts.readFromByteBuffer on a buffer whose leading byte is not a supported version marker — reading a foreign column format, or a buffer positioned mid-payload.","commonSituations":"Segment files produced by a different Druid version, custom serialization code writing raw ints without a version header, or offsets pointing at the wrong column boundary.","solutions":["Ensure segments are written by a compatible Druid version; re-ingest or upgrade if needed","Verify the buffer position points at the column's start (version byte), not into its body","Check file integrity and re-fetch the segment from deep storage","For custom writers, serialize with VSizeColumnarInts.writeTo/its serializer so the version header is present"],"exampleFix":"// before\nByteBuffer col = wholeBuffer.slice(); col.position(start + 1); // skipped version byte\nVSizeColumnarInts ints = VSizeColumnarInts.readFromByteBuffer(col);\n// after\nByteBuffer col = wholeBuffer.slice(); col.position(start);\nVSizeColumnarInts ints = VSizeColumnarInts.readFromByteBuffer(col);","handlingStrategy":"validation","validationCode":"if (buffer.remaining() < 1) throw new IllegalStateException(\"buffer too short\");\nbyte version = buffer.get(buffer.position());\nif (version != VSizeColumnarInts.VERSION) throw new IllegalStateException(\"unsupported version \" + version);","typeGuard":"boolean isSupportedVersion(ByteBuffer buf) { return buf.remaining() >= 1 && buf.get(buf.position()) == VSizeColumnarInts.VERSION; }","tryCatchPattern":"try { col = VSizeColumnarInts.readFromByteBuffer(buffer); } catch (IAE e) { if (e.getMessage().startsWith(\"Unknown version\")) { /* reload/repair segment */ } else throw e; }","preventionTips":["Never hand-write column bytes without the version header","Check buffer position/alignment before deserializing","Keep Druid versions consistent across writers and readers"],"tags":["serialization","deserialization","segment-data"],"backgroundTag":"invalid-argument-format","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"}