{"record":{"id":"ec2db34aec2bae55","repo":"apache/druid","slug":"worker-on-host-s-does-not-exists","errorCode":null,"errorMessage":"Worker on host %s does not exists","messagePattern":"Worker on host (.+?) does not exists","errorType":"exception","errorClass":"RE","httpStatus":null,"severity":"error","filePath":"indexing-service/src/main/java/org/apache/druid/indexing/overlord/WorkerTaskRunnerQueryAdapter.java","lineNumber":81,"sourceCode":"  }\n\n  private void sendRequestToWorker(String workerHost, WorkerTaskRunner.ActionType action)\n  {\n    WorkerTaskRunner workerTaskRunner = getWorkerTaskRunner();\n\n    if (workerTaskRunner == null) {\n      throw new RE(\"Task Runner does not support enable/disable worker actions\");\n    }\n\n    Optional<ImmutableWorkerInfo> workerInfo = Iterables.tryFind(\n        workerTaskRunner.getWorkers(),\n        entry -> entry.getWorker()\n                      .getHost()\n                      .equals(workerHost)\n    );\n\n    if (!workerInfo.isPresent()) {\n      throw new RE(\n          \"Worker on host %s does not exists\",\n          workerHost\n      );\n    }\n\n    String actionName = WorkerTaskRunner.ActionType.ENABLE.equals(action) ? \"enable\" : \"disable\";\n    final URL workerUrl = TaskRunnerUtils.makeWorkerURL(\n        workerInfo.get().getWorker(),\n        \"/druid/worker/v1/%s\",\n        actionName\n    );\n\n    try {\n      final StatusResponseHolder response = httpClient.go(\n          new Request(HttpMethod.POST, workerUrl),\n          StatusResponseHandler.getInstance()\n      ).get();\n","sourceCodeStart":63,"sourceCodeEnd":99,"githubUrl":"https://github.com/apache/druid/blob/9b90983fd291f26935af934383ce360473179e4d/indexing-service/src/main/java/org/apache/druid/indexing/overlord/WorkerTaskRunnerQueryAdapter.java#L63-L99","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","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."],"exampleFix":null,"handlingStrategy":"validation","validationCode":"boolean exists = workersResponse.stream()\n    .anyMatch(w -> w.getWorker().getHost().equals(targetHost));\nif (!exists) {\n  throw new IllegalArgumentException(\"Unknown worker host: \" + targetHost);\n}","typeGuard":null,"tryCatchPattern":"try {\n  adapter.disableWorker(host);\n} catch (RequestException e) {\n  if (e.getMessage().startsWith(\"Worker on host\")) {\n    // refresh worker list from /druid/indexer/v1/workers and retry with valid host\n  }\n}","preventionTips":["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."],"tags":["druid","overlord","worker","not-found"],"backgroundTag":"entity-not-found","analyzedSha":"9b90983fd291f26935af934383ce360473179e4d","analyzedAt":"2026-09-07T13:32:30.957Z","contentChangedAt":"2026-09-07T13:32:30.957Z","schemaVersion":2},"datasetVersion":"2026-09-14T11:17:12.474Z"}