apache/cassandra · error · IllegalArgumentException
Unknown host specified ${stringHost}
Error message
Unknown host specified ${stringHost} What it means
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.
Source
Thrown at src/java/org/apache/cassandra/service/Rebuild.java:155
{
if (specificSources != null)
{
String[] stringHosts = specificSources.split(",");
Set<InetAddressAndPort> sources = new HashSet<>(stringHosts.length);
for (String stringHost : stringHosts)
{
try
{
InetAddressAndPort endpoint = InetAddressAndPort.getByName(stringHost);
if (getBroadcastAddressAndPort().equals(endpoint))
{
throw new IllegalArgumentException("This host was specified as a source for rebuilding. Sources for a rebuild can only be other nodes in the cluster.");
}
sources.add(endpoint);
}
catch (UnknownHostException ex)
{
throw new IllegalArgumentException("Unknown host specified " + stringHost, ex);
}
}
streamer.addSourceFilter(new RangeStreamer.AllowedSourcesFilter(sources));
}
streamer.addKeyspaceToFetch(keyspace);
}
StreamResultFuture streamResult = streamer.fetchAsync();
Future<?> accordReady = AccordService.instance().epochReadyFor(metadata, EpochReady::reads);
Future<?> ready = FutureCombiner.allOf(streamResult, accordReady);
// wait for result
ready.get();
}
catch (InterruptedException e)
{View on GitHub (pinned to 88fd0f6a0e)
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
Example fix
// before nodetool rebuild --specific-sources cassandra-node7.internal // after (DNS broken; use IP) nodetool rebuild --specific-sources 10.0.0.7:7000
Defensive patterns
Strategy: validation
Validate before calling
for (String h : hosts)
try { InetAddressAndPort.getByName(h); }
catch (UnknownHostException e) { throw new IllegalArgumentException("unresolvable host in sources: " + h); } Try / catch
try { rebuild(...); } catch (IllegalArgumentException e) { if (e.getMessage().startsWith("Unknown host specified")) retryWithoutHost(e); else throw e; } Prevention
- 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
When it happens
Trigger: rebuild with specificSources containing a hostname that cannot be resolved to an IP address.
Common situations: 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.
Understand the failure class
Background: "Invalid URL" errors: why new URL(), URI.parse, and reqwest::Url reject your string — missing scheme, whitespace, and bad path format — this error's family across 39 libraries.
Related errors
- This host was specified as a source for rebuilding. Sources
- Unknown listen_address '
- Unknown broadcast_address '
- Unknown host in rpc_address
- Replacement host name could not be resolved or scope_id was
AI-assisted analysis of apache/cassandra@88fd0f6a0e (2026-09-10).
Data as JSON: /api/errors/b891f64292b5147c.
Report an issue: GitHub.