{"record":{"id":"17463990b1f1d7e2","repo":"apache/seatunnel","slug":"send-message-to-socket-server-failed","errorCode":"SEND_MESSAGE_TO_SOCKET_SERVER_FAILED","errorMessage":"Failed to send message '%s' to socket server at %s:%d. Connection re-tries are not enabled.","messagePattern":"Failed to send message '(.+?)' to socket server at (.+?):(.+?)\\. Connection re-tries are not enabled\\.","errorType":"error_code","errorClass":"SocketConnectorException","httpStatus":null,"severity":"error","filePath":"seatunnel-connectors-v2/connector-socket/src/main/java/org/apache/seatunnel/connectors/seatunnel/socket/sink/SocketClient.java","lineNumber":82,"sourceCode":"                createConnection();\n            }\n        } catch (IOException e) {\n            throw new SocketConnectorException(\n                    SocketConnectorErrorCode.SOCKET_SERVER_CONNECT_FAILED,\n                    String.format(\"Cannot connect to socket server at %s:%d\", hostName, port),\n                    e);\n        }\n    }\n\n    public void write(SeaTunnelRow row) throws IOException {\n        byte[] msg = serializationSchema.serialize(row);\n        try {\n            outputStream.write(msg);\n            outputStream.flush();\n        } catch (IOException e) {\n            // if no re-tries are enable, fail immediately\n            if (maxNumRetries == 0) {\n                throw new SocketConnectorException(\n                        SocketConnectorErrorCode.SEND_MESSAGE_TO_SOCKET_SERVER_FAILED,\n                        String.format(\n                                \"Failed to send message '%s' to socket server at %s:%d. Connection re-tries are not enabled.\",\n                                row, hostName, port),\n                        e);\n            }\n\n            log.error(\n                    \"Failed to send message '{}' to socket server at {}:{}. Trying to reconnect...\",\n                    row,\n                    hostName,\n                    port,\n                    e);\n\n            synchronized (SocketClient.class) {\n                IOException lastException = null;\n                retries = 0;\n                while (isRunning && (maxNumRetries < 0 || retries < maxNumRetries)) {","sourceCodeStart":64,"sourceCodeEnd":100,"githubUrl":"https://github.com/apache/seatunnel/blob/cf67b549a7a6c35fa0beb12d83c62892427ea919/seatunnel-connectors-v2/connector-socket/src/main/java/org/apache/seatunnel/connectors/seatunnel/socket/sink/SocketClient.java#L64-L100","documentation":"Thrown by SocketClient.write when writing/flushing a serialized row to the socket server fails with an IOException and retries are not enabled, so the failed message and endpoint are reported and the write aborts.","triggerScenarios":"Thrown at seatunnel-connectors-v2/connector-socket/src/main/java/org/apache/seatunnel/connectors/seatunnel/socket/sink/SocketClient.java:82 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Enable and configure socket sink retries so transient failures reconnect","Verify the socket server is running and reachable at the configured host/port","Check for network/firewall issues between the SeaTunnel task and the server"],"exampleFix":null,"handlingStrategy":"retry","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"cf67b549a7a6c35fa0beb12d83c62892427ea919","analyzedAt":"2026-09-10T21:44:55.265Z","contentChangedAt":"2026-09-10T21:44:55.265Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}