{"record":{"id":"a5f1462c56a4d764","repo":"apache/seatunnel","slug":"unexpected-batch-response-reply-expected-rece","errorCode":null,"errorMessage":"Unexpected batch response: ${reply} (expected RECEIVED, RETRY, or QUEUE_FULL<ms>)","messagePattern":"Unexpected batch response: (.+?) \\(expected RECEIVED, RETRY, or QUEUE_FULL<ms>\\)","errorType":"exception","errorClass":"IOException","httpStatus":null,"severity":"error","filePath":"seatunnel-edge-agent/seatunnel-edge-agent-transport/src/main/java/org/apache/seatunnel/edge/agent/transport/socket/EdgeSocketLineTransport.java","lineNumber":73,"sourceCode":"                EdgeTransportConfig.sleepQuiet(\n                        EdgeTransportConfig.computeBackoffMillis(\n                                attempts - 1,\n                                config.getInitialBackoffMs(),\n                                config.getMaxBackoffMs()));\n                continue;\n            }\n            if (reply.startsWith(EdgeSocketProtocol.RESP_QUEUE_FULL_PREFIX)) {\n                long waitMs = parseQueueFullBackoffMs(reply);\n                EdgeTransportConfig.sleepQuiet(waitMs);\n                continue;\n            }\n            if (EdgeSocketProtocol.RESP_DECRYPT_FAILED.equals(reply)) {\n                throw new IOException(\n                        \"Edge socket ingress decryption failed (DECRYPT_FAILED): verify \"\n                                + \"output.aes-secret-key-base64 matches EdgeSocket source \"\n                                + \"secret_key\");\n            }\n            throw new IOException(\n                    \"Unexpected batch response: \"\n                            + reply\n                            + \" (expected \"\n                            + EdgeSocketProtocol.RESP_RECEIVED\n                            + \", \"\n                            + EdgeSocketProtocol.RESP_RETRY\n                            + \", or \"\n                            + EdgeSocketProtocol.RESP_QUEUE_FULL_PREFIX\n                            + \"<ms>)\");\n        }\n        throw new IOException(\n                \"Exceeded maxBatchSendAttempts=\"\n                        + config.getMaxBatchSendAttempts()\n                        + \" without RECEIVED for batch \"\n                        + batchId);\n    }\n\n    private static void handleAuthResponse(String reply) throws IOException {","sourceCodeStart":55,"sourceCodeEnd":91,"githubUrl":"https://github.com/apache/seatunnel/blob/cf67b549a7a6c35fa0beb12d83c62892427ea919/seatunnel-edge-agent/seatunnel-edge-agent-transport/src/main/java/org/apache/seatunnel/edge/agent/transport/socket/EdgeSocketLineTransport.java#L55-L91","documentation":"sendBatchUntilReceived recognizes only RECEIVED, RETRY, and QUEUE_FULL<ms> replies from the collector. Any other reply line is treated as a protocol violation and thrown as this IOException including the raw reply text. It indicates the server sent something unexpected on the batch channel.","triggerScenarios":"The collector responds to a BATCH line with an unrecognized token — e.g. an error message, an HTML error page from a misconfigured port, AUTH_FAILED/DECRYPT_FAILED variants not matched, or a version-mismatched protocol reply.","commonSituations":"Pointing the agent at a wrong service/port that replies with non-protocol text; collector running an older/newer protocol version; server-side error text instead of a protocol reply; extra whitespace or BOM in the reply.","solutions":["Read the reply value embedded in the exception message to identify what the server actually returned","Verify the agent connects to the correct host/port running the EdgeSocket collector","Check that collector and agent use compatible SeaTunnel versions and the same EdgeSocket protocol","If the reply is a legitimate server status, extend the client/protocol handling on both sides consistently"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"try { client.send(batchId, payload); } catch (IOException e) { if (e.getMessage().startsWith(\"Unexpected batch response:\")) { log.error(\"Collector protocol violation: {}\", e.getMessage()); } throw e; }","preventionTips":["Pin agent and collector to the same protocol/version","Do not put proxies that inject banner text in front of the plain-text socket","Log the reply text from the exception for diagnosis","Test the wire protocol after any collector upgrade"],"tags":["protocol","socket","unexpected-response"],"backgroundTag":"unexpected-response-shape","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"}