apache/druid · error · RE
Worker on host %s does not exists
Error message
Worker on host %s does not exists
What it means
sendRequestToWorker looks up the target worker by host among the WorkerTaskRunner's registered workers. If no registered worker matches the given host, it throws RequestException stating the worker does not exist.
Source
Thrown at indexing-service/src/main/java/org/apache/druid/indexing/overlord/WorkerTaskRunnerQueryAdapter.java:81
}
private void sendRequestToWorker(String workerHost, WorkerTaskRunner.ActionType action)
{
WorkerTaskRunner workerTaskRunner = getWorkerTaskRunner();
if (workerTaskRunner == null) {
throw new RE("Task Runner does not support enable/disable worker actions");
}
Optional<ImmutableWorkerInfo> workerInfo = Iterables.tryFind(
workerTaskRunner.getWorkers(),
entry -> entry.getWorker()
.getHost()
.equals(workerHost)
);
if (!workerInfo.isPresent()) {
throw new RE(
"Worker on host %s does not exists",
workerHost
);
}
String actionName = WorkerTaskRunner.ActionType.ENABLE.equals(action) ? "enable" : "disable";
final URL workerUrl = TaskRunnerUtils.makeWorkerURL(
workerInfo.get().getWorker(),
"/druid/worker/v1/%s",
actionName
);
try {
final StatusResponseHolder response = httpClient.go(
new Request(HttpMethod.POST, workerUrl),
StatusResponseHandler.getInstance()
).get();
View on GitHub (pinned to 9b90983fd2)
Solutions
- Fetch the exact host string from GET /druid/indexer/v1/workers and pass it verbatim.
- Verify the worker is registered and not blacklisted/decommissioned before calling.
- Correct hostname/port mismatches so they match the registered worker entry.
Defensive patterns
Strategy: validation
Validate before calling
boolean exists = workersResponse.stream()
.anyMatch(w -> w.getWorker().getHost().equals(targetHost));
if (!exists) {
throw new IllegalArgumentException("Unknown worker host: " + targetHost);
} Try / catch
try {
adapter.disableWorker(host);
} catch (RequestException e) {
if (e.getMessage().startsWith("Worker on host")) {
// refresh worker list from /druid/indexer/v1/workers and retry with valid host
}
} Prevention
- Copy host strings from the current workers listing endpoint, never from memory.
- Re-fetch the worker list after decommissions to handle worker churn.
- Normalize host strings (no scheme, exact host:port) to match registry entries.
When it happens
Trigger: POSTing enable/disable to /druid/indexer/v1/worker with a host parameter not in the current worker list — typo'd hostname, wrong port, worker already decommissioned, or a host string formatted differently from the registry entry.
Common situations: Using the worker's IP while it registered with a hostname; calling after the worker was removed from the cluster; automation scripts holding stale worker lists.
Understand the failure class
Background: "Not found" and "does not exist" errors: why "Task not found", "No such folder", and "Can't find" fire when a lookup comes back empty — this error's family across 14 libraries.
Related errors
- Action [%s] failed for worker [%s] with status %s(%s)
- Exception while getting active tasks from Overlord. Will ret
- User [%s] does not exist.
- Batched segment allocation is disabled
- Cannot allocate segment if not leader.
AI-assisted analysis of apache/druid@9b90983fd2 (2026-09-07).
Data as JSON: /api/errors/ec2db34aec2bae55.
Report an issue: GitHub.