{"record":{"id":"45ce548ede908e35","repo":"apache/cassandra","slug":"can-t-ignore-local-host-s-when-doing-cms-migratio","errorCode":null,"errorMessage":"Can't ignore local host %s when doing CMS migration","messagePattern":"Can't ignore local host (.+?) when doing CMS migration","errorType":"exception","errorClass":"IllegalStateException","httpStatus":null,"severity":"error","filePath":"src/java/org/apache/cassandra/tcm/ClusterMetadataService.java","lineNumber":431,"sourceCode":"        }\n        // otherwise, this is a noop.\n        return preInit -> {\n        };\n    }\n\n    public boolean isCurrentMember(InetAddressAndPort peer)\n    {\n        return ClusterMetadata.current().isCMSMember(peer);\n    }\n\n    public void upgradeFromGossip(List<String> ignoredEndpoints)\n    {\n        Set<InetAddressAndPort> ignored = ignoredEndpoints.stream().map(InetAddressAndPort::getByNameUnchecked).collect(toSet());\n        if (ignored.contains(FBUtilities.getBroadcastAddressAndPort()))\n        {\n            String msg = String.format(\"Can't ignore local host %s when doing CMS migration\", FBUtilities.getBroadcastAddressAndPort());\n            logger.error(msg);\n            throw new IllegalStateException(msg);\n        }\n\n        ClusterMetadata metadata = metadata();\n        if (metadata.myNodeState() != NodeState.JOINED)\n        {\n            String msg = String.format(\"Initial CMS node needs to be fully joined, not: %s\", metadata.myNodeState());\n            logger.error(msg);\n            throw new IllegalStateException(msg);\n        }\n\n        Set<InetAddressAndPort> existingMembers = metadata.fullCMSMembers();\n\n        if (!metadata.directory.allAddresses().containsAll(ignored))\n        {\n            Set<InetAddressAndPort> allAddresses = Sets.newHashSet(metadata.directory.allAddresses());\n            String msg = String.format(\"Ignored host(s) %s don't exist in the cluster\", Sets.difference(ignored, allAddresses));\n            logger.error(msg);\n            throw new IllegalStateException(msg);","sourceCodeStart":413,"sourceCodeEnd":449,"githubUrl":"https://github.com/apache/cassandra/blob/88fd0f6a0eaed8943f05ac9e8f947882b8ddc8f1/src/java/org/apache/cassandra/tcm/ClusterMetadataService.java#L413-L449","documentation":"upgradeFromGossip() migrates cluster management from gossip to TCM/CMS. The caller supplies a set of endpoints to ignore during the migration, but the local node itself must participate; if the local broadcast address appears in the ignored set, an IllegalStateException is thrown since the migrating node cannot exclude itself.","triggerScenarios":"Calling ClusterMetadataService.upgradeFromGossip(ignoredEndpoints) where the set (after InetAddressAndPort resolution) contains FBUtilities.getBroadcastAddressAndPort().","commonSituations":"Operator error in nodetool/admin invocation listing the local node's IP among endpoints to ignore (e.g. decommissioning lists, copy-pasted ignore lists), or DNS/hostname resolution unexpectedly matching the local address.","solutions":["Remove the local node's broadcast address from the ignored endpoints set and retry the migration.","Verify resolved addresses (getByNameUnchecked may expand hostnames) do not include the local IP/port.","Only ignore endpoints that are genuinely being decommissioned/removed, never the local node."],"exampleFix":"// before\nSet<InetAddressAndPort> ignored = endpoints.stream().map(InetAddressAndPort::getByNameUnchecked).collect(toSet());\ncms.upgradeFromGossip(ignored); // includes local node\n// after\nSet<InetAddressAndPort> ignored = endpoints.stream().map(InetAddressAndPort::getByNameUnchecked)\n                                            .filter(a -> !a.equals(FBUtilities.getBroadcastAddressAndPort()))\n                                            .collect(toSet());\ncms.upgradeFromGossip(ignored);","handlingStrategy":"validation","validationCode":"Set<InetAddressAndPort> resolved = ignoredEndpoints.stream()\n    .map(InetAddressAndPort::getByNameUnchecked).collect(toSet());\nif (resolved.contains(FBUtilities.getBroadcastAddressAndPort()))\n    throw new IllegalArgumentException(\"Cannot ignore local node during CMS migration\");","typeGuard":null,"tryCatchPattern":"try {\n    cms.upgradeFromGossip(ignoredEndpoints);\n} catch (IllegalStateException e) {\n    logger.error(\"Fix ignore list: {}\", e.getMessage());\n}","preventionTips":["Never include the local node's address in ignore lists","Resolve hostnames to addresses and diff against the local broadcast address before invoking","Audit decommission scripts for copy-pasted ignore lists"],"tags":["cassandra","tcm","upgrade","configuration"],"backgroundTag":"invalid-argument-value","analyzedSha":"88fd0f6a0eaed8943f05ac9e8f947882b8ddc8f1","analyzedAt":"2026-09-10T07:29:22.284Z","contentChangedAt":"2026-09-10T07:29:22.284Z","schemaVersion":2},"datasetVersion":"2026-09-14T16:17:12.679Z"}