apache/cassandra · error · IllegalArgumentException
Only one of --node or --ip need to be set
Error message
Only one of --node or --ip need to be set
What it means
The mirror case of missing-required-option: nodetool abortbootstrap throws IllegalArgumentException when BOTH --node and --ip are supplied, since exactly one way to identify the bootstrap must be given.
Source
Thrown at src/java/org/apache/cassandra/tools/nodetool/AbortBootstrap.java:43
import static org.apache.commons.lang3.StringUtils.EMPTY;
import static org.apache.commons.lang3.StringUtils.isEmpty;
@Command(name = "abortbootstrap", description = "Abort a failed bootstrap")
public class AbortBootstrap extends AbstractCommand
{
@Option(paramLabel = "node_id", names = "--node", description = "Node ID of the node that failed bootstrap")
private String nodeId = EMPTY;
@Option(paramLabel = "ip", names = "--ip", description = "IP of the node that failed bootstrap")
private String endpoint = EMPTY;
@Override
public void execute(NodeProbe probe)
{
if (isEmpty(nodeId) && isEmpty(endpoint))
throw new IllegalArgumentException("Either --node or --ip needs to be set");
if (!isEmpty(nodeId) && !isEmpty(endpoint))
throw new IllegalArgumentException("Only one of --node or --ip need to be set");
probe.abortBootstrap(nodeId, endpoint);
}
}
View on GitHub (pinned to 88fd0f6a0e)
Solutions
- Remove one of the two flags so only --node or only --ip is present
- If unsure of the host id, look it up with nodetool status and use just --ip, or vice versa
- Fix scripts so they pass one identifier chosen programmatically, not both
Example fix
// before nodetool abortbootstrap --node 5f4a --ip 10.0.0.5:7000 // after nodetool abortbootstrap --ip 10.0.0.5:7000
Defensive patterns
Strategy: validation
Validate before calling
boolean hasNode = nodeId != null && !nodeId.isEmpty();
boolean hasIp = endpoint != null && !endpoint.isEmpty();
if (hasNode && hasIp)
throw new IllegalArgumentException("Pass only one of --node or --ip"); Prevention
- Choose one identifier (host id or ip) per invocation
- Build scripts that pass exactly one flag
- Read the tool's usage before combining flags
When it happens
Trigger: Running 'nodetool abortbootstrap --node <id> --ip <addr>' — both non-empty — from the shell or a script that always appends both flags.
Common situations: Template scripts that set both variables unconditionally; copy-pasting example commands containing both flags; operator unsure which identifier to use and passing both.
Related errors
- Either --node or --ip needs to be set
- 'nodetool bootstrap resume' is disabled.
- Node is not yet bootstrapped completely. Use nodetool to che
- Can't abort bootstrap for - it does not exist in cluster me
- Can't abort bootstrap for - it is alive
AI-assisted analysis of apache/cassandra@88fd0f6a0e (2026-09-10).
Data as JSON: /api/errors/0357ab013b28fab3.
Report an issue: GitHub.