apache/cassandra · critical · RuntimeException

Could not initialize CMS lookup

Error message

Could not initialize CMS lookup

What it means

Startup.initializeCMSLookup verifies, after replaying the log and adding the CMS lookup LogListener, that the replayed metadata allows the CMS lookup to be initialized. If the replayed ClusterMetadata does not satisfy the expected conditions (the replayed epoch/membership cannot establish the CMS lookup), it throws RuntimeException 'Could not initialize CMS lookup'. This aborts startup because the node cannot resolve which nodes constitute the Cluster Metadata Service.

Source

Thrown at src/java/org/apache/cassandra/tcm/Startup.java:388

                        logger.info("Added override for {}, ({} -> {})", confirmed, prev, next);
                        builder = builder.withOverride(confirmed, prev, next);
                    }
                }

                if (!builder.hasOverrides())
                {
                    logger.info("No overrides required for CMS members");
                    return replayed;
                }

                if (replayed.initCMSLookup(builder.build()))
                {
                    logger.info("Adding CMS lookup log listener");
                    ClusterMetadataService.instance().log().addListener(new CMSLookup.LogListener());
                    return replayed;
                }
                else
                    throw new RuntimeException("Could not initialize CMS lookup");
            }
        }
        else
        {
            throw new RuntimeException(String.format("Unable to identify a quorum of CMS members (found %s, required %s). " +
                                                     "If attemping rediscovery after multiple endpoint changes, check that" +
                                                     "seeds have been correctly updated.",
                                                     confirmedCMS.size(), quorum));
        }
    }

    public static void scrubDataDirectories(ClusterMetadata metadata) throws StartupException
    {
        // clean up debris in the rest of the keyspaces
        for (KeyspaceMetadata keyspace : metadata.schema.getKeyspaces())
        {
            // Skip system as we've already cleaned it
            if (keyspace.name.equals(SchemaConstants.SYSTEM_KEYSPACE_NAME) || keyspace.name.equals(SchemaConstants.ACCORD_KEYSPACE_NAME))

View on GitHub (pinned to 88fd0f6a0e)

Solutions

  1. Inspect the TCM log replay output/logs to see why the replayed metadata could not establish the CMS lookup.
  2. Verify the CMS members recorded in the metadata are current, reachable nodes (nodetool cms show).
  3. If log segments are corrupt, restore from a consistent backup or re-bootstrap the node from seeds.
  4. Ensure all nodes run compatible Cassandra versions with matching TCM log serialization.
  5. Retry startup once the CMS quorum is healthy and the log is intact.
Defensive patterns

Strategy: retry

Try / catch

try { Startup.initializeCMSLookup(...); }
catch (RuntimeException e) {
    if ("Could not initialize CMS lookup".equals(e.getMessage())) {
        // verify log integrity and CMS membership, then retry after operator intervention
    } else throw e;
}

Prevention

When it happens

Trigger: initializeCMSLookup replays the metadata log, adds CMSLookup.LogListener, but the post-replay state does not yield a resolvable CMS configuration, hitting the else branch that throws.

Common situations: Corrupted or incomplete TCM log replay; the cluster's CMS membership in the replayed metadata is empty/inconsistent; partial log segments after a crash; mixing nodes with incompatible TCM log formats.

Understand the failure class

Background: "This is a bug, please report it": internal invariant violations, unreachable panics, and SNH errors explained — this error's family across 47 libraries.

Related errors


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