apache/seatunnel · error · ElasticsearchConnectorException
GET_ES_VERSION_FAILED
GET_ES_VERSION_FAILED
Error message
fail to get elasticsearch version.
What it means
EsRestClient.getClusterInfo queries the cluster info endpoint to determine the Elasticsearch version and distribution. If the HTTP exchange throws IOException, it rethrows as ElasticsearchConnectorException with code GET_ES_VERSION_FAILED and this message. It fires at client/catalog initialization, so it usually blocks any subsequent operation.
Source
Thrown at seatunnel-connectors-v2/connector-elasticsearch/src/main/java/org/apache/seatunnel/connectors/seatunnel/elasticsearch/client/EsRestClient.java:173
}
}
public ElasticsearchClusterInfo getClusterInfo() {
Request request = new Request("GET", "/");
try {
Response response = restClient.performRequest(request);
String result = EntityUtils.toString(response.getEntity(), StandardCharsets.UTF_8);
JsonNode jsonNode = OBJECT_MAPPER.readTree(result);
JsonNode versionNode = jsonNode.get("version");
return ElasticsearchClusterInfo.builder()
.clusterVersion(versionNode.get("number").asText())
.distribution(
Optional.ofNullable(versionNode.get("distribution"))
.map(JsonNode::asText)
.orElse(null))
.build();
} catch (IOException e) {
throw new ElasticsearchConnectorException(
ElasticsearchConnectorErrorCode.GET_ES_VERSION_FAILED,
"fail to get elasticsearch version.",
e);
}
}
@Override
public void close() {
try {
restClient.close();
} catch (IOException e) {
log.warn("close elasticsearch connection error", e);
}
}
/**
* first time to request search documents by scroll call /${index}/_search?scroll=${scroll}
*View on GitHub (pinned to cf67b549a7)
Solutions
- Check the chained IOException for the exact transport failure
- Verify host/port/credentials with curl: curl http://es-host:9200/
- If using HTTPS, ensure the scheme and truststore/certificate are configured correctly
- Confirm the Elasticsearch cluster is running and reachable from the SeaTunnel node
- Retry initialization after transient network/cluster recovery
Example fix
// before
ElasticSearchCatalog catalog = new ElasticSearchCatalog("es", options); // throws GET_ES_VERSION_FAILED
// after
try {
catalog = new ElasticSearchCatalog("es", options);
} catch (CatalogException e) {
LOG.error("Cannot reach Elasticsearch, check host/port/credentials", e);
throw e;
} Defensive patterns
Strategy: try-catch
Validate before calling
// Before creating the client: curl-equivalent check
// new HttpGet("http://es-host:9200/") returns 200 with version JSON Try / catch
try { catalog = new ElasticSearchCatalog("es", options); } catch (Exception e) { if (message contains "fail to get elasticsearch version") { LOG.error("ES unreachable: check host/port/TLS", e); } throw e; } Prevention
- Validate ES host/port/credentials during deployment config checks
- Use HTTPS with a proper truststore when the cluster is TLS-enabled
- Ensure network/firewall allows the SeaTunnel node to reach port 9200
- Retry client creation on transient network failures
When it happens
Trigger: IOException while GET-ing cluster info during getClusterInfo — called during client initialization, connection tests, and several test paths: ES unreachable, auth failure handled as IO, TLS errors, connection timeouts.
Common situations: Wrong address or port in ES config; Elasticsearch down or upgrading; TLS certificate issues; security plugin returning 401 surfaced through an IOException wrapper; firewall blocking the port.
Understand the failure class
Background: "API request failed": what wrapped HTTP errors from external APIs mean and how to find the real cause — this error's family across 29 libraries.
Related errors
- Failed to clear scroll ID: ${scrollId}
- Failed to close SQL cursor: {}
- Failed to close SQL cursor: {}
- Failed to fetch metadata from Gravitino for metadata: %s
- fail get tableSchema:
AI-assisted analysis of apache/seatunnel@cf67b549a7 (2026-09-10).
Data as JSON: /api/errors/ec21e29d638f05e8.
Report an issue: GitHub.