apache/cassandra · error · IllegalArgumentException

Unable to parse node id string

Error message

Unable to parse node id string 

What it means

Thrown by parseNodeIdOrEndpoint in StorageService when the abortbootstrap node string cannot be converted to a NodeId via NodeId.fromString - the string is neither a parseable node id nor was an endpoint string expected. The underlying parse exception is wrapped and logged at WARN before rethrowing as IllegalArgumentException.

Source

Thrown at src/java/org/apache/cassandra/service/StorageService.java:1707

            default:
                throw new RuntimeException("Can't abort bootstrap for node " + nodeId + " since the state is " + nodeState);
        }
    }

    private static NodeId parseNodeIdOrEndpoint(ClusterMetadata metadata, String nodeStr, String endpointStr)
    {
        NodeId nodeId;
        if (!StringUtils.isEmpty(nodeStr))
        {
            try
            {
                nodeId = NodeId.fromString(nodeStr);
            }
            catch (IllegalArgumentException | UnsupportedOperationException e)
            {
                String msg = "Unable to parse node id string " + nodeStr;
                logger.warn("{}", msg, e);
                throw new IllegalArgumentException(msg, e);
            }
        }
        else
        {
            InetAddressAndPort endpoint;
            try
            {
                endpoint = InetAddressAndPort.getByName(endpointStr);
            }
            catch (UnknownHostException e)
            {
                String msg = "Unable to look up endpoint " + endpointStr;
                logger.warn("{}", msg, e);
                throw new IllegalArgumentException(msg, e);
            }

            nodeId = metadata.directory.peerId(endpoint);
            if (nodeId == null)

View on GitHub (pinned to 88fd0f6a0e)

Solutions

  1. Supply the node's full host id (UUID) as shown by `nodetool status`
  2. Or pass the node's IP address so the endpoint branch of parseNodeIdOrEndpoint is used instead
  3. Check for whitespace/truncation in the id string
  4. Use `nodetool info` on the target node to read its exact host id

Example fix

// before
nodetool abortbootstrap node1.example.com   # parsed as node id -> fails
// after
nodetool abortbootstrap 10.0.0.5
# or
nodetool abortbootstrap 8a1f...-full-host-id-uuid
Defensive patterns

Strategy: validation

Validate before calling

// Validate the node id is a parseable UUID before passing it
java.util.UUID.fromString(nodeStr); // throws if malformed

Type guard

boolean isValidNodeId(String s) {
    try { java.util.UUID.fromString(s); return true; }
    catch (IllegalArgumentException e) { return false; }
}

Try / catch

try {
    probe.abortBootstrap(nodeStr);
} catch (IllegalArgumentException e) {
    if (e.getMessage() != null && e.getMessage().startsWith("Unable to parse node id string"))
        log.warn("'{}' is not a host id; pass a UUID or the node's IP", nodeStr);
    else throw e;
}

Prevention

When it happens

Trigger: Calling `nodetool abortbootstrap <arg>` with a malformed node id (not a valid UUID/host-id format) while no endpoint string was supplied, e.g. a hostname passed where a host id is required.

Common situations: Passing a hostname or friendly name instead of the UUID host id; copy-paste truncating the UUID; using an IP in a mode expecting a node id string.

Understand the failure class

Background: "Invalid ... format", "must be in format X", "does not look like a ..." — invalid argument format errors across CLI tools and libraries — this error's family across 17 libraries.

Related errors


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