{"record":{"id":"a1b1b343857cf43f","repo":"apache/druid","slug":"unknown-index-version-s","errorCode":null,"errorMessage":"Unknown index version[%s]","messagePattern":"Unknown index version\\[(.+?)\\]","errorType":"exception","errorClass":"IllegalStateException","httpStatus":null,"severity":"error","filePath":"processing/src/main/java/org/apache/druid/segment/IndexIO.java","lineNumber":224,"sourceCode":"      }\n    }\n  }\n\n  public QueryableIndex loadIndex(File inDir) throws IOException\n  {\n    return loadIndex(inDir, false, SegmentLazyLoadFailCallback.NOOP);\n  }\n\n  public QueryableIndex loadIndex(File inDir, boolean lazy, SegmentLazyLoadFailCallback loadFailed) throws IOException\n  {\n    final int version = SegmentUtils.getVersionFromDir(inDir);\n\n    final IndexLoader loader = indexLoaders.get(version);\n\n    if (loader != null) {\n      return loader.load(inDir, mapper, lazy, loadFailed);\n    } else {\n      throw new ISE(\"Unknown index version[%s]\", version);\n    }\n  }\n\n  public static void checkFileSize(File indexFile) throws IOException\n  {\n    final long fileSize = indexFile.length();\n    if (fileSize > Integer.MAX_VALUE) {\n      throw new IOE(\"File[%s] too large[%d]\", indexFile, fileSize);\n    }\n  }\n\n  interface IndexIOHandler\n  {\n    MMappedIndex mapDir(File inDir) throws IOException;\n  }\n\n  private static void validateRowValues(\n      RowPointer rp1,","sourceCodeStart":206,"sourceCodeEnd":242,"githubUrl":"https://github.com/apache/druid/blob/9b90983fd291f26935af934383ce360473179e4d/processing/src/main/java/org/apache/druid/segment/IndexIO.java#L206-L242","documentation":"IndexIO.loadIndex dispatches loading to an IndexLoader registered for the segment's index version (read from the version file). This IllegalStateException is thrown when the version string is not one of the known loaders (e.g. not '9:v9' or legacy v8), meaning Druid cannot load a segment written by an unrecognized or unsupported format.","triggerScenarios":"Loading a segment whose version file contains an unknown version string — segments written by a much newer Druid, corrupted version files, or fabricated index directories.","commonSituations":"Downgrading Druid below the version that wrote the segments; copying segments from a cluster running a newer Druid; manual segment directory manipulation or deep-storage corruption of the version file.","solutions":["Check the segment's version file content and compare with versions supported by your Druid build.","Upgrade Druid to a version that supports the segment's index version (never downgrade below the writer's version).","Re-ingest the data with the current Druid version to produce segments in a supported format.","If the version file is corrupted, restore the segment from a known-good copy in deep storage."],"exampleFix":null,"handlingStrategy":"validation","validationCode":"// before loadIndex, read the version file and check support\nString version = Files.toString(new File(inDir, \"version.bin\"), StandardCharsets.UTF_8).trim();\nif (!version.startsWith(\"9:\")) { // supported by this IndexIO build\n  throw new IllegalStateException(\"Unsupported segment version: \" + version);\n}","typeGuard":null,"tryCatchPattern":"try {\n  indexable = indexIO.loadIndex(segmentDir);\n} catch (ISE e) {\n  if (e.getMessage().startsWith(\"Unknown index version\")) {\n    log.error(\"Segment written by unsupported Druid version: %s\", e.getMessage());\n    // re-ingest data or upgrade Druid\n  }\n  throw e;\n}","preventionTips":["Never run a Druid version older than the one that wrote your segments.","Verify the version file after any segment copy from another cluster.","Re-ingest data rather than copying segments across incompatible Druid versions.","Monitor cluster version skew between historicals/overlords before rolling upgrades."],"tags":["segment-loading","indexio","version","unsupported"],"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-14T05:17:10.506Z"}