{"record":{"id":"9788ba5274f96f95","repo":"apache/cassandra","slug":"replication-factor-is-empty","errorCode":null,"errorMessage":"Replication factor is empty","messagePattern":"Replication factor is empty","errorType":"validation","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"src/java/org/apache/cassandra/tools/nodetool/CMSAdmin.java","lineNumber":163,"sourceCode":"                return;\n            }\n            if (resume)\n            {\n                if (!args.isEmpty())\n                    throw new IllegalArgumentException(\"Replication factor should not be set if previous operation is resumed\");\n\n                probe.getCMSOperationsProxy().resumeReconfigureCms();\n                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);","sourceCodeStart":145,"sourceCodeEnd":181,"githubUrl":"https://github.com/apache/cassandra/blob/88fd0f6a0eaed8943f05ac9e8f947882b8ddc8f1/src/java/org/apache/cassandra/tools/nodetool/CMSAdmin.java#L145-L181","documentation":"nodetool cms (reconfigure mode) requires at least one replication factor argument (either a single integer or dc:rf pairs). execute() throws IllegalArgumentException when args is empty and neither --resume nor --cancel was requested.","triggerScenarios":"Running 'nodetool cms' bare, or with only flags that empty out args, without '3' or 'dc1:3,dc2:5' style arguments.","commonSituations":"Forgetting the RF argument; a shell variable holding the RF resolved to empty; typo such as 'nodetool cms 3' with the '3' consumed by an unrelated flag.","solutions":["Supply a replication factor: nodetool cms 3","Or per-DC: nodetool cms dc1:3,dc2:5","Check shell variables/quotes so the RF argument actually reaches the command"],"exampleFix":"// before\nnodetool cms\n// after\nnodetool cms 3","handlingStrategy":"validation","validationCode":"if (args.length == 0)\n    throw new IllegalArgumentException(\"Usage: nodetool cms <rf> | nodetool cms dc1:rf1,dc2:rf2\");","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Always supply RF when using cms reconfigure mode","Quote arguments containing commas as one token","Verify shell variables expand to values"],"tags":["nodetool","cli","cms","replication"],"backgroundTag":"missing-required-argument","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"}