{"record":{"id":"efed85d80bc42da3","repo":"apache/druid","slug":"unknown-version-s-efed85","errorCode":null,"errorMessage":"Unknown version[%s]","messagePattern":"Unknown version\\[(.+?)\\]","errorType":"exception","errorClass":"IAE","httpStatus":null,"severity":"error","filePath":"processing/src/main/java/org/apache/druid/segment/data/CompressedBlockReader.java","lineNumber":108,"sourceCode":"      // move to start of compressed data\n      buffer.position(buffer.position() + offsetsSize);\n      final ByteBuffer compressedData = buffer.asReadOnlyBuffer().order(compressionOrder);\n      compressedData.limit(compressedData.position() + compressedSize);\n      buffer.position(buffer.position() + compressedSize);\n\n      final ByteBuffer compressedDataView = compressedData.slice().order(compressionOrder);\n      return () -> new CompressedBlockReader(\n          compression,\n          numBlocks,\n          blockSize,\n          copyValuesOnRead,\n          offsetView.asReadOnlyBuffer(),\n          compressedDataView.asReadOnlyBuffer().order(compressionOrder),\n          compressionOrder,\n          valueOrder\n      );\n    }\n    throw new IAE(\"Unknown version[%s]\", versionFromBuffer);\n  }\n\n  private final CompressionStrategy.Decompressor decompressor;\n\n  private final boolean copyValuesOnRead;\n  private final int numBlocks;\n  private final int div;\n  private final int rem;\n  private final IntBuffer endOffsetsBuffer;\n  private final ByteBuffer compressedDataBuffer;\n\n  private final ResourceHolder<ByteBuffer> decompressedDataBufferHolder;\n  private final ByteBuffer decompressedDataBuffer;\n\n  private final ByteOrder byteOrder;\n  private final Closer closer;\n  private int currentBlockNumber = -1;\n","sourceCodeStart":90,"sourceCodeEnd":126,"githubUrl":"https://github.com/apache/druid/blob/9b90983fd291f26935af934383ce360473179e4d/processing/src/main/java/org/apache/druid/segment/data/CompressedBlockReader.java#L90-L126","documentation":"CompressedBlockReader.fromByteBuffer throws IAE(\"Unknown version[%s]\") when the version byte at the start of a compressed block-format column does not match any version this Druid build can read. This is a segment-format compatibility check guarding against reading segments written by incompatible Druid versions.","triggerScenarios":"Opening a segment whose compressed column header carries a version byte newer (or unrecognized) than the reader supports — e.g., segments written by a newer Druid, corrupted segment files, or non-Druid bytes passed to the factory.","commonSituations":"Rolling upgrades where an older historical node reads segments produced by a newer Druid; segment files damaged or truncated on deep storage; custom code pointing the reader at the wrong buffer offset.","solutions":["Upgrade all Druid nodes (especially historicals/middle managers) to the version that wrote the segment","Re-ingest or re-index the affected segments with the running Druid version","Verify segment file integrity on deep storage (checksum/size) and restore from backup if corrupted","Check the segment's loadSpec and version metadata in metadata store for mismatch"],"exampleFix":"// before: old node reads new-format segment\n// after: upgrade and restart historicals to match writer version\n// e.g., bump Druid from 0.x to the release that added the new column version","handlingStrategy":"try-catch","validationCode":"// inspect the version byte before reading\nByteBuffer buf = columnBuffer.duplicate();\nbyte version = buf.get(0);\nif (!SUPPORTED_VERSIONS.contains(version)) {\n  throw new IllegalStateException(\"Segment version \" + version + \" not supported by this Druid build; upgrade\");\n}","typeGuard":null,"tryCatchPattern":"try {\n  reader = CompressedBlockReader.fromByteBuffer(...);\n} catch (IllegalArgumentException e) {\n  if (e.getMessage().startsWith(\"Unknown version\")) {\n    throw new SegmentFormatException(\"Upgrade Druid to read this segment\", e);\n  }\n  throw e;\n}","preventionTips":["Keep all Druid nodes on the same version","Upgrade historicals before letting coordinators serve new-format segments","Verify segment checksums after deep-storage restore","Pin segment writer version in deployment tooling"],"tags":["druid","segment","version","compatibility"],"backgroundTag":"unsupported-enum-value","analyzedSha":"9b90983fd291f26935af934383ce360473179e4d","analyzedAt":"2026-09-07T13:32:30.957Z","contentChangedAt":"2026-09-07T13:32:30.957Z","schemaVersion":2},"datasetVersion":"2026-09-14T11:17:12.474Z"}