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

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.

Solutions

  1. Pass exactly one flag (or none for the default inter-DC Mbit view)
  2. Remove --entire-sstable-throughput if you meant to query the MiB/Mbit values
  3. Split queries: run the command once per flag you need

Example fix

// before
nodetool getinterdcstreamthroughput --entire-sstable-throughput --inter-dcstream-throughput-mib
// after
nodetool getinterdcstreamthroughput --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

When it happens

Trigger: Running `nodetool getinterdcstreamthroughput --entire-sstable-throughput --inter-dcstream-throughput-mb` or combining it with the -MiB flag.

Common situations: Scripts accumulating flags over time; operators unsure which throughput variant they want and passing several; copy-pasted command lines.

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


AI-assisted analysis of apache/cassandra@88fd0f6a0e (2026-09-10). Data as JSON: /api/errors/1e341bbd58ee95cd. Report an issue: GitHub.

Appendix: source

Thrown at src/java/org/apache/cassandra/tools/nodetool/GetInterDCStreamThroughput.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 inter-datacenter streaming in MiB/s")
    private boolean interDCStreamThroughputMiB;

    @Option(names = { "-d", "--precise-mbit" }, description = "Print the throughput cap for inter-datacenter streaming in precise Mbits (double)")
    private boolean interDCStreamThroughputDoubleMbit;

    @Override
    public void execute(NodeProbe probe)
    {
        int throughput;
        double throughputInDouble;

        if (entireSSTableThroughput)
        {
            if (interDCStreamThroughputDoubleMbit || interDCStreamThroughputMiB)
                throw new IllegalArgumentException("You cannot use more than one flag with this command");

            throughputInDouble = probe.getEntireSSTableInterDCStreamThroughput();
            probe.output().out.printf("Current entire SSTable inter-datacenter stream throughput: %s%n",
                                      throughputInDouble > 0 ? throughputInDouble + " MiB/s" : "unlimited");
        }
        else if (interDCStreamThroughputMiB)
        {
            if (interDCStreamThroughputDoubleMbit)
                throw new IllegalArgumentException("You cannot use more than one flag with this command");

            throughputInDouble = probe.getInterDCStreamThroughputMibAsDouble();
            probe.output().out.printf("Current inter-datacenter stream throughput: %s%n",
                                      throughputInDouble > 0 ? throughputInDouble + " MiB/s" : "unlimited");

        }
        else if (interDCStreamThroughputDoubleMbit)
        {
            throughputInDouble = probe.getInterDCStreamThroughputAsDouble();

View on GitHub (pinned to 88fd0f6a0e)