{"record":{"id":"ecc58525614a30e5","repo":"apache/cassandra","slug":"neither-node-id-nor-ip-address-specified-to-fetch","errorCode":null,"errorMessage":"Neither node id nor ip address specified to fetch NodeId from metadata.","messagePattern":"Neither node id nor ip address specified to fetch NodeId from metadata\\.","errorType":"exception","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"src/java/org/apache/cassandra/tools/CMSOfflineTool.java","lineNumber":587,"sourceCode":"                    throw new IllegalArgumentException(\"No node present with id \" + id +\n                                                       \" in the given cluster metadata.\");\n                }\n                return nodeId;\n            }\n            else if (ip != null)\n            {\n                InetAddressAndPort nodeAddress = InetAddressAndPort.getByNameUnchecked(ip);\n                NodeId nodeId = metadata.directory.peerId(nodeAddress);\n\n                if (null == nodeId)\n                {\n                    throw new IllegalArgumentException(\"No node present with ip address \" + ip +\n                                                       \" in given cluster metadata.\");\n                }\n                return nodeId;\n            }\n\n            throw new IllegalArgumentException(\"Neither node id nor ip address specified to fetch NodeId from metadata.\");\n        }\n    }\n\n\n    /**\n     * Prints a high-level summary of the CMS state: members, epoch, replication factor,\n     * service state, and whether reconfiguration is needed.\n     */\n    @Command(name = \"describe\", description = \"Describes the cluster metadata.\")\n    static class Describe extends ClusterMetadataToolCmd\n    {\n        @Override\n        protected void execute(Output output) throws IOException\n        {\n            ClusterMetadata metadata = parseClusterMetadata();\n            String members = metadata.fullCMSMembers()\n                                     .stream()\n                                     .sorted()","sourceCodeStart":569,"sourceCodeEnd":605,"githubUrl":"https://github.com/apache/cassandra/blob/88fd0f6a0eaed8943f05ac9e8f947882b8ddc8f1/src/java/org/apache/cassandra/tools/CMSOfflineTool.java#L569-L605","documentation":"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.","triggerScenarios":"Invoking a CMSOfflineTool subcommand that requires node identification (e.g. force-join) without passing either the --id or --ip option.","commonSituations":"Scripting the tool and omitting the node argument; calling the API programmatically with a NodeIdentifierOption left unset; documentation mismatch where the flag name changed.","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."],"exampleFix":"// before\n// cms offline force-join --tokens ...\n// after\n// cms offline force-join --id 3 --tokens ...","handlingStrategy":"validation","validationCode":"if (opts.id == null && opts.ip == null)\n    throw new IllegalArgumentException(\"Provide --id or --ip to identify the node\");","typeGuard":null,"tryCatchPattern":"try { tool.run(args); } catch (IllegalArgumentException e) { System.err.println(\"Usage: pass --id or --ip\"); }","preventionTips":["Always pass --id or --ip for node-targeted subcommands","Check subcommand help output before scripting","Validate CLI args in wrapper scripts"],"tags":["cli","missing-argument","node-identifier"],"backgroundTag":"missing-required-argument","analyzedSha":"88fd0f6a0eaed8943f05ac9e8f947882b8ddc8f1","analyzedAt":"2026-09-10T07:29:22.284Z","contentChangedAt":"2026-09-10T07:29:22.284Z","schemaVersion":2},"datasetVersion":"2026-09-14T21:17:11.552Z"}