{"record":{"id":"1e341bbd58ee95cd","repo":"apache/cassandra","slug":"you-cannot-use-more-than-one-flag-with-this-comman","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":"validation","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"warning","filePath":"src/java/org/apache/cassandra/tools/nodetool/GetInterDCStreamThroughput.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 inter-datacenter streaming in MiB/s\")\n    private boolean interDCStreamThroughputMiB;\n\n    @Option(names = { \"-d\", \"--precise-mbit\" }, description = \"Print the throughput cap for inter-datacenter streaming in precise Mbits (double)\")\n    private boolean interDCStreamThroughputDoubleMbit;\n\n    @Override\n    public void execute(NodeProbe probe)\n    {\n        int throughput;\n        double throughputInDouble;\n\n        if (entireSSTableThroughput)\n        {\n            if (interDCStreamThroughputDoubleMbit || interDCStreamThroughputMiB)\n                throw new IllegalArgumentException(\"You cannot use more than one flag with this command\");\n\n            throughputInDouble = probe.getEntireSSTableInterDCStreamThroughput();\n            probe.output().out.printf(\"Current entire SSTable inter-datacenter stream throughput: %s%n\",\n                                      throughputInDouble > 0 ? throughputInDouble + \" MiB/s\" : \"unlimited\");\n        }\n        else if (interDCStreamThroughputMiB)\n        {\n            if (interDCStreamThroughputDoubleMbit)\n                throw new IllegalArgumentException(\"You cannot use more than one flag with this command\");\n\n            throughputInDouble = probe.getInterDCStreamThroughputMibAsDouble();\n            probe.output().out.printf(\"Current inter-datacenter stream throughput: %s%n\",\n                                      throughputInDouble > 0 ? throughputInDouble + \" MiB/s\" : \"unlimited\");\n\n        }\n        else if (interDCStreamThroughputDoubleMbit)\n        {\n            throughputInDouble = probe.getInterDCStreamThroughputAsDouble();","sourceCodeStart":31,"sourceCodeEnd":67,"githubUrl":"https://github.com/apache/cassandra/blob/88fd0f6a0eaed8943f05ac9e8f947882b8ddc8f1/src/java/org/apache/cassandra/tools/nodetool/GetInterDCStreamThroughput.java#L31-L67","documentation":"GetInterDCStreamThroughput's entire-SSTable branch rejects combining the --entire-sstable-throughput flag with --inter-dcstream-throughput-mb (double Mbit) or --inter-dcstream-throughput-mib flags. Passing more than one mutually exclusive flag throws this IllegalArgumentException.","triggerScenarios":"Running `nodetool getinterdcstreamthroughput --entire-sstable-throughput --inter-dcstream-throughput-mb` or combining it with the -MiB flag.","commonSituations":"Scripts accumulating flags over time; operators unsure which throughput variant they want and passing several; copy-pasted command lines.","solutions":["Pass exactly one flag (or none for the default inter-DC Mbit view)","Remove --entire-sstable-throughput if you meant to query the MiB/Mbit values","Split queries: run the command once per flag you need"],"exampleFix":"// before\nnodetool getinterdcstreamthroughput --entire-sstable-throughput --inter-dcstream-throughput-mib\n// after\nnodetool getinterdcstreamthroughput --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":["Build nodetool flag lists with at most one unit flag","Document flag exclusivity in runbooks","Test wrapper scripts with each flag combination"],"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"}