apache/cassandra · warning · IllegalArgumentException
You cannot use more than one flag with this command
Error message
You cannot use more than one flag with this command
What it means
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.
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
Example fix
// before nodetool getstreamthroughput --entire-sstable-throughput --stream-throughput-mb // after nodetool getstreamthroughput --entire-sstable-throughput
Defensive patterns
Strategy: validation
Validate before calling
COUNT=$((${ENTIRE:+1} + ${MB:+1} + ${MIB:+1})); [ "$COUNT" -le 1 ] || { echo 'only one flag allowed'; exit 1; } Try / catch
try { run(args); } catch (IllegalArgumentException e) { usage("flags are mutually exclusive"); } Prevention
- Never stack throughput flags in one invocation
- Run separate commands per throughput view
- Pin nodetool command lines in automation to tested forms
When it happens
Trigger: Running `nodetool getstreamthroughput --entire-sstable-throughput --stream-throughput-mib` (or the -mb variant).
Common situations: Scripts that grew flags over time; operators exploring throughput options and stacking flags.
Understand the failure class
Background: "mutually exclusive" flag errors: what "can't supply both nx and xx", "--raw is not compatible with -i" and "cannot be used with" mean, and how to fix them — this error's family across 29 libraries.
Related errors
- Cannot specify both --sai-only and --include-sai
- You cannot use more than one flag with this command
- argument for sort must be one of
- argument for top must be a positive integer.
- arguments for -F are json,yaml only.
AI-assisted analysis of apache/cassandra@88fd0f6a0e (2026-09-10).
Data as JSON: /api/errors/3b5f88d3cc5fb32a.
Report an issue: GitHub.
Appendix: source
Thrown at src/java/org/apache/cassandra/tools/nodetool/GetStreamThroughput.java:49
@Option(names = { "-e", "--entire-sstable-throughput" }, description = "Print entire SSTable streaming throughput in MiB/s")
private boolean entireSSTableThroughput;
@Option(names = { "-m", "--mib" }, description = "Print the throughput cap for streaming in MiB/s")
private boolean streamThroughputMiB;
@Option(names = { "-d", "--precise-mbit" }, description = "Print the throughput cap for streaming in precise Mbits (double)")
private boolean streamThroughputDoubleMbit;
@Override
public void execute(NodeProbe probe)
{
int throughput;
double throughputInDouble;
if (entireSSTableThroughput)
{
if (streamThroughputDoubleMbit || streamThroughputMiB)
throw new IllegalArgumentException("You cannot use more than one flag with this command");
throughputInDouble = probe.getEntireSSTableStreamThroughput();
probe.output().out.printf("Current entire SSTable stream throughput: %s%n",
throughputInDouble > 0 ? throughputInDouble + " MiB/s" : "unlimited");
}
else if (streamThroughputMiB)
{
if (streamThroughputDoubleMbit)
throw new IllegalArgumentException("You cannot use more than one flag with this command");
throughputInDouble = probe.getStreamThroughputMibAsDouble();
probe.output().out.printf("Current stream throughput: %s%n",
throughputInDouble > 0 ? throughputInDouble + " MiB/s" : "unlimited");
}
else if (streamThroughputDoubleMbit)
{
throughputInDouble = probe.getStreamThroughputAsDouble();
probe.output().out.printf("Current stream throughput: %s%n",View on GitHub (pinned to 88fd0f6a0e)