{"record":{"id":"3b5f88d3cc5fb32a","repo":"apache/cassandra","slug":"you-cannot-use-more-than-one-flag-with-this-comman-3b5f88","errorCode":null,"errorMessage":"You cannot use more than one flag with this command","messagePattern":"You cannot use more than one flag with this command","errorType":"console","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"warning","filePath":"src/java/org/apache/cassandra/tools/nodetool/GetStreamThroughput.java","lineNumber":49,"sourceCode":"    @Option(names = { \"-e\", \"--entire-sstable-throughput\" }, description = \"Print entire SSTable streaming throughput in MiB/s\")\n    private boolean entireSSTableThroughput;\n\n    @Option(names = { \"-m\", \"--mib\" }, description = \"Print the throughput cap for streaming in MiB/s\")\n    private boolean streamThroughputMiB;\n\n    @Option(names = { \"-d\", \"--precise-mbit\" }, description = \"Print the throughput cap for streaming in precise Mbits (double)\")\n    private boolean streamThroughputDoubleMbit;\n\n    @Override\n    public void execute(NodeProbe probe)\n    {\n        int throughput;\n        double throughputInDouble;\n\n        if (entireSSTableThroughput)\n        {\n            if (streamThroughputDoubleMbit || streamThroughputMiB)\n                throw new IllegalArgumentException(\"You cannot use more than one flag with this command\");\n\n            throughputInDouble = probe.getEntireSSTableStreamThroughput();\n            probe.output().out.printf(\"Current entire SSTable stream throughput: %s%n\",\n                                      throughputInDouble > 0 ? throughputInDouble + \" MiB/s\" : \"unlimited\");\n        }\n        else if (streamThroughputMiB)\n        {\n            if (streamThroughputDoubleMbit)\n                throw new IllegalArgumentException(\"You cannot use more than one flag with this command\");\n\n            throughputInDouble = probe.getStreamThroughputMibAsDouble();\n            probe.output().out.printf(\"Current stream throughput: %s%n\",\n                                      throughputInDouble > 0 ? throughputInDouble + \" MiB/s\" : \"unlimited\");\n        }\n        else if (streamThroughputDoubleMbit)\n        {\n            throughputInDouble = probe.getStreamThroughputAsDouble();\n            probe.output().out.printf(\"Current stream throughput: %s%n\",","sourceCodeStart":31,"sourceCodeEnd":67,"githubUrl":"https://github.com/apache/cassandra/blob/88fd0f6a0eaed8943f05ac9e8f947882b8ddc8f1/src/java/org/apache/cassandra/tools/nodetool/GetStreamThroughput.java#L31-L67","documentation":"GetStreamThroughput's entire-SSTable branch rejects combining --entire-sstable-throughput with --stream-throughput-mb or --stream-throughput-mib. Passing more than one of these mutually exclusive flags throws this IllegalArgumentException.","triggerScenarios":"Running `nodetool getstreamthroughput --entire-sstable-throughput --stream-throughput-mib` (or the -mb variant).","commonSituations":"Scripts that grew flags over time; operators exploring throughput options and stacking flags.","solutions":["Pass only one flag per invocation","Query each throughput variant in separate commands","Drop --entire-sstable-throughput if the MiB/Mbit view was intended"],"exampleFix":"// before\nnodetool getstreamthroughput --entire-sstable-throughput --stream-throughput-mb\n// after\nnodetool getstreamthroughput --entire-sstable-throughput","handlingStrategy":"validation","validationCode":"COUNT=$((${ENTIRE:+1} + ${MB:+1} + ${MIB:+1})); [ \"$COUNT\" -le 1 ] || { echo 'only one flag allowed'; exit 1; }","typeGuard":null,"tryCatchPattern":"try { run(args); } catch (IllegalArgumentException e) { usage(\"flags are mutually exclusive\"); }","preventionTips":["Never stack throughput flags in one invocation","Run separate commands per throughput view","Pin nodetool command lines in automation to tested forms"],"tags":["nodetool","cli","flags"],"backgroundTag":"mutually-exclusive-flags","analyzedSha":"88fd0f6a0eaed8943f05ac9e8f947882b8ddc8f1","analyzedAt":"2026-09-10T07:29:22.284Z","contentChangedAt":"2026-09-10T07:29:22.284Z","schemaVersion":2},"datasetVersion":"2026-09-17T15:17:12.973Z"}