apache/cassandra · warning

Missing index component

Error message

Missing index component

What it means

When constructing a BTI-format scrubber, the sstable's PARTITION_INDEX component is absent. The scrubber warns 'Missing index component' and scrubs without the partition index, losing the ability to validate or skip partitions using index positions.

Solutions

  1. Restore the -PartitionIndex.db from a snapshot or stream the sstable from a replica
  2. Run `nodetool repair` so a healthy replica replaces the sstable
  3. Proceed with scrub knowing partitions cannot be index-validated (corrupt partitions can't be skipped)
  4. Rebuild the node if many sstables lack components

Example fix

// before: scrubbing BTI sstable without partition index
outputHandler.warn("Missing index component");
// after: pre-flight component check
if (!sstable.getComponents().contains(Components.PARTITION_INDEX))
    throw new IllegalStateException("Restore PARTITION_INDEX before scrubbing " + sstable);
Defensive patterns

Strategy: validation

Validate before calling

Set<Component> comps = sstable.getComponents();
if (!comps.contains(Components.PARTITION_INDEX))
    throw new IllegalStateException(sstable + " lacks PARTITION_INDEX; restore from snapshot/replica before scrub");

Prevention

When it happens

Trigger: BtiTableScrubber constructor: sstable.getComponents().contains(Components.PARTITION_INDEX) is false — the -PartitionIndex.db file is missing from the sstable's files on disk.

Common situations: Incomplete restores/backups, manual deletion of index files, moving sstables between nodes with missing components, failed writes leaving partial sstables.

Understand the failure class

Background: "File not found" and ENOENT errors: why libraries can't find a file that should exist — this error's family across 50 libraries.

Related errors


AI-assisted analysis of apache/cassandra@88fd0f6a0e (2026-09-10). Data as JSON: /api/errors/87af7f7ffd3045f0. Report an issue: GitHub.

Appendix: source

Thrown at src/java/org/apache/cassandra/io/sstable/format/bti/BtiTableScrubber.java:61

{
    private final boolean isIndex;
    private final AbstractType<?> partitionKeyType;
    private ScrubPartitionIterator indexIterator;

    public BtiTableScrubber(ColumnFamilyStore cfs,
                            LifecycleTransaction transaction,
                            OutputHandler outputHandler,
                            IScrubber.Options options)
    {
        super(cfs, transaction, outputHandler, options);

        boolean hasIndexFile = sstable.getComponents().contains(Components.PARTITION_INDEX);
        this.isIndex = cfs.isIndex();
        this.partitionKeyType = cfs.metadata.get().partitionKeyType;
        if (!hasIndexFile)
        {
            // if there's any corruption in the -Data.db then partitions can't be skipped over. but it's worth a shot.
            outputHandler.warn("Missing index component");
        }

        try
        {
            this.indexIterator = hasIndexFile
                                 ? openIndexIterator()
                                 : null;
        }
        catch (RuntimeException ex)
        {
            outputHandler.warn("Detected corruption in the index file - cannot open index iterator", ex);
        }
    }

    private ScrubPartitionIterator openIndexIterator()
    {
        try
        {

View on GitHub (pinned to 88fd0f6a0e)