{"record":{"id":"5de7a6af85f13cfb","repo":"apache/seatunnel","slug":"scroll-request-error-5de7a6","errorCode":"SCROLL_REQUEST_ERROR","errorMessage":"POST {endpoint} response null","messagePattern":"POST (.+?) response null","errorType":"error_code","errorClass":"ElasticsearchConnectorException","httpStatus":null,"severity":"error","filePath":"seatunnel-connectors-v2/connector-elasticsearch/src/main/java/org/apache/seatunnel/connectors/seatunnel/elasticsearch/client/EsRestClient.java","lineNumber":397,"sourceCode":"                        endpoint,\n                        response.getStatusLine().getStatusCode(),\n                        cursor);\n                return false;\n            }\n        } catch (Exception ex) {\n            log.warn(\"Failed to close SQL cursor: {}\", cursor, ex);\n            return false;\n        }\n    }\n\n    private ScrollResult getDocsFromSqlResult(\n            String endpoint, String requestBody, JsonNode columnNodes) {\n        Request request = new Request(\"POST\", endpoint);\n        request.setJsonEntity(requestBody);\n        try {\n            Response response = restClient.performRequest(request);\n            if (response == null) {\n                throw new ElasticsearchConnectorException(\n                        ElasticsearchConnectorErrorCode.SCROLL_REQUEST_ERROR,\n                        \"POST \" + endpoint + \" response null\");\n            }\n            String entity = EntityUtils.toString(response.getEntity(), StandardCharsets.UTF_8);\n            if (response.getStatusLine().getStatusCode() == HttpStatus.SC_OK) {\n                ObjectNode responseJson = JsonUtils.parseObject(entity);\n                return getDocsFromSqlResponse(responseJson, columnNodes);\n            } else {\n                throw new ElasticsearchConnectorException(\n                        ElasticsearchConnectorErrorCode.SCROLL_REQUEST_ERROR,\n                        String.format(\n                                \"POST %s response status code=%d, body=%s, request body=%s\",\n                                endpoint,\n                                response.getStatusLine().getStatusCode(),\n                                entity,\n                                requestBody));\n            }\n        } catch (IOException e) {","sourceCodeStart":379,"sourceCodeEnd":415,"githubUrl":"https://github.com/apache/seatunnel/blob/cf67b549a7a6c35fa0beb12d83c62892427ea919/seatunnel-connectors-v2/connector-elasticsearch/src/main/java/org/apache/seatunnel/connectors/seatunnel/elasticsearch/client/EsRestClient.java#L379-L415","documentation":"getDocsFromSqlResult sends a POST request (SQL or scroll endpoint) and throws ElasticsearchConnectorException with code SCROLL_REQUEST_ERROR when performRequest returns a null Response. Like the bulk null-check, this prevents NPEs when reading status/entity from an absent response.","triggerScenarios":"POST to the SQL/scroll endpoint returning null Response: closed connection, abnormal transport state, or a failed/mocked RestClient during searchBySql/scrollResult/searchWithSql flows.","commonSituations":"Connection pool exhaustion killing in-flight requests; Elasticsearch node restart during scroll pagination; LB idle timeouts cutting long scroll requests; misconfigured client behind a proxy.","solutions":["Verify cluster connectivity and RestClient configuration","Retry the SQL/scroll request; scrolls are resumable via the scroll id if one was obtained","Check proxy/LB idle-timeout settings for long-running scroll requests","Catch ElasticsearchConnectorException with SCROLL_REQUEST_ERROR and re-issue the query with backoff"],"exampleFix":null,"handlingStrategy":"retry","validationCode":"if (scrollId != null && !isScrollContextAlive(scrollId)) { reissueSearch(); }","typeGuard":null,"tryCatchPattern":"try { result = client.searchBySql(sql); } catch (ElasticsearchConnectorException e) { if (SCROLL_REQUEST_ERROR.equals(e.getErrorCode())) retryWithBackoff(sql); else throw e; }","preventionTips":["Tune LB/proxy idle timeouts above scroll request duration","Re-issue the original search if a scroll context may be lost","Keep the RestClient connection pool sized for concurrent readers"],"tags":["elasticsearch","sql","scroll","null-response"],"backgroundTag":"empty-response-body","analyzedSha":"cf67b549a7a6c35fa0beb12d83c62892427ea919","analyzedAt":"2026-09-10T21:44:55.265Z","contentChangedAt":"2026-09-10T21:44:55.265Z","schemaVersion":2},"datasetVersion":"2026-09-14T11:17:12.474Z"}