{"record":{"id":"74d44c2f264d4275","repo":"apache/seatunnel","slug":"sql-operation-failed-74d44c","errorCode":"SQL_OPERATION_FAILED","errorMessage":"Easysearch execute batch statement error","messagePattern":"Easysearch execute batch statement error","errorType":"error_code","errorClass":"EasysearchConnectorException","httpStatus":null,"severity":"critical","filePath":"seatunnel-connectors-v2/connector-easysearch/src/main/java/org/apache/seatunnel/connectors/seatunnel/easysearch/sink/EasysearchSinkWriter.java","lineNumber":122,"sourceCode":"        try {\n            RetryUtils.retryWithException(\n                    () -> {\n                        if (!requestEzsList.isEmpty()) {\n                            String requestBody = String.join(\"\\n\", requestEzsList) + \"\\n\";\n                            BulkResponse bulkResponse = ezsClient.bulk(requestBody);\n                            if (bulkResponse.isErrors()) {\n                                throw new EasysearchConnectorException(\n                                        EasysearchConnectorErrorCode.BULK_RESPONSE_ERROR,\n                                        \"bulk ezs error: \" + bulkResponse.getResponse());\n                            }\n                            return bulkResponse;\n                        }\n                        return null;\n                    },\n                    retryMaterial);\n            requestEzsList.clear();\n        } catch (Exception e) {\n            throw new EasysearchConnectorException(\n                    SQL_OPERATION_FAILED, \"Easysearch execute batch statement error\", e);\n        }\n    }\n\n    @Override\n    public void close() throws IOException {\n        bulkEzsWithRetry(this.ezsClient, this.requestEzsList);\n        ezsClient.close();\n    }\n}\n","sourceCodeStart":104,"sourceCodeEnd":133,"githubUrl":"https://github.com/apache/seatunnel/blob/cf67b549a7a6c35fa0beb12d83c62892427ea919/seatunnel-connectors-v2/connector-easysearch/src/main/java/org/apache/seatunnel/connectors/seatunnel/easysearch/sink/EasysearchSinkWriter.java#L104-L133","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","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."],"exampleFix":"// before\nurl = \"http://wrong-host:9200\"\n// after\nurl = \"http://es-master:9200\"","handlingStrategy":"retry","validationCode":"// shell: pre-flight connectivity check\ncurl -sS -o /dev/null -w '%{http_code}' http://es-host:9200/_cluster/health || echo 'cluster unreachable'","typeGuard":null,"tryCatchPattern":"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; }","preventionTips":["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"],"tags":["easysearch","network","bulk"],"backgroundTag":"database-write-failed","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"}