{"record":{"id":"b891f64292b5147c","repo":"apache/cassandra","slug":"unknown-host-specified-stringhost","errorCode":null,"errorMessage":"Unknown host specified ${stringHost}","messagePattern":"Unknown host specified (.+?)","errorType":"validation","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"src/java/org/apache/cassandra/service/Rebuild.java","lineNumber":155,"sourceCode":"            {\n                if (specificSources != null)\n                {\n                    String[] stringHosts = specificSources.split(\",\");\n                    Set<InetAddressAndPort> sources = new HashSet<>(stringHosts.length);\n                    for (String stringHost : stringHosts)\n                    {\n                        try\n                        {\n                            InetAddressAndPort endpoint = InetAddressAndPort.getByName(stringHost);\n                            if (getBroadcastAddressAndPort().equals(endpoint))\n                            {\n                                throw new IllegalArgumentException(\"This host was specified as a source for rebuilding. Sources for a rebuild can only be other nodes in the cluster.\");\n                            }\n                            sources.add(endpoint);\n                        }\n                        catch (UnknownHostException ex)\n                        {\n                            throw new IllegalArgumentException(\"Unknown host specified \" + stringHost, ex);\n                        }\n                    }\n                    streamer.addSourceFilter(new RangeStreamer.AllowedSourcesFilter(sources));\n                }\n\n                streamer.addKeyspaceToFetch(keyspace);\n            }\n\n            StreamResultFuture streamResult = streamer.fetchAsync();\n\n            Future<?> accordReady = AccordService.instance().epochReadyFor(metadata, EpochReady::reads);\n            Future<?> ready = FutureCombiner.allOf(streamResult, accordReady);\n\n            // wait for result\n            ready.get();\n        }\n        catch (InterruptedException e)\n        {","sourceCodeStart":137,"sourceCodeEnd":173,"githubUrl":"https://github.com/apache/cassandra/blob/88fd0f6a0eaed8943f05ac9e8f947882b8ddc8f1/src/java/org/apache/cassandra/service/Rebuild.java#L137-L173","documentation":"Each host in --specific-sources is resolved with InetAddressAndPort.getByName; if DNS/hosts-file resolution fails, UnknownHostException is wrapped in an IllegalArgumentException naming the unresolvable host.","triggerScenarios":"rebuild with specificSources containing a hostname that cannot be resolved to an IP address.","commonSituations":"Typo in hostname; DNS outage or missing /etc/hosts entry on the node; stale hostname of a decommissioned node; using a name only resolvable in another datacenter's DNS zone.","solutions":["Use IP addresses (with port, e.g. 10.0.0.5:7000) instead of hostnames in --specific-sources","Fix DNS or add the peer to /etc/hosts, then retry","Remove entries for decommissioned nodes from the source list"],"exampleFix":"// before\nnodetool rebuild --specific-sources cassandra-node7.internal\n// after (DNS broken; use IP)\nnodetool rebuild --specific-sources 10.0.0.7:7000","handlingStrategy":"validation","validationCode":"for (String h : hosts)\n    try { InetAddressAndPort.getByName(h); }\n    catch (UnknownHostException e) { throw new IllegalArgumentException(\"unresolvable host in sources: \" + h); }","typeGuard":null,"tryCatchPattern":"try { rebuild(...); } catch (IllegalArgumentException e) { if (e.getMessage().startsWith(\"Unknown host specified\")) retryWithoutHost(e); else throw e; }","preventionTips":["Prefer IPs with ports over hostnames in --specific-sources","Verify DNS/hosts-file resolution on the rebuilding node beforehand","Purge decommissioned node names from source lists"],"tags":["network","dns","rebuild","arguments"],"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-14T21:17:11.552Z"}