apache/cassandra · error · IllegalArgumentException
Neither node id nor ip address specified to fetch NodeId fro
Error message
Neither node id nor ip address specified to fetch NodeId from metadata.
What it means
Thrown by CMSOfflineTool.getNodeId when neither a node id nor an IP address option was provided, so there is no way to identify which NodeId to resolve from the metadata. This is a required-argument check at the end of the resolution path.
Source
Thrown at src/java/org/apache/cassandra/tools/CMSOfflineTool.java:587
throw new IllegalArgumentException("No node present with id " + id +
" in the given cluster metadata.");
}
return nodeId;
}
else if (ip != null)
{
InetAddressAndPort nodeAddress = InetAddressAndPort.getByNameUnchecked(ip);
NodeId nodeId = metadata.directory.peerId(nodeAddress);
if (null == nodeId)
{
throw new IllegalArgumentException("No node present with ip address " + ip +
" in given cluster metadata.");
}
return nodeId;
}
throw new IllegalArgumentException("Neither node id nor ip address specified to fetch NodeId from metadata.");
}
}
/**
* Prints a high-level summary of the CMS state: members, epoch, replication factor,
* service state, and whether reconfiguration is needed.
*/
@Command(name = "describe", description = "Describes the cluster metadata.")
static class Describe extends ClusterMetadataToolCmd
{
@Override
protected void execute(Output output) throws IOException
{
ClusterMetadata metadata = parseClusterMetadata();
String members = metadata.fullCMSMembers()
.stream()
.sorted()View on GitHub (pinned to 88fd0f6a0e)
Solutions
- Pass --id <nodeId> or --ip <address> identifying the target node.
- Check the subcommand's usage/help output for the exact flag names.
- Fix the calling script to populate the node identifier option.
Example fix
// before // cms offline force-join --tokens ... // after // cms offline force-join --id 3 --tokens ...
Defensive patterns
Strategy: validation
Validate before calling
if (opts.id == null && opts.ip == null)
throw new IllegalArgumentException("Provide --id or --ip to identify the node"); Try / catch
try { tool.run(args); } catch (IllegalArgumentException e) { System.err.println("Usage: pass --id or --ip"); } Prevention
- Always pass --id or --ip for node-targeted subcommands
- Check subcommand help output before scripting
- Validate CLI args in wrapper scripts
When it happens
Trigger: Invoking a CMSOfflineTool subcommand that requires node identification (e.g. force-join) without passing either the --id or --ip option.
Common situations: Scripting the tool and omitting the node argument; calling the API programmatically with a NodeIdentifierOption left unset; documentation mismatch where the flag name changed.
Understand the failure class
Background: "missing required argument" and "the following required arguments were not provided": what required-argument errors mean and how to fix them — this error's family across 20 libraries.
Related errors
- Token ranges must be specified when performing pull repair.
- Tokens must be provided to force join a node.
- No arguments.
- No command specified
- Required key '%s' is missing
AI-assisted analysis of apache/cassandra@88fd0f6a0e (2026-09-10).
Data as JSON: /api/errors/ecc58525614a30e5.
Report an issue: GitHub.