apache/druid · error · org.apache.druid.java.util.common.RE

Failed to deserialize V

Error message

Failed to deserialize V%s column.

What it means

ScalarStringColumnAndIndexSupplier.read() catches IOException thrown while deserializing a nested string column (dictionary, encoded values, or value indexes) and rethrows it as this RuntimeException with the column version. It indicates the column's on-disk bytes could not be parsed.

Solutions

  1. Drop the affected segment from the historical/cache and re-download it from deep storage
  2. Re-ingest or re-compact the affected time chunk to rebuild the segment
  3. Check storage health (disk errors, free space) and validate segment files against deep-storage checksums
  4. If it follows a Druid upgrade, re-serialize segments with the new version's writer
Defensive patterns

Strategy: try-catch

Validate before calling

// Validate segment directory completeness before load
for (String required : new String[]{"meta.smoosh", "00000.smoosh", "factory.json"}) {
  File f = new File(segmentDir, required);
  if (!f.isFile() || f.length() == 0) {
    throw new IOException("Segment missing/incomplete part: " + f);
  }
}

Try / catch

try {
  // load nested string column indexes
} catch (RuntimeException e) {
  if (e.getCause() instanceof IOException) {
    LOG.error(e, "Failed to read string column of %s; dropping cache entry and rerouting", segmentId);
    segmentCache.drop(segmentId);
    queryScheduler.reroute(segmentId);
  } else {
    throw e;
  }
}

Prevention

When it happens

Trigger: IOException during column part-file reads: truncated or corrupt segment files, failed checksum, partially written segment from a crashed merge/compaction, or unreadable cache/deep-storage copy.

Common situations: Hardware/storage failures corrupting historical segment directories; interrupted segment push leaving partial data in deep storage that is later read; cache holding a truncated segment.

Understand the failure class

Background: "failed to read file", EACCES, ENOENT and "could not read <path>" errors: when a program can't read a file from disk — this error's family across 49 libraries.

Related errors


AI-assisted analysis of apache/druid@9b90983fd2 (2026-09-07). Data as JSON: /api/errors/50dabb158139ad43. Report an issue: GitHub.

Appendix: source

Thrown at processing/src/main/java/org/apache/druid/segment/nested/ScalarStringColumnAndIndexSupplier.java:109

        final ByteBuffer valueIndexBuffer = NestedCommonFormatColumnPartSerde.loadInternalFile(
            mapper,
            columnName,
            ColumnSerializerUtils.BITMAP_INDEX_FILE_NAME
        );
        GenericIndexed<ImmutableBitmap> valueIndexes = GenericIndexed.read(
            valueIndexBuffer,
            bitmapSerdeFactory.getObjectStrategy(),
            columnBuilder.getFileMapper()
        );
        return new ScalarStringColumnAndIndexSupplier(
            dictionarySupplier,
            ints,
            valueIndexes,
            bitmapSerdeFactory
        );
      }
      catch (IOException ex) {
        throw new RE(ex, "Failed to deserialize V%s column.", version);
      }
    } else {
      throw new RE("Unknown version " + version);
    }
  }


  private final Supplier<? extends Indexed<ByteBuffer>> dictionarySupplier;
  private final Supplier<ColumnarInts> encodedColumnSupplier;
  private final GenericIndexed<ImmutableBitmap> valueIndexes;
  private final ColumnIndexSupplier stringIndexSupplier;
  private final BitmapSerdeFactory serdeFactory;

  private ScalarStringColumnAndIndexSupplier(
      Supplier<? extends Indexed<ByteBuffer>> dictionarySupplier,
      Supplier<ColumnarInts> encodedColumnSupplier,
      GenericIndexed<ImmutableBitmap> valueIndexes,
      BitmapSerdeFactory serdeFactory

View on GitHub (pinned to 9b90983fd2)