apache/cassandra · warning
Index build of {} failed. Please run full index rebuild to f
Error message
Index build of {} failed. Please run full index rebuild to fix it. What it means
logAndMarkIndexesFailed records that building the given indexes failed: it inspects the throwable for JVM-stopping decisions (e.g. OOM/WTD), logs this WARN including the exception, and marks every index as FAILED so it will not be used for queries. The message instructs the operator to run a full index rebuild because the incremental build left the index unusable.
Source
Thrown at src/java/org/apache/cassandra/index/SecondaryIndexManager.java:897
if (DatabaseDescriptor.isDaemonInitialized())
SystemKeyspace.setIndexRemoved(baseCfs.getKeyspaceName(), indexName);
needsFullRebuild.add(indexName);
if (!index.getSupportedLoadTypeOnFailure(isInitialBuild).supportsWrites() && writableIndexes.remove(indexName) != null)
logger.info("Index [{}] became not-writable because of failed build.", indexName);
if (!index.getSupportedLoadTypeOnFailure(isInitialBuild).supportsReads() && queryableIndexes.remove(indexName))
logger.info("Index [{}] became not-queryable because of failed build.", indexName);
}
}
private void logAndMarkIndexesFailed(Set<Index> indexes, Throwable indexBuildFailure, boolean isInitialBuild)
{
JVMStabilityInspector.inspectThrowable(indexBuildFailure);
if (indexBuildFailure != null)
logger.warn("Index build of {} failed. Please run full index rebuild to fix it.", getIndexNames(indexes), indexBuildFailure);
else
logger.warn("Index build of {} failed. Please run full index rebuild to fix it.", getIndexNames(indexes));
indexes.forEach(i -> this.markIndexFailed(i, isInitialBuild));
}
/**
* Marks the specified index as removed.
*
* @param indexName the index name
*/
private synchronized void markIndexRemoved(String indexName)
{
SystemKeyspace.setIndexRemoved(baseCfs.getKeyspaceName(), indexName);
queryableIndexes.remove(indexName);
writableIndexes.remove(indexName);
needsFullRebuild.remove(indexName);
inProgressBuilds.remove(indexName);
// remove existing indexing statusView on GitHub (pinned to 88fd0f6a0e)
Solutions
- Read the attached exception in the log to identify the root cause.
- Run `nodetool rebuild_index <keyspace> <table> <index>` (or ALTER TABLE ... DROP INDEX and re-CREATE) as the message suggests.
- Check disk space and SSTable integrity if IOExceptions appear.
- Query paths will return the index as failed/unavailable until the rebuild succeeds.
Example fix
// before nodetool rebuild_index keyspace table index_name // after (if repeated): drop and recreate cleanly // DROP INDEX keyspace.index_name; CREATE INDEX ... ;
Defensive patterns
Strategy: try-catch
Try / catch
try { session.execute("CREATE INDEX IF NOT EXISTS ..."); } catch (Exception e) { // follow with rebuild
session.execute(String.format("nodetool rebuild_index %s %s %s", ks, table, indexName)); } Prevention
- Read the attached exception before rebuilding to fix root causes (disk, corruption).
- Run repair if SSTables were deleted under the build.
- Schedule index builds during low-traffic periods.
- Keep custom Index implementations well-tested for build-time exceptions.
When it happens
Trigger: Called from buildIndexesBlocking, buildIndex, or the asynchronous onFailure callback when an index build future fails with a non-null Throwable — e.g. IOException reading SSTables, custom Index.build throwing, or disk errors.
Common situations: Index build racing with SSTable deletion/compaction; malformed custom index implementations; disk full during index write; failed upgrades leaving incompatible index metadata on disk.
Understand the failure class
Background: Database query failed: Internal Server Error 500s wrapping SQL, Prisma, and connection failures — what to check first — this error's family across 16 libraries.
Related errors
- Invalid index specified: %s/%s.
- 0x0000
- Unable to propagate index status: {}
- Cannot use transient replication on keyspaces using secondar
- SASI indexes are disabled. Enable in cassandra.yaml to use.
AI-assisted analysis of apache/cassandra@88fd0f6a0e (2026-09-10).
Data as JSON: /api/errors/b5be80a27850dd86.
Report an issue: GitHub.