apache/cassandra · error · ConfigurationException

Missing replication strategy class

Error message

Missing replication strategy class

What it means

KeyspaceAttributes.validate() requires that if any replication options are given for a keyspace, the replication strategy class (`replication = {'class': ...}`) must be present. A replication map without 'class' cannot determine the placement strategy, so a ConfigurationException is thrown.

Source

Thrown at src/java/org/apache/cassandra/cql3/statements/schema/KeyspaceAttributes.java:57

    private static final Set<String> requiredKeywords;

    static
    {
        ImmutableSet.Builder<String> validBuilder = ImmutableSet.builder();
        for (Option option : Option.values())
            validBuilder.add(option.toString());
        validKeywords = validBuilder.build();
        obsoleteKeywords = ImmutableSet.of();
        requiredKeywords = ImmutableSet.of(Option.REPLICATION.toString());
    }

    public void validate()
    {
        validate(validKeywords, obsoleteKeywords);

        Map<String, String> replicationOptions = getAllReplicationOptions();
        if (!replicationOptions.isEmpty() && !replicationOptions.containsKey(ReplicationParams.CLASS))
            throw new ConfigurationException("Missing replication strategy class");

        FastPathStrategy strategy = getFastPathStrategy();
        if (strategy != null && strategy.kind() == FastPathStrategy.Kind.INHERIT_KEYSPACE)
            throw new ConfigurationException("Cannot use keyspace inheriting fast path strategy with keyspaces");
    }
    
    public static Set<String> allKeywords()
    {
        return Sets.union(validKeywords, obsoleteKeywords);
    }

    public static Set<String> requiredKeywords()
    {
        return requiredKeywords;
    }

    public String getReplicationStrategyClass()
    {

View on GitHub (pinned to 88fd0f6a0e)

Solutions

  1. Add the class key, e.g. replication = {'class': 'SimpleStrategy', 'replication_factor': 3}
  2. For multi-DC use 'class': 'NetworkTopologyStrategy' with per-DC factors

Example fix

// before
CREATE KEYSPACE ks WITH replication = {'replication_factor': 3};
// after
CREATE KEYSPACE ks WITH replication = {'class': 'SimpleStrategy', 'replication_factor': 3};
Defensive patterns

Strategy: validation

Validate before calling

function validateReplication(rep) {
  if (rep && Object.keys(rep).length > 0 && !rep.class) {
    throw new Error("replication map must include 'class'");
  }
}

Prevention

When it happens

Trigger: CREATE/ALTER KEYSPACE WITH replication = {'replication_factor': 3} (missing 'class'); NetworkTopologyStrategy configs where the class key was accidentally dropped.

Common situations: Hand-edited cassandra DDL; tooling that emits only strategy-specific options; renaming 'class' to 'strategy_class' (old spelling removed).

Understand the failure class

Background: "is required", "must be set", "missing required field": configuration validation errors across open-source libraries — this error's family across 36 libraries.

Related errors


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