{"record":{"id":"eb53e46c77220f4b","repo":"apache/cassandra","slug":"invalid-node-identifier-supplied","errorCode":null,"errorMessage":"Invalid node identifier supplied: ","messagePattern":"Invalid node identifier supplied: ","errorType":"exception","errorClass":"java.lang.IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"src/java/org/apache/cassandra/tcm/transformations/AlterTopology.java","lineNumber":100,"sourceCode":"\n    private static NodeId getNodeIdFromString(String s, Directory directory)\n    {\n        // first try to parse the id as a node id, either in UUID or int form\n        try\n        {\n            return NodeId.fromString(s);\n        }\n        catch (Exception e)\n        {\n            // fall back to trying the supplied id as an endpoint\n            try\n            {\n                InetAddressAndPort endpoint = InetAddressAndPort.getByName(s);\n                return directory.peerId(endpoint);\n            }\n            catch (UnknownHostException u)\n            {\n                throw new IllegalArgumentException(\"Invalid node identifier supplied: \" + s);\n            }\n\n        }\n    }\n\n    @Override\n    public Kind kind()\n    {\n        return Kind.ALTER_TOPOLOGY;\n    }\n\n    @Override\n    public Result execute(ClusterMetadata prev)\n    {\n        // Check no inflight range movements\n        if (!prev.lockedRanges.locked.isEmpty())\n            return new Rejected(INVALID, \"The requested topology changes cannot be executed while there are ongoing range movements.\");\n","sourceCodeStart":82,"sourceCodeEnd":118,"githubUrl":"https://github.com/apache/cassandra/blob/88fd0f6a0eaed8943f05ac9e8f947882b8ddc8f1/src/java/org/apache/cassandra/tcm/transformations/AlterTopology.java#L82-L118","documentation":"AlterTopology.getNodeIdFromString resolves a node identifier string either as a known NodeId or as an endpoint address that must map to a peerId in the Directory. If the string is not an address resolvable by InetAddressAndPort.getByName (UnknownHostException), IllegalArgumentException 'Invalid node identifier supplied' is thrown.","triggerScenarios":"Supplying a hostname that DNS cannot resolve, an invalid IP literal, or a symbolic name not present in the directory when calling AlterTopology.parseArgs (via id/parseArgs).","commonSituations":"Using hostnames without DNS/hosts entries in the datacenter environment; typos in IP addresses; specifying a node name form (e.g. uuid or hostname) the parser does not recognize.","solutions":["Use the node's numeric NodeId, or its exact IP:port as registered in the cluster directory","Fix DNS/hosts resolution for the hostname, or replace it with the IP address","Verify the identifier with nodetool status / cluster directory before issuing the topology change"],"exampleFix":"// before\nnodetool altertopology 'cassandra-node3.prod=dc2:r1'  // hostname not resolvable\n// after\nnodetool altertopology '10.0.2.3:7000=dc2:r1'  // or use the numeric NodeId","handlingStrategy":"validation","validationCode":"// resolve the identifier to an address before issuing the change\ntry { InetAddressAndPort.getByName(identifier); }\ncatch (UnknownHostException e) {\n    throw new IllegalArgumentException(\"unresolvable node identifier: \" + identifier);\n}","typeGuard":null,"tryCatchPattern":"try { parseArgs(args, directory); }\ncatch (IllegalArgumentException e) {\n    if (e.getMessage().startsWith(\"Invalid node identifier supplied:\")) { /* fall back to NodeId or IP */ }\n    else throw e;\n}","preventionTips":["Prefer numeric NodeIds or IP:port over hostnames in automation","Ensure DNS//etc/hosts covers all node hostnames in the cluster environment","Look up the identifier via nodetool status before topology changes"],"tags":["cli","topology","dns","argument-parsing"],"backgroundTag":"invalid-identifier","analyzedSha":"88fd0f6a0eaed8943f05ac9e8f947882b8ddc8f1","analyzedAt":"2026-09-10T07:29:22.284Z","contentChangedAt":"2026-09-10T07:29:22.284Z","schemaVersion":2},"datasetVersion":"2026-09-17T15:17:12.973Z"}