apache/cassandra · error · IllegalStateException

No node id found for endpoint:

Error message

No node id found for endpoint: 

What it means

TransformClusterMetadataHelper.makeCMS looks up the NodeId for a given InetAddressAndPort in the cluster metadata directory and throws IllegalStateException when no peer is registered for that endpoint. This helper is used by transform tooling to force a node to become the CMS.

Solutions

  1. Verify the endpoint with nodetool status / ClusterMetadata directory and pass the exact registered ip:port
  2. Confirm the target node has completed join (is a registered peer, not a leaving/removed node)
  3. Re-read the metadata file from the current cluster generation instead of a stale dump
Defensive patterns

Strategy: validation

Validate before calling

// before calling the transform helper, verify the endpoint is a registered peer
if (metadata.directory.peerId(endpoint) == null)
    throw new IllegalStateException("Endpoint is not a registered peer: " + endpoint);

Prevention

When it happens

Trigger: Calling makeCMS (or the transform main that uses it) with an IP:port that is not present in the metadata directory's peer map — e.g. a wrong/typo'd address, a node that never joined, or metadata read from a node that has been decommissioned.

Common situations: Running the transform helper against a stale or wrong address after node replacement; a decommissioned node's IP; DNS/name-vs-IP mismatch so the endpoint never equals the registered address.

Understand the failure class

Background: 'Could not be found', 'does not exist', 'not found in database': the resource-not-found family when an ID, slug, key, or URI lookup comes back empty — this error's family across 20 libraries.

Related errors


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

Appendix: source

Thrown at src/java/org/apache/cassandra/tools/TransformClusterMetadataHelper.java:76

        DatabaseDescriptor.setPartitionerUnsafe(partitioner);
        ClusterMetadataService.initializeForTools(false);
        ClusterMetadata metadata = ClusterMetadataService.deserializeClusterMetadata(sourceFile);
        System.out.println("Old CMS: " + metadata.placement(ReplicationParams.meta(metadata)));
        metadata = makeCMS(metadata, InetAddressAndPort.getByNameUnchecked(args[1]));
        System.out.println("New CMS: " + metadata.placement(ReplicationParams.meta(metadata)));
        Path p = Files.createTempFile("clustermetadata", "dump");
        try (FileOutputStreamPlus out = new FileOutputStreamPlus(p))
        {
            VerboseMetadataSerializer.serialize(ClusterMetadata.serializer, metadata, out, serializationVersion);
        }
        System.out.println(p.toString());
    }

    public static ClusterMetadata makeCMS(ClusterMetadata metadata, InetAddressAndPort endpoint)
    {
        NodeId id = metadata.directory.peerId(endpoint);
        if (id == null)
            throw new IllegalStateException("No node id found for endpoint: " + endpoint);
        return metadata.transformer().startJoiningCMS(id).finishJoiningCMS(id).build().metadata;
    }
}

View on GitHub (pinned to 88fd0f6a0e)