{"record":{"id":"ef03c0d68a49896a","repo":"apache/seatunnel","slug":"malformed-batch-request-missing-payload-separator","errorCode":null,"errorMessage":"Malformed BATCH request, missing payload separator: {}","messagePattern":"Malformed BATCH request, missing payload separator: (.+?)","errorType":"console","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"seatunnel-connectors-v2/connector-edge-socket/src/main/java/org/apache/seatunnel/connectors/seatunnel/edgesocket/protocol/IngressProtocolHandler.java","lineNumber":130,"sourceCode":"        }\n    }\n\n    private String dispatchCommit(String request) {\n        Long batchId = parseBatchId(request, IngressCommand.COMMIT.prefix());\n        if (batchId == null || batchId <= 0) {\n            log.warn(\n                    \"Invalid COMMIT batchId in request: {}\",\n                    EdgeSocketLogUtils.abbreviateForLog(request));\n            return EdgeSocketResponseCode.INVALID_PARAM.getCode();\n        }\n        return handler.handleCommitRequest(batchId);\n    }\n\n    private String dispatchBatch(String request) {\n        int separatorIndex = request.indexOf(':', IngressCommand.BATCH.prefix().length());\n        if (separatorIndex < 0) {\n            log.warn(\n                    \"Malformed BATCH request, missing payload separator: {}\",\n                    EdgeSocketLogUtils.abbreviateForLog(request));\n            return EdgeSocketResponseCode.BAD_REQUEST.getCode();\n        }\n        Long batchId =\n                parseBatchId(request.substring(0, separatorIndex), IngressCommand.BATCH.prefix());\n        if (batchId == null || batchId <= 0) {\n            log.warn(\n                    \"Invalid BATCH batchId in request: {}\",\n                    EdgeSocketLogUtils.abbreviateForLog(request));\n            return EdgeSocketResponseCode.INVALID_PARAM.getCode();\n        }\n        String payload = request.substring(separatorIndex + 1);\n        return handler.handleBatchRecord(batchId, payload);\n    }\n\n    private static boolean constantTimeEquals(String expected, String actual) {\n        if (expected == null || actual == null) {\n            return Objects.equals(expected, actual);","sourceCodeStart":112,"sourceCodeEnd":148,"githubUrl":"https://github.com/apache/seatunnel/blob/cf67b549a7a6c35fa0beb12d83c62892427ea919/seatunnel-connectors-v2/connector-edge-socket/src/main/java/org/apache/seatunnel/connectors/seatunnel/edgesocket/protocol/IngressProtocolHandler.java#L112-L148","documentation":"Logged by dispatchBatch() when a BATCH request contains no ':' separator after the command prefix, so the batch id cannot be separated from the payload. The server replies BAD_REQUEST. The wire format requires 'BATCH <id>:<payload>'.","triggerScenarios":"receiveLoop dispatches a line starting with the BATCH prefix that has no ':' following it — e.g. 'BATCH 12' or 'BATCH' with nothing else.","commonSituations":"Collector splitting id and payload onto separate lines instead of one, payload serialization dropping the separator, a truncated write due to network/buffer issues, client protocol version mismatch.","solutions":["Correct the collector to send 'BATCH <id>:<payload>' as a single newline-terminated line.","Check collector serialization code to ensure the ':' separator and payload are written in the same frame.","Compare client and server protocol versions."],"exampleFix":"// before (client)\nwriter.write(\"BATCH \" + id + \"\\n\"); writer.write(payload);\n// after\nwriter.write(\"BATCH \" + id + \":\" + payload + \"\\n\");","handlingStrategy":"validation","validationCode":"String cmd = \"BATCH \" + batchId + \":\" + payload; if (!cmd.contains(\":\")) { throw new IllegalArgumentException(\"BATCH request missing ':' separator\"); }","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Build the whole BATCH frame (id, separator, payload) in one helper and write it as a single line","Never split id and payload across write calls that can be separated by flushes","Add a unit test asserting the exact wire format"],"tags":["protocol","malformed-request","tcp"],"backgroundTag":"invalid-argument-format","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"}