{"record":{"id":"d9c60650d3d5a90c","repo":"apache/cassandra","slug":"no-node-id-found-for-endpoint","errorCode":null,"errorMessage":"No node id found for endpoint: ","messagePattern":"No node id found for endpoint: ","errorType":"exception","errorClass":"IllegalStateException","httpStatus":null,"severity":"error","filePath":"src/java/org/apache/cassandra/tools/TransformClusterMetadataHelper.java","lineNumber":76,"sourceCode":"        DatabaseDescriptor.setPartitionerUnsafe(partitioner);\n        ClusterMetadataService.initializeForTools(false);\n        ClusterMetadata metadata = ClusterMetadataService.deserializeClusterMetadata(sourceFile);\n        System.out.println(\"Old CMS: \" + metadata.placement(ReplicationParams.meta(metadata)));\n        metadata = makeCMS(metadata, InetAddressAndPort.getByNameUnchecked(args[1]));\n        System.out.println(\"New CMS: \" + metadata.placement(ReplicationParams.meta(metadata)));\n        Path p = Files.createTempFile(\"clustermetadata\", \"dump\");\n        try (FileOutputStreamPlus out = new FileOutputStreamPlus(p))\n        {\n            VerboseMetadataSerializer.serialize(ClusterMetadata.serializer, metadata, out, serializationVersion);\n        }\n        System.out.println(p.toString());\n    }\n\n    public static ClusterMetadata makeCMS(ClusterMetadata metadata, InetAddressAndPort endpoint)\n    {\n        NodeId id = metadata.directory.peerId(endpoint);\n        if (id == null)\n            throw new IllegalStateException(\"No node id found for endpoint: \" + endpoint);\n        return metadata.transformer().startJoiningCMS(id).finishJoiningCMS(id).build().metadata;\n    }\n}\n","sourceCodeStart":58,"sourceCodeEnd":80,"githubUrl":"https://github.com/apache/cassandra/blob/88fd0f6a0eaed8943f05ac9e8f947882b8ddc8f1/src/java/org/apache/cassandra/tools/TransformClusterMetadataHelper.java#L58-L80","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","solutions":["Verify the endpoint with nodetool status / ClusterMetadata directory and pass the exact registered ip:port","Confirm the target node has completed join (is a registered peer, not a leaving/removed node)","Re-read the metadata file from the current cluster generation instead of a stale dump"],"exampleFix":null,"handlingStrategy":"validation","validationCode":"// before calling the transform helper, verify the endpoint is a registered peer\nif (metadata.directory.peerId(endpoint) == null)\n    throw new IllegalStateException(\"Endpoint is not a registered peer: \" + endpoint);","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Verify endpoints with nodetool status before transforming","Use exact ip:port as registered, not hostnames","Only target nodes that completed join"],"tags":["cluster-metadata","endpoint","tooling"],"backgroundTag":"resource-not-found","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"}