apache/cassandra · error
Failed to go to the next entry in index
Error message
Failed to go to the next entry in index
What it means
In seekToNextPartition, after failing to seek in the data file, the scrubber attempts indexIterator.advance() to move to the next index entry. If that throws, this warning is logged and the exception is rethrown cleaned, aborting the scrub loop — neither the data file nor the index can be advanced, so no further recovery is possible.
Solutions
- Do not retry scrub on these files; they are beyond in-place recovery.
- Restore the sstable set from a snapshot/backup and run `nodetool repair` to reconcile with replicas.
- If only some sstables are affected, move corrupt files out of the data directory, run repair, then remove the quarantined files.
- Check storage subsystem health before returning the node to service.
Example fix
// Quarantine instead of forcing scrub: // before: repeated scrub failures on same sstable // after: $ nodetool drain $ mv <bad-sstable-components> /tmp/quarantine/ $ nodetool repair <keyspace> <table>
Defensive patterns
Strategy: fallback
Try / catch
// Abort maintenance on unrecoverable scrub failures and restore from backup
try {
scrubber.scrub();
} catch (Throwable t) {
// scrub rethrows cleaned fatal index errors; stop, quarantine, restore
logger.error("Scrub unrecoverable; restore from snapshot and repair", t);
} Prevention
- Always keep a recent validated snapshot before running scrub on suspect sstables.
- Quarantine repeatedly failing sstables instead of retrying scrub indefinitely.
- Ensure replication exists elsewhere before deleting/quarantining local sstables.
- Investigate storage health after any scrub-abort; it usually means physical corruption.
When it happens
Trigger: `nodetool scrub` on a BTI sstable where both data seek failed and PartitionIndex.advance() throws — deeply corrupt index trie or unreadable index file blocks.
Common situations: Severely corrupted sstables after disk failure; index file truncated or zero-length while Data.db has content; restore mixing incompatible index and data components.
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
- Failed to advance to the next index position. Index is…
- First position reported by index should be 0, was
- Data file partition position
- Data file partition position
- Error reading partition
AI-assisted analysis of apache/cassandra@88fd0f6a0e (2026-09-10).
Data as JSON: /api/errors/76b463bac7ba9f59.
Report an issue: GitHub.
Appendix: source
Thrown at src/java/org/apache/cassandra/io/sstable/format/bti/BtiTableScrubber.java:280
try
{
dataFile.seek(nextRowPositionFromIndex);
return true;
}
catch (Throwable th)
{
throwIfFatal(th);
outputHandler.warn(th, "Failed to seek to next row position %d", nextRowPositionFromIndex);
badPartitions++;
}
try
{
indexIterator.advance();
}
catch (Throwable th)
{
outputHandler.warn(th, "Failed to go to the next entry in index");
throw Throwables.cleaned(th);
}
}
return false;
}
@Override
protected void throwIfCannotContinue(DecoratedKey key, Throwable th)
{
if (isIndex)
{
outputHandler.warn("An error occurred while scrubbing the partition with key '%s' for an index table. " +
"Scrubbing will abort for this table and the index will be rebuilt.", keyString(key));
throw new IOError(th);
}
super.throwIfCannotContinue(key, th);View on GitHub (pinned to 88fd0f6a0e)