{"record":{"id":"6f5cbc3587f410b6","repo":"apache/cassandra","slug":"simple-placement-can-only-specify-a-single-replica","errorCode":null,"errorMessage":"Simple placement can only specify a single replication factor across all data centers","messagePattern":"Simple placement can only specify a single replication factor across all data centers","errorType":"validation","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"src/java/org/apache/cassandra/tools/nodetool/CMSAdmin.java","lineNumber":171,"sourceCode":"                return;\n            }\n\n            if (cancel)\n            {\n                probe.getCMSOperationsProxy().cancelReconfigureCms();\n                return;\n            }\n\n            if (args.isEmpty())\n                throw new IllegalArgumentException(\"Replication factor is empty\");\n\n            Map<String, Integer> parsedRfs = new HashMap<>(args.size());\n            for (String rf : args)\n            {\n                if (!rf.contains(\":\"))\n                {\n                    if (args.size() > 1)\n                        throw new IllegalArgumentException(\"Simple placement can only specify a single replication factor across all data centers\");\n                    int parsedRf;\n                    try\n                    {\n                        parsedRf = Integer.parseInt(args.get(0));\n                    }\n                    catch (Throwable t)\n                    {\n                        throw new IllegalArgumentException(String.format(\"Can not parse replication factor from %s\", args.get(0)));\n                    }\n                    probe.getCMSOperationsProxy().reconfigureCMS(parsedRf);\n                    return;\n                }\n                else\n                {\n                    String[] splits = rf.split(\":\");\n                    if (splits.length > 2)\n                        throw new IllegalArgumentException(String.format(\"Can not parse replication factor %s\", rf));\n                    String dc = splits[0];","sourceCodeStart":153,"sourceCodeEnd":189,"githubUrl":"https://github.com/apache/cassandra/blob/88fd0f6a0eaed8943f05ac9e8f947882b8ddc8f1/src/java/org/apache/cassandra/tools/nodetool/CMSAdmin.java#L153-L189","documentation":"With simple placement, nodetool cms accepts only ONE replication factor applying to all datacenters. execute() throws IllegalArgumentException when multiple positional args are given but none contains ':' — i.e. multiple plain integers were passed for a per-cluster RF.","triggerScenarios":"Running 'nodetool cms 3 5' or 'nodetool cms 3,5' (split into multiple args) intending per-DC factors but omitting the dc name prefixes.","commonSituations":"Trying to set different RF per DC without the dc: syntax; passing a comma-separated list that the shell splits into two args; misunderstanding simple vs. denormalized placement syntax.","solutions":["For a single cluster-wide RF pass one number: nodetool cms 3","For per-DC RFs use dc-prefixed args: nodetool cms dc1:3,dc2:5","Quote as a single arg if needed: nodetool cms \"dc1:3,dc2:5\""],"exampleFix":"// before\nnodetool cms 3 5\n// after\nnodetool cms dc1:3,dc2:5","handlingStrategy":"validation","validationCode":"if (rfArgs.stream().noneMatch(a -> a.contains(\":\")) && rfArgs.size() > 1)\n    throw new IllegalArgumentException(\"Use one plain RF for all DCs, or dc:rf pairs\");","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Use dc:rf syntax for per-DC replication","Pass a single integer for cluster-wide RF","Quote comma lists so they arrive as one arg"],"tags":["nodetool","cli","cms","replication"],"backgroundTag":"invalid-argument-value","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"}