apache/seatunnel · critical · EasysearchConnectorException
SQL_OPERATION_FAILED
SQL_OPERATION_FAILED
Error message
Easysearch execute batch statement error
What it means
bulkEzsWithRetry wraps its whole retry loop in a catch(Exception) that rethrows as SQL_OPERATION_FAILED 'Easysearch execute batch statement error' with the original cause attached. Any failure other than the per-item bulk error (924) — client connection failures, timeouts, IO errors, interruption during retries — surfaces under this message.
Source
Thrown at seatunnel-connectors-v2/connector-easysearch/src/main/java/org/apache/seatunnel/connectors/seatunnel/easysearch/sink/EasysearchSinkWriter.java:122
try {
RetryUtils.retryWithException(
() -> {
if (!requestEzsList.isEmpty()) {
String requestBody = String.join("\n", requestEzsList) + "\n";
BulkResponse bulkResponse = ezsClient.bulk(requestBody);
if (bulkResponse.isErrors()) {
throw new EasysearchConnectorException(
EasysearchConnectorErrorCode.BULK_RESPONSE_ERROR,
"bulk ezs error: " + bulkResponse.getResponse());
}
return bulkResponse;
}
return null;
},
retryMaterial);
requestEzsList.clear();
} catch (Exception e) {
throw new EasysearchConnectorException(
SQL_OPERATION_FAILED, "Easysearch execute batch statement error", e);
}
}
@Override
public void close() throws IOException {
bulkEzsWithRetry(this.ezsClient, this.requestEzsList);
ezsClient.close();
}
}
View on GitHub (pinned to cf67b549a7)
Solutions
- Read the 'caused by' in the exception to see the underlying client/network error.
- Verify hosts, port and scheme (http vs https) in the Easysearch sink URL option and test with curl from the same host.
- Check cluster health (GET _cluster/health) and node availability; scale or restart nodes as needed.
- Increase timeout/retry settings in the sink options if failures are due to transient load.
- Fix TLS/keystore configuration (see SSLUtils errors 927-929) if handshake errors appear.
Example fix
// before url = "http://wrong-host:9200" // after url = "http://es-master:9200"
Defensive patterns
Strategy: retry
Validate before calling
// shell: pre-flight connectivity check
curl -sS -o /dev/null -w '%{http_code}' http://es-host:9200/_cluster/health || echo 'cluster unreachable' Try / catch
try { writer.write(row); } catch (EasysearchConnectorException e) { if (e.getSeaTunnelErrorCode() == SQL_OPERATION_FAILED) { Throwable c = e.getCause(); /* inspect cause: UnknownHost/ConnectException/timeout -> retry with backoff or fail job */ log.error("Bulk to Easysearch failed, cause={}", c == null ? null : c.toString()); } throw e; } Prevention
- Validate host/port/scheme in the URL with curl from the SeaTunnel node before submitting the job
- Monitor cluster health and load; size timeouts/retries for peak traffic
- Ensure TLS keystore config is correct if using https
When it happens
Trigger: ezsClient.bulk() throwing due to connection refused/reset, TLS handshake failure, socket/read timeout, host unresolvable, or retries exhausted via RetryUtils; also request building/IO failures inside the retried lambda.
Common situations: Wrong host/port in the sink URL config; Easysearch cluster down or restarting; network/firewall blocking the node; TLS certs misconfigured; cluster overloaded causing repeated timeouts until retries exhaust.
Related errors
- BULK_RESPONSE_ERROR
- DROP_INDEX_FAILED
- BULK_RESPONSE_ERROR
- Error clearing scrollId
- Failed to clear Easysearch scrollId:
AI-assisted analysis of apache/seatunnel@cf67b549a7 (2026-09-10).
Data as JSON: /api/errors/74d44c2f264d4275.
Report an issue: GitHub.