apache/cassandra · error · java.lang.IllegalArgumentException

Invalid node identifier supplied:

Error message

Invalid node identifier supplied: 

What it means

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.

Solutions

  1. Use the node's numeric NodeId, or its exact IP:port as registered in the cluster directory
  2. Fix DNS/hosts resolution for the hostname, or replace it with the IP address
  3. Verify the identifier with nodetool status / cluster directory before issuing the topology change

Example fix

// before
nodetool altertopology 'cassandra-node3.prod=dc2:r1'  // hostname not resolvable
// after
nodetool altertopology '10.0.2.3:7000=dc2:r1'  // or use the numeric NodeId
Defensive patterns

Strategy: validation

Validate before calling

// resolve the identifier to an address before issuing the change
try { InetAddressAndPort.getByName(identifier); }
catch (UnknownHostException e) {
    throw new IllegalArgumentException("unresolvable node identifier: " + identifier);
}

Try / catch

try { parseArgs(args, directory); }
catch (IllegalArgumentException e) {
    if (e.getMessage().startsWith("Invalid node identifier supplied:")) { /* fall back to NodeId or IP */ }
    else throw e;
}

Prevention

When it happens

Trigger: 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).

Common situations: 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.

Related errors


AI-assisted analysis of apache/cassandra@88fd0f6a0e (2026-09-10). Data as JSON: /api/errors/eb53e46c77220f4b. Report an issue: GitHub.

Appendix: source

Thrown at src/java/org/apache/cassandra/tcm/transformations/AlterTopology.java:100

    private static NodeId getNodeIdFromString(String s, Directory directory)
    {
        // first try to parse the id as a node id, either in UUID or int form
        try
        {
            return NodeId.fromString(s);
        }
        catch (Exception e)
        {
            // fall back to trying the supplied id as an endpoint
            try
            {
                InetAddressAndPort endpoint = InetAddressAndPort.getByName(s);
                return directory.peerId(endpoint);
            }
            catch (UnknownHostException u)
            {
                throw new IllegalArgumentException("Invalid node identifier supplied: " + s);
            }

        }
    }

    @Override
    public Kind kind()
    {
        return Kind.ALTER_TOPOLOGY;
    }

    @Override
    public Result execute(ClusterMetadata prev)
    {
        // Check no inflight range movements
        if (!prev.lockedRanges.locked.isEmpty())
            return new Rejected(INVALID, "The requested topology changes cannot be executed while there are ongoing range movements.");

View on GitHub (pinned to 88fd0f6a0e)