{"record":{"id":"b5be80a27850dd86","repo":"apache/cassandra","slug":"index-build-of-failed-please-run-full-index-re","errorCode":null,"errorMessage":"Index build of {} failed. Please run full index rebuild to fix it.","messagePattern":"Index build of (.+?) failed\\. Please run full index rebuild to fix it\\.","errorType":"console","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"src/java/org/apache/cassandra/index/SecondaryIndexManager.java","lineNumber":897,"sourceCode":"\n            if (DatabaseDescriptor.isDaemonInitialized())\n                SystemKeyspace.setIndexRemoved(baseCfs.getKeyspaceName(), indexName);\n\n            needsFullRebuild.add(indexName);\n\n            if (!index.getSupportedLoadTypeOnFailure(isInitialBuild).supportsWrites() && writableIndexes.remove(indexName) != null)\n                logger.info(\"Index [{}] became not-writable because of failed build.\", indexName);\n\n            if (!index.getSupportedLoadTypeOnFailure(isInitialBuild).supportsReads() && queryableIndexes.remove(indexName))\n                logger.info(\"Index [{}] became not-queryable because of failed build.\", indexName);\n        }\n    }\n\n    private void logAndMarkIndexesFailed(Set<Index> indexes, Throwable indexBuildFailure, boolean isInitialBuild)\n    {\n        JVMStabilityInspector.inspectThrowable(indexBuildFailure);\n        if (indexBuildFailure != null)\n            logger.warn(\"Index build of {} failed. Please run full index rebuild to fix it.\", getIndexNames(indexes), indexBuildFailure);\n        else\n            logger.warn(\"Index build of {} failed. Please run full index rebuild to fix it.\", getIndexNames(indexes));\n        indexes.forEach(i -> this.markIndexFailed(i, isInitialBuild));\n    }\n\n    /**\n     * Marks the specified index as removed.\n     *\n     * @param indexName the index name\n     */\n    private synchronized void markIndexRemoved(String indexName)\n    {\n        SystemKeyspace.setIndexRemoved(baseCfs.getKeyspaceName(), indexName);\n        queryableIndexes.remove(indexName);\n        writableIndexes.remove(indexName);\n        needsFullRebuild.remove(indexName);\n        inProgressBuilds.remove(indexName);\n        // remove existing indexing status","sourceCodeStart":879,"sourceCodeEnd":915,"githubUrl":"https://github.com/apache/cassandra/blob/88fd0f6a0eaed8943f05ac9e8f947882b8ddc8f1/src/java/org/apache/cassandra/index/SecondaryIndexManager.java#L879-L915","documentation":"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.","triggerScenarios":"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.","commonSituations":"Index build racing with SSTable deletion/compaction; malformed custom index implementations; disk full during index write; failed upgrades leaving incompatible index metadata on disk.","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."],"exampleFix":"// before\nnodetool rebuild_index keyspace table index_name\n// after (if repeated): drop and recreate cleanly\n// DROP INDEX keyspace.index_name; CREATE INDEX ... ;","handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"try { session.execute(\"CREATE INDEX IF NOT EXISTS ...\"); } catch (Exception e) { // follow with rebuild\n session.execute(String.format(\"nodetool rebuild_index %s %s %s\", ks, table, indexName)); }","preventionTips":["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."],"tags":["index","index-build","secondary-index","rebuild"],"backgroundTag":"database-query-failed","analyzedSha":"88fd0f6a0eaed8943f05ac9e8f947882b8ddc8f1","analyzedAt":"2026-09-10T07:29:22.284Z","contentChangedAt":"2026-09-10T07:29:22.284Z","schemaVersion":2},"datasetVersion":"2026-09-14T16:17:12.679Z"}