{"record":{"id":"82a75e6c3adce513","repo":"apache/cassandra","slug":"unknown-host-in-epstate-for","errorCode":null,"errorMessage":"Unknown host in epState for ","messagePattern":"Unknown host in epState for ","errorType":"exception","errorClass":"ConfigurationException","httpStatus":null,"severity":"error","filePath":"src/java/org/apache/cassandra/tcm/compatibility/GossipHelper.java","lineNumber":259,"sourceCode":"            return NodeState.LEFT;\n        if (status.isEmpty())\n            return NodeState.REGISTERED;\n        throw new IllegalStateException(\"Can't upgrade the first node when STATUS = \" + status + \" for node \" + endpoint);\n    }\n\n    public static NodeAddresses getAddressesFromEndpointState(InetAddressAndPort endpoint, EndpointState epState)\n    {\n        if (endpoint.equals(getBroadcastAddressAndPort()))\n            return NodeAddresses.current();\n        try\n        {\n            InetAddressAndPort local = getEitherState(endpoint, epState, INTERNAL_ADDRESS_AND_PORT, INTERNAL_IP, DatabaseDescriptor.getStoragePort());\n            InetAddressAndPort nativeAddress = getEitherState(endpoint, epState, NATIVE_ADDRESS_AND_PORT, RPC_ADDRESS, DatabaseDescriptor.getNativeTransportPort());\n            return new NodeAddresses(UUID.randomUUID(), endpoint, local, nativeAddress);\n        }\n        catch (UnknownHostException e)\n        {\n            throw new ConfigurationException(\"Unknown host in epState for \" + endpoint + \" : \" + epState, e);\n        }\n    }\n\n    private static InetAddressAndPort getEitherState(InetAddressAndPort endpoint,\n                                                     EndpointState epState,\n                                                     ApplicationState primaryState,\n                                                     ApplicationState deprecatedState,\n                                                     int defaultPortForDeprecatedState) throws UnknownHostException\n    {\n        if (epState.getApplicationState(primaryState) != null)\n        {\n            return getByName(epState.getApplicationState(primaryState).value);\n        }\n        else if (epState.getApplicationState(deprecatedState) != null)\n        {\n            return getByNameOverrideDefaults(epState.getApplicationState(deprecatedState).value, defaultPortForDeprecatedState);\n        }\n        else","sourceCodeStart":241,"sourceCodeEnd":277,"githubUrl":"https://github.com/apache/cassandra/blob/88fd0f6a0eaed8943f05ac9e8f947882b8ddc8f1/src/java/org/apache/cassandra/tcm/compatibility/GossipHelper.java#L241-L277","documentation":"GossipHelper.getAddressesFromEndpointState builds a NodeAddresses record by resolving INTERNAL_ADDRESS_AND_PORT/RPC_ADDRESS etc. from gossip endpoint state; any UnknownHostException during resolution is rethrown as ConfigurationException since the advertised addresses can't be resolved and the node cannot be migrated.","triggerScenarios":"During gossip-to-TCM upgrade, an endpoint's gossip state advertises an unresolvable host (hostname instead of IP, or an IP string that fails to parse/resolve) in INTERNAL_ADDRESS_AND_PORT, INTERNAL_IP, RPC_ADDRESS, or NATIVE_ADDRESS_AND_PORT.","commonSituations":"Nodes configured with hostnames in broadcast/native_address settings whose DNS no longer resolves; stale gossip from removed machines; typo'd address application states; IPv4/IPv6 mismatches.","solutions":["Fix the offending node's config to advertise literal IPs (broadcast_address, native_transport_address) rather than unresolvable hostnames","Clean stale gossip entries for decommissioned nodes before migration (removenode/assassinate)","Check DNS/resolv.conf health on the upgrading node if hostname-based addresses are used","Re-run the upgrade after the endpoint state is corrected"],"exampleFix":"// before (offending node cassandra.yaml)\nnative_transport_address: old-host.internal.example   # DNS gone\n// after\nnative_transport_address: 10.0.0.12","handlingStrategy":"try-catch","validationCode":"for (InetAddressAndPort addr : advertisedAddresses(epState)) {\n    try { InetAddress.getByName(addr.getAddress().getHostName()); }\n    catch (UnknownHostException e) { log.error(\"Unresolvable address {} on {}\", addr, endpoint); }\n}","typeGuard":null,"tryCatchPattern":"try { NodeAddresses a = GossipHelper.getAddressesFromEndpointState(endpoint, epState); }\ncatch (ConfigurationException e) {\n    if (e.getMessage().startsWith(\"Unknown host in epState\")) { /* fix DNS / use literal IPs, clean stale gossip */ }\n    else throw e;\n}","preventionTips":["Configure broadcast/native addresses as literal IPs, not hostnames","Ensure DNS reliability if hostnames are unavoidable","Purge gossip state of decommissioned nodes before migration"],"tags":["gossip","dns","upgrade","configuration","tcm"],"backgroundTag":"invalid-url-format","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"}