{"record":{"id":"3052615baea8c80e","repo":"apache/druid","slug":"error-reading-response","errorCode":null,"errorMessage":"Error reading response","messagePattern":"Error reading response","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"server/src/main/java/org/apache/druid/server/lookup/cache/LookupCoordinatorManager.java","lineNumber":823,"sourceCode":"                result,\n                LOOKUPS_STATE_TYPE_REFERENCE\n            );\n            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);","sourceCodeStart":805,"sourceCodeEnd":841,"githubUrl":"https://github.com/apache/druid/blob/9b90983fd291f26935af934383ce360473179e4d/server/src/main/java/org/apache/druid/server/lookup/cache/LookupCoordinatorManager.java#L805-L841","documentation":"When updating a lookup node via HTTP POST, a non-success response is received. The coordinator tries to read the response body for the error message; if reading the stream itself throws IOException, it logs a warning that the error response could not be read, then still throws an IOException describing the failed update.","triggerScenarios":"updateNode() POSTs to a lookup node and receives a bad HTTP status; StreamUtils.copyAndClose fails reading the error body (connection reset, stream closed).","commonSituations":"Lookup node under load resets connections; node crashed mid-response; network interruption between coordinator and node; wrong port/URL hitting a different service.","solutions":["Check connectivity and health of the target lookup node URL.","Inspect lookup node logs for why the update returned a bad status.","Retry the lookup update; the management loop will retry on the next cycle."],"exampleFix":null,"handlingStrategy":"retry","validationCode":"// pre-check node health before update\nint code = httpGetStatus(nodeUrl + \"/status/health\");\nif (code != 200) throw new SkipUpdateException(nodeUrl);","typeGuard":null,"tryCatchPattern":"try { updateNode(url, lookups); } catch (IOException e) { LOG.warn(\"lookup update to %s failed, will retry next cycle\", url, e); }","preventionTips":["Monitor lookup node health endpoints","Keep HTTP read/connect timeouts sane for loaded nodes","Rely on the coordinator's periodic loop to retry failed updates"],"tags":["http","network","io"],"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-14T05:17:10.506Z"}