{"record":{"id":"df27f915e4902175","repo":"apache/cassandra","slug":"missing-replication-strategy-class","errorCode":null,"errorMessage":"Missing replication strategy class","messagePattern":"Missing replication strategy class","errorType":"validation","errorClass":"ConfigurationException","httpStatus":null,"severity":"error","filePath":"src/java/org/apache/cassandra/cql3/statements/schema/KeyspaceAttributes.java","lineNumber":57,"sourceCode":"    private static final Set<String> requiredKeywords;\n\n    static\n    {\n        ImmutableSet.Builder<String> validBuilder = ImmutableSet.builder();\n        for (Option option : Option.values())\n            validBuilder.add(option.toString());\n        validKeywords = validBuilder.build();\n        obsoleteKeywords = ImmutableSet.of();\n        requiredKeywords = ImmutableSet.of(Option.REPLICATION.toString());\n    }\n\n    public void validate()\n    {\n        validate(validKeywords, obsoleteKeywords);\n\n        Map<String, String> replicationOptions = getAllReplicationOptions();\n        if (!replicationOptions.isEmpty() && !replicationOptions.containsKey(ReplicationParams.CLASS))\n            throw new ConfigurationException(\"Missing replication strategy class\");\n\n        FastPathStrategy strategy = getFastPathStrategy();\n        if (strategy != null && strategy.kind() == FastPathStrategy.Kind.INHERIT_KEYSPACE)\n            throw new ConfigurationException(\"Cannot use keyspace inheriting fast path strategy with keyspaces\");\n    }\n    \n    public static Set<String> allKeywords()\n    {\n        return Sets.union(validKeywords, obsoleteKeywords);\n    }\n\n    public static Set<String> requiredKeywords()\n    {\n        return requiredKeywords;\n    }\n\n    public String getReplicationStrategyClass()\n    {","sourceCodeStart":39,"sourceCodeEnd":75,"githubUrl":"https://github.com/apache/cassandra/blob/88fd0f6a0eaed8943f05ac9e8f947882b8ddc8f1/src/java/org/apache/cassandra/cql3/statements/schema/KeyspaceAttributes.java#L39-L75","documentation":"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.","triggerScenarios":"CREATE/ALTER KEYSPACE WITH replication = {'replication_factor': 3} (missing 'class'); NetworkTopologyStrategy configs where the class key was accidentally dropped.","commonSituations":"Hand-edited cassandra DDL; tooling that emits only strategy-specific options; renaming 'class' to 'strategy_class' (old spelling removed).","solutions":["Add the class key, e.g. replication = {'class': 'SimpleStrategy', 'replication_factor': 3}","For multi-DC use 'class': 'NetworkTopologyStrategy' with per-DC factors"],"exampleFix":"// before\nCREATE KEYSPACE ks WITH replication = {'replication_factor': 3};\n// after\nCREATE KEYSPACE ks WITH replication = {'class': 'SimpleStrategy', 'replication_factor': 3};","handlingStrategy":"validation","validationCode":"function validateReplication(rep) {\n  if (rep && Object.keys(rep).length > 0 && !rep.class) {\n    throw new Error(\"replication map must include 'class'\");\n  }\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Always start replication maps with {'class': 'SimpleStrategy'|'NetworkTopologyStrategy'}","Never rely on deprecated 'strategy_class' spelling","Template keyspaces from a known-good example"],"tags":["cql","keyspace","replication","configuration"],"backgroundTag":"missing-required-config-field","analyzedSha":"88fd0f6a0eaed8943f05ac9e8f947882b8ddc8f1","analyzedAt":"2026-09-10T07:29:22.284Z","contentChangedAt":"2026-09-10T07:29:22.284Z","schemaVersion":2},"datasetVersion":"2026-09-14T11:17:12.474Z"}