apache/seatunnel · error · ElasticsearchConnectorException
SCROLL_REQUEST_ERROR
SCROLL_REQUEST_ERROR
Error message
POST {endpoint} response null What it means
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.
Source
Thrown at seatunnel-connectors-v2/connector-elasticsearch/src/main/java/org/apache/seatunnel/connectors/seatunnel/elasticsearch/client/EsRestClient.java:397
endpoint,
response.getStatusLine().getStatusCode(),
cursor);
return false;
}
} catch (Exception ex) {
log.warn("Failed to close SQL cursor: {}", cursor, ex);
return false;
}
}
private ScrollResult getDocsFromSqlResult(
String endpoint, String requestBody, JsonNode columnNodes) {
Request request = new Request("POST", endpoint);
request.setJsonEntity(requestBody);
try {
Response response = restClient.performRequest(request);
if (response == null) {
throw new ElasticsearchConnectorException(
ElasticsearchConnectorErrorCode.SCROLL_REQUEST_ERROR,
"POST " + endpoint + " response null");
}
String entity = EntityUtils.toString(response.getEntity(), StandardCharsets.UTF_8);
if (response.getStatusLine().getStatusCode() == HttpStatus.SC_OK) {
ObjectNode responseJson = JsonUtils.parseObject(entity);
return getDocsFromSqlResponse(responseJson, columnNodes);
} else {
throw new ElasticsearchConnectorException(
ElasticsearchConnectorErrorCode.SCROLL_REQUEST_ERROR,
String.format(
"POST %s response status code=%d, body=%s, request body=%s",
endpoint,
response.getStatusLine().getStatusCode(),
entity,
requestBody));
}
} catch (IOException e) {View on GitHub (pinned to cf67b549a7)
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
Defensive patterns
Strategy: retry
Validate before calling
if (scrollId != null && !isScrollContextAlive(scrollId)) { reissueSearch(); } Try / catch
try { result = client.searchBySql(sql); } catch (ElasticsearchConnectorException e) { if (SCROLL_REQUEST_ERROR.equals(e.getErrorCode())) retryWithBackoff(sql); else throw e; } Prevention
- 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
When it happens
Trigger: POST to the SQL/scroll endpoint returning null Response: closed connection, abnormal transport state, or a failed/mocked RestClient during searchBySql/scrollResult/searchWithSql flows.
Common situations: 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.
Related errors
- DELETE {} response null for scroll ID: {}
- SCROLL_REQUEST_ERROR
- BULK_RESPONSE_ERROR
- GET_INDEX_DOCS_COUNT_FAILED
- LIST_INDEX_FAILED
AI-assisted analysis of apache/seatunnel@cf67b549a7 (2026-09-10).
Data as JSON: /api/errors/5de7a6af85f13cfb.
Report an issue: GitHub.