{"record":{"id":"13607ea9437cea2b","repo":"apache/cassandra","slug":"unknown-host","errorCode":null,"errorMessage":"Unknown host ","messagePattern":"Unknown host ","errorType":"validation","errorClass":"ConfigurationException","httpStatus":null,"severity":"error","filePath":"src/java/org/apache/cassandra/locator/TopologyFileLocationProvider.java","lineNumber":128,"sourceCode":"        {\n            String key = (String) entry.getKey();\n            String value = (String) entry.getValue();\n            if (DEFAULT_PROPERTY.equals(key))\n                continue;\n\n            String hostString = StringUtils.remove(key, '/');\n            try\n            {\n                InetAddressAndPort host = InetAddressAndPort.getByName(hostString);\n                if (host.equals(broadcastAddress))\n                {\n                    local = makeLocation(value);\n                    break;\n                }\n            }\n            catch (UnknownHostException e)\n            {\n                throw new ConfigurationException(\"Unknown host \" + hostString, e);\n            }\n\n        }\n\n        // This may be null, which is ok unless config doesn't contain the location of the local node\n        Location defaultLocation = makeLocation(properties.getProperty(DEFAULT_PROPERTY));\n\n        if (local == null)\n        {\n            if (defaultLocation == null)\n            {\n                throw new ConfigurationException(String.format(\"Snitch definitions at %s do not define a location for \" +\n                                                               \"this node's broadcast address %s, nor does it provides a default\",\n                                                               PROPERTIES_FILENAME, broadcastAddress));\n            }\n            else\n            {\n                logger.debug(\"Broadcast address {} was not present in snitch config, using default location {}. \" +","sourceCodeStart":110,"sourceCodeEnd":146,"githubUrl":"https://github.com/apache/cassandra/blob/88fd0f6a0eaed8943f05ac9e8f947882b8ddc8f1/src/java/org/apache/cassandra/locator/TopologyFileLocationProvider.java#L110-L146","documentation":"TopologyFileLocationProvider loads a topology properties file mapping node IPs/broadcast addresses to rack/datacenter Locations. During loadConfiguration, each value is resolved via makeLocation which calls InetAddress.getByName; an UnknownHostException means a host string in the file could not be resolved, so the snitch configuration cannot be built and a ConfigurationException is thrown wrapping the original error.","triggerScenarios":"The topology.properties file (cassandra-topology.properties) contains an unresolvable hostname or malformed IP in a node mapping (or the default) value, so InetAddress.getByName fails while building the Location for that entry.","commonSituations":"Typos in hostnames in cassandra-topology.properties; DNS not resolvable in the cluster environment (private IPs or no reverse DNS); stale entries for decommissioned nodes; using hostnames in containers/Kubernetes where DNS names change.","solutions":["Replace the unresolvable hostname in cassandra-topology.properties with the node's IP address or a resolvable DNS name","Verify DNS resolution from the Cassandra node (e.g. `getent hosts <name>` or `nslookup`)","Remove stale entries for decommissioned nodes from the properties file","Ensure the DEFAULT_PROPERTY (default location) value also resolves correctly"],"exampleFix":"# before (cassandra-topology.properties)\n10.0.0.5=node1.internal.old-dns.zone:RAC1\n\n# after\n10.0.0.5=10.0.0.5:RAC1","handlingStrategy":"validation","validationCode":"for (String host : hostsInTopologyFile) {\n    try { InetAddress.getByName(host); }\n    catch (UnknownHostException e) { throw new IllegalArgumentException(\"Unresolvable host in topology file: \" + host, e); }\n}","typeGuard":null,"tryCatchPattern":"try { startCassandra(); } catch (ConfigurationException e) { logger.error(\"Topology config invalid: {}\", e.getMessage()); }","preventionTips":["Use IP addresses instead of hostnames in cassandra-topology.properties","Verify DNS works from every node before rollout","Remove entries for decommissioned nodes"],"tags":["network","dns","configuration","snitch"],"backgroundTag":"dns-resolution-failed","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"}