{"record":{"id":"8a1a67ef74a533d7","repo":"apache/cassandra","slug":"either-node-or-ip-needs-to-be-set","errorCode":null,"errorMessage":"Either --node or --ip needs to be set","messagePattern":"Either --node or --ip needs to be set","errorType":"validation","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"src/java/org/apache/cassandra/tools/nodetool/AbortBootstrap.java","lineNumber":41,"sourceCode":"import picocli.CommandLine.Option;\n\nimport static org.apache.commons.lang3.StringUtils.EMPTY;\nimport static org.apache.commons.lang3.StringUtils.isEmpty;\n\n@Command(name = \"abortbootstrap\", description = \"Abort a failed bootstrap\")\npublic class AbortBootstrap extends AbstractCommand\n{\n    @Option(paramLabel = \"node_id\", names = \"--node\", description = \"Node ID of the node that failed bootstrap\")\n    private String nodeId = EMPTY;\n\n    @Option(paramLabel = \"ip\", names = \"--ip\", description = \"IP of the node that failed bootstrap\")\n    private String endpoint = EMPTY;\n\n    @Override\n    public void execute(NodeProbe probe)\n    {\n        if (isEmpty(nodeId) && isEmpty(endpoint))\n            throw new IllegalArgumentException(\"Either --node or --ip needs to be set\");\n        if (!isEmpty(nodeId) && !isEmpty(endpoint))\n            throw new IllegalArgumentException(\"Only one of --node or --ip need to be set\");\n        probe.abortBootstrap(nodeId, endpoint);\n    }\n}\n","sourceCodeStart":23,"sourceCodeEnd":47,"githubUrl":"https://github.com/apache/cassandra/blob/88fd0f6a0eaed8943f05ac9e8f947882b8ddc8f1/src/java/org/apache/cassandra/tools/nodetool/AbortBootstrap.java#L23-L47","documentation":"nodetool abortbootstrap requires identifying the bootstrap to abort by either --node (a node/host id) or --ip (endpoint address). execute() throws IllegalArgumentException when neither option was supplied.","triggerScenarios":"Running 'nodetool abortbootstrap' with no flags, or with an empty string value for both --node and --ip (isEmpty checks treat EMPTY as unset).","commonSituations":"Forgetting the flag entirely; passing --node without a value so the field stays empty; scripting the command with a variable that resolved to empty string.","solutions":["Add exactly one of: nodetool abortbootstrap --node <host-id>","Or use: nodetool abortbootstrap --ip <ip:port>","Check your script/CI variable actually has a value before invoking nodetool"],"exampleFix":"// before\nnodetool abortbootstrap\n// after\nnodetool abortbootstrap --node 5f4a...   (or --ip 10.0.0.5:7000)","handlingStrategy":"validation","validationCode":"if ((nodeId == null || nodeId.isEmpty()) && (ip == null || ip.isEmpty()))\n    throw new IllegalArgumentException(\"Provide exactly one of --node or --ip\");","typeGuard":null,"tryCatchPattern":"try {\n    probe.execute(nodeId, endpoint);\n} catch (IllegalArgumentException e) {\n    // print usage and re-run with one of --node / --ip\n}","preventionTips":["Always pass --node or --ip explicitly","In scripts, assert the variable is non-empty before invoking nodetool","Never pass flags without values"],"tags":["nodetool","cli","bootstrap"],"backgroundTag":"missing-required-option","analyzedSha":"88fd0f6a0eaed8943f05ac9e8f947882b8ddc8f1","analyzedAt":"2026-09-10T07:29:22.284Z","contentChangedAt":"2026-09-10T07:29:22.284Z","schemaVersion":2},"datasetVersion":"2026-09-14T16:17:12.679Z"}