{"record":{"id":"1cef89d390913cc6","repo":"apache/druid","slug":"bad-update-request-to-s-d-s-response","errorCode":null,"errorMessage":"Bad update request to [%s] : [%d] : [%s]  Response: [%s]","messagePattern":"Bad update request to \\[(.+?)\\] : \\[(.+?)\\] : \\[(.+?)\\]  Response: \\[(.+?)\\]","errorType":"exception","errorClass":"IOException","httpStatus":null,"severity":"error","filePath":"server/src/main/java/org/apache/druid/server/lookup/cache/LookupCoordinatorManager.java","lineNumber":826,"sourceCode":"            LOG.debug(\n                \"Update on [%s], Status: %s reason: [%s], Response [%s].\", url, returnCode.get(), reasonString.get(),\n                response\n            );\n            return response;\n          }\n          catch (IOException ex) {\n            throw new IOE(ex, \"Failed to parse update response from [%s]. response [%s]\", url, result);\n          }\n        } else {\n          final ByteArrayOutputStream baos = new ByteArrayOutputStream();\n          try {\n            StreamUtils.copyAndClose(result, baos);\n          }\n          catch (IOException e2) {\n            LOG.warn(e2, \"Error reading response\");\n          }\n\n          throw new IOE(\n              \"Bad update request to [%s] : [%d] : [%s]  Response: [%s]\",\n              url,\n              returnCode.get(),\n              reasonString.get(),\n              StringUtils.fromUtf8(baos.toByteArray())\n          );\n        }\n      }\n    }\n\n    public LookupsState<LookupExtractorFactoryMapContainer> getLookupStateForNode(\n        HostAndPortWithScheme node\n    ) throws IOException, InterruptedException, ExecutionException\n    {\n      final URL url = getLookupsURL(node);\n      final AtomicInteger returnCode = new AtomicInteger(0);\n      final AtomicReference<String> reasonString = new AtomicReference<>(null);\n","sourceCodeStart":808,"sourceCodeEnd":844,"githubUrl":"https://github.com/apache/druid/blob/9b90983fd291f26935af934383ce360473179e4d/server/src/main/java/org/apache/druid/server/lookup/cache/LookupCoordinatorManager.java#L808-L844","documentation":"updateNode() throws this IOException when the HTTP POST to a lookup node's update endpoint returns a non-2xx status code. The message embeds the URL, status code, reason phrase, and whatever of the response body could be read, so the caller can see why the node rejected the update.","triggerScenarios":"POSTing lookup updates to a node whose HTTP endpoint responds 4xx/5xx — e.g. malformed update payload JSON, node not fully started, endpoint returning 404 because the node runs a version without the lookups endpoint, or 503 during node shutdown.","commonSituations":"Version skew between coordinator and lookup nodes (old nodes lacking the update API), invalid lookup spec/config rejected by the node, hitting a node during restart or rolling upgrade, wrong Druid node type addressed (non-lookup service in the tier).","solutions":["Read the status code and response body in the exception message to identify why the node rejected the request","Verify the target URL points at a lookup-capable node with the /druid/listen/v1/lookups endpoint","Fix the lookup spec JSON so the node accepts it (validate the spec schema)","Confirm coordinator and lookup node versions are compatible; upgrade mismatched nodes"],"exampleFix":"// before\n// posting to wrong port/path\nString url = \"http://node:8081/druid/listen/v1/lookups\"; // wrong service\n// after\nString url = \"http://node:8080/druid/listen/v1/lookups\"; // correct lookup listener port","handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"try {\n  coordinator.updateNode(host, lookupMap);\n} catch (IOException e) {\n  String msg = e.getMessage();\n  if (msg != null && msg.startsWith(\"Bad update request\")) {\n    int code = parseStatusCode(msg); // inspect embedded status code\n    LOG.error(\"Lookup node rejected update with HTTP %d\", code);\n  }\n}","preventionTips":["Validate lookup spec JSON against the schema before publishing updates","Keep coordinator and lookup node Druid versions in sync","Avoid pushing updates while nodes are restarting (rolling upgrade windows)","Ensure target URLs point at lookup-listener ports, not coordinator ports"],"tags":["http","api"],"backgroundTag":"http-error-response","analyzedSha":"9b90983fd291f26935af934383ce360473179e4d","analyzedAt":"2026-09-07T13:32:30.957Z","contentChangedAt":"2026-09-07T13:32:30.957Z","schemaVersion":2},"datasetVersion":"2026-09-17T15:17:12.973Z"}