{"record":{"id":"ffa4f3c1e5ecf5fb","repo":"apache/cassandra","slug":"no-node-present-with-id-id-in-the-given-cluster","errorCode":null,"errorMessage":"No node present with id ${id} in the given cluster metadata.","messagePattern":"No node present with id (.+?) in the given cluster metadata\\.","errorType":"exception","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"src/java/org/apache/cassandra/tools/CMSOfflineTool.java","lineNumber":569,"sourceCode":"        private String ip;\n\n        @Option(names = { \"-id\", \"--node-id\" }, required = true,\n        description = \"Node ID. It can be integer ID assigned to node or the node uuid.\")\n        private String id;\n\n        String getNodeIpOrId()\n        {\n            return ip != null ? ip : id;\n        }\n\n        NodeId getNodeId(ClusterMetadata metadata)\n        {\n            if (id != null)\n            {\n                NodeId nodeId = NodeId.fromString(id);\n                if (!metadata.directory.peerIds().contains(nodeId))\n                {\n                    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.\");","sourceCodeStart":551,"sourceCodeEnd":587,"githubUrl":"https://github.com/apache/cassandra/blob/88fd0f6a0eaed8943f05ac9e8f947882b8ddc8f1/src/java/org/apache/cassandra/tools/CMSOfflineTool.java#L551-L587","documentation":"Thrown by CMSOfflineTool.getNodeId when the node id supplied via CLI options cannot be found in the ClusterMetadata's directory peerIds of an offline cluster metadata file. It validates that the requested NodeId exists before proceeding with offline CMS operations. The metadata was loaded from a file, so only nodes known at snapshot time can be resolved.","triggerScenarios":"Calling the CMSOfflineTool subcommand with --id set to a NodeId that is absent from metadata.directory.peerIds() of the parsed cluster metadata (typo, node never joined, node already removed, or stale metadata file).","commonSituations":"Typo in the node id on the command line; running the tool against an old/stale cluster metadata snapshot that no longer contains the node; referencing a node that was decommissioned before the metadata was exported.","solutions":["List the valid node ids in the metadata and use one of them (e.g. via the tool's info/summary output or metadata.directory.peerIds()).","Re-export a fresh cluster metadata snapshot if the current one is stale.","If you only know the IP, pass the IP address instead of the id so the peerId(address) lookup is used.","Verify the id string parses to the correct NodeId (format is a numeric id; check for transcription errors)."],"exampleFix":"// before\n// --id 8f1e...unknown-node-id\n// after\n// cms offline --id 3  (an id present in metadata.directory.peerIds())","handlingStrategy":"validation","validationCode":"NodeId candidate = NodeId.fromString(id);\nif (!metadata.directory.peerIds().contains(candidate))\n    throw new IllegalArgumentException(\"Unknown node id \" + id + \"; valid ids: \" + metadata.directory.peerIds());","typeGuard":null,"tryCatchPattern":"try { NodeId nodeId = tool.getNodeId(opts); ... } catch (IllegalArgumentException e) { logger.error(\"Node id not in metadata: \" + e.getMessage()); }","preventionTips":["List peerIds from the metadata before choosing an id","Copy-paste ids rather than retyping them","Regenerate metadata snapshots before offline work"],"tags":["cli","cluster-metadata","node-not-found","cassandra"],"backgroundTag":"entity-not-found","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"}