apache/cassandra · error · java.lang.UnsupportedOperationException

Node is alive and owns this ID. Use decommission command to…

Error message

Node %s is alive and owns this ID. Use decommission command to remove it from the ring

What it means

Duplicate/alternate form of the alive-node guard in removeNode: when the target endpoint appears in Gossiper.instance.getLiveMembers(), removal is blocked with the formatted message naming the endpoint. Live nodes must decommission, not be removed, because removal assumes the node is dead and its data will be re-replicated from other replicas.

Solutions

  1. Wait for gossip to mark the endpoint dead (heartbeats expire) before re-running removenode.
  2. If the node is genuinely running, use `nodetool decommission` on it instead.
  3. Use `nodetool gossipinfo` / `nodetool netstats` to confirm observed liveness from the removal coordinator.
  4. Restart the removal from a different coordinator node that sees the target as dead (if the partition is asymmetric).

Example fix

// before
nodetool removenode hostId  // target still gossips live
// after
// wait for: nodetool gossipinfo shows DOWN for endpoint
if (!liveMembers.contains(endpoint)) nodetool.removenode(hostId);
Defensive patterns

Strategy: validation

Validate before calling

Set<InetAddressAndPort> live = Gossiper.instance.getLiveMembers();
InetAddressAndPort ep = ClusterMetadata.current().directory.endpoint(NodeId.fromString(hostId));
if (ep != null && live.contains(ep))
    throw new IllegalArgumentException("Endpoint " + ep + " still live; decommission instead");

Try / catch

try {
    storageService.removeNode(hostId);
} catch (UnsupportedOperationException e) {
    if (e.getMessage().contains("is alive and owns this ID")) {
        awaitEndpointDown(ep); // poll gossip until dead, then retry
        storageService.removeNode(hostId);
    } else throw e;
}

Prevention

When it happens

Trigger: `nodetool removenode <hostId>` issued while the target endpoint is broadcasting gossip liveness — same node seen as live due to partial partition or the operator mistaking a node for dead.

Common situations: Stale gossip liveness after an abrupt crash (heartbeats not yet expired); asymmetric network failure where removal coordinator still sees the node; operator confusion between removenode and decommission semantics.

Understand the failure class

Background: "Must be a positive integer", "Invalid value", "Unsupported": the invalid-argument-value error family, when a library rejects the value you pass — this error's family across 35 libraries.

Related errors


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

Appendix: source

Thrown at src/java/org/apache/cassandra/tcm/sequences/SingleNodeSequences.java:136

    }

    /**
     * Entrypoint to begin node removal process
     *
     * @param toRemove id of the node to remove
     * @param force if set to true, will remove the node even if this would mean there will be not enough nodes
     *              to satisfy replication factor
     */
    static void removeNode(NodeId toRemove, boolean force)
    {
        ClusterMetadata metadata = ClusterMetadata.current();
        if (toRemove.equals(metadata.myNodeId()))
            throw new UnsupportedOperationException("Cannot remove self");
        InetAddressAndPort endpoint = metadata.directory.endpoint(toRemove);
        if (endpoint == null)
            throw new UnsupportedOperationException("Host ID not found.");
        if (Gossiper.instance.getLiveMembers().contains(endpoint))
            throw new UnsupportedOperationException("Node " + endpoint + " is alive and owns this ID. Use decommission command to remove it from the ring");

        NodeState removeState = metadata.directory.peerState(toRemove);
        if (removeState == null)
            throw new UnsupportedOperationException("Node to be removed is not a member of the token ring");
        if (removeState == NodeState.LEAVING)
            logger.warn("Node {} is already leaving or being removed, continuing removal anyway", endpoint);

        if (metadata.inProgressSequences.contains(toRemove))
            throw new UnsupportedOperationException("Can not remove a node that has an in-progress sequence");

        ReconfigureCMS.maybeReconfigureCMS(metadata, endpoint);

        logger.info("starting removenode with {} {}", metadata.epoch, toRemove);
        Collection<Token> tokens  = metadata.tokenMap.tokens(toRemove);
        ClusterMetadataService.instance().commit(new PrepareLeave(toRemove,
                                                                  force,
                                                                  ClusterMetadataService.instance().placementProvider(),
                                                                  LeaveStreams.Kind.REMOVENODE));

View on GitHub (pinned to 88fd0f6a0e)