{"record":{"id":"d6dbecea5da15866","repo":"apache/iceberg","slug":"error-occurred-while-processing-s-request","errorCode":null,"errorMessage":"Error occurred while processing %s request","messagePattern":"Error occurred while processing (.+?) request","errorType":"exception","errorClass":"RESTException","httpStatus":null,"severity":"error","filePath":"core/src/main/java/org/apache/iceberg/rest/HTTPClient.java","lineNumber":328,"sourceCode":"    HttpUriRequestBase request = new HttpUriRequestBase(req.method().name(), req.requestUri());\n\n    req.headers().entries().forEach(e -> request.addHeader(e.name(), e.value()));\n\n    String encodedBody = req.encodedBody();\n    if (encodedBody != null) {\n      request.setEntity(new StringEntity(encodedBody));\n    }\n\n    HttpContext context = HttpClientContext.create();\n    try {\n      return httpClient.execute(\n          request,\n          context,\n          response ->\n              handleResponse(\n                  req, response, responseType, errorHandler, responseHeaders, parserContext));\n    } catch (IOException e) {\n      throw new RESTException(e, \"Error occurred while processing %s request\", req.method());\n    }\n  }\n\n  private <T extends RESTResponse> T handleResponse(\n      HTTPRequest request,\n      ClassicHttpResponse response,\n      Class<T> responseType,\n      Consumer<ErrorResponse> errorHandler,\n      Consumer<Map<String, String>> responseHeaders,\n      ParserContext parserContext)\n      throws IOException {\n    Map<String, String> respHeaders = Maps.newHashMap();\n    for (Header header : response.getHeaders()) {\n      respHeaders.put(header.getName(), header.getValue());\n    }\n\n    responseHeaders.accept(respHeaders);\n","sourceCodeStart":310,"sourceCodeEnd":346,"githubUrl":"https://github.com/apache/iceberg/blob/86d9c8fc543e7c56c9f624eb725f76c9baff9570/core/src/main/java/org/apache/iceberg/rest/HTTPClient.java#L310-L346","documentation":"HTTPClient.execute wraps any IOException thrown while sending the request or receiving the response in a RESTException with this message. It means the HTTP exchange itself failed at the transport level (connection problems, broken streams, socket errors), not that the server returned an error status — error statuses go through the configured errorHandler instead. The causing IOException is chained as the cause.","triggerScenarios":"Any REST catalog call (loadTable, commit, etc.) where the underlying Apache HttpClient throws IOException during request execution: connection reset, socket timeout surfaced as IOException, premature EOF, or broken connection pool streams.","commonSituations":"Server closed the connection mid-response; network interruption or proxy dropped the connection; TLS handshake failures surfaced as IOException; Kubernetes ingress terminating long-running requests; keep-alive connections closed by the server between calls.","solutions":["Inspect the chained cause (e.getCause()) to find the underlying IOException and fix its root cause (connectivity, TLS, proxy).","Retry the request — transient connection drops are often fixed by enabling client-side retry.","Verify the REST catalog URI, network/DNS, and that the server is reachable (curl the endpoint).","Check server and proxy timeouts; increase or align them with the client's socket timeout settings.","Check server logs for crashes or connection limits around the time of the failure."],"exampleFix":"// before: one-shot call that surfaces transport errors\nTable table = catalog.loadTable(identifier);\n// after: catch and retry transient transport failures\ntry {\n  Table table = catalog.loadTable(identifier);\n} catch (RESTException e) {\n  if (e.getCause() instanceof IOException) {\n    // retry with backoff or surface a connection-level failure\n  }\n  throw e;\n}","handlingStrategy":"retry","validationCode":null,"typeGuard":null,"tryCatchPattern":"try {\n  catalog.loadTable(id);\n} catch (RESTException e) {\n  if (e.getCause() instanceof IOException && isTransient(e.getCause())) {\n    retryWithBackoff(() -> catalog.loadTable(id));\n  } else {\n    throw e;\n  }\n}","preventionTips":["Configure client-side retry with backoff for idempotent requests.","Align client socket timeouts with server/proxy timeouts.","Monitor server logs for connection resets around failures."],"tags":["rest-catalog","http-client","network","io-exception"],"backgroundTag":"network-request-failed","analyzedSha":"86d9c8fc543e7c56c9f624eb725f76c9baff9570","analyzedAt":"2026-09-12T00:46:39.097Z","contentChangedAt":"2026-09-12T00:46:39.097Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}