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

  1. Read the 'caused by' in the exception to see the underlying client/network error.
  2. Verify hosts, port and scheme (http vs https) in the Easysearch sink URL option and test with curl from the same host.
  3. Check cluster health (GET _cluster/health) and node availability; scale or restart nodes as needed.
  4. Increase timeout/retry settings in the sink options if failures are due to transient load.
  5. 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

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


AI-assisted analysis of apache/seatunnel@cf67b549a7 (2026-09-10). Data as JSON: /api/errors/74d44c2f264d4275. Report an issue: GitHub.