apache/seatunnel · warning
Invalid COMMIT batchId in request
Error message
Invalid COMMIT batchId in request: {} What it means
Logged by dispatchCommit() when the batchId parsed from a 'COMMIT <id>' request is missing, non-numeric, or not positive. The server replies with INVALID_PARAM and does not forward the request to the handler. It guards the sink's commit protocol against malformed batch identifiers.
Solutions
- Fix the collector to always send a positive numeric batch id with COMMIT.
- Log the abbreviated request to see exactly what was received and correct the format to 'COMMIT <positive-long>'.
- Check the collector's batch-id allocation logic for null/unset ids after errors.
Example fix
// before (client)
String cmd = "COMMIT " + batchId; // batchId was null -> "COMMIT null"
// after
if (batchId != null && batchId > 0) { writer.write("COMMIT " + batchId + "\n"); } Defensive patterns
Strategy: validation
Validate before calling
if (batchId == null || batchId <= 0) { throw new IllegalArgumentException("COMMIT requires a positive numeric batchId, got: " + batchId); } Prevention
- Initialize batch ids to 1, not 0
- Assert batchId > 0 before writing the COMMIT line
- Handle batch allocation failure by aborting the batch rather than sending a null id
When it happens
Trigger: A 'COMMIT' line whose argument fails parseBatchId: absent argument, non-numeric text, or a value <= 0 such as 'COMMIT 0' or 'COMMIT -1'.
Common situations: Collector bug emitting an uninitialized/null batch id, id corruption from a broken TCP framing layer, client sending 'COMMIT' with no argument after a failed batch allocation.
Understand the failure class
Background: "Must be a positive integer", "Invalid value", "Unsupported": the invalid-argument-value error family, when a library rejects the value you pass — this error's family across 35 libraries.
Related errors
- Invalid BATCH batchId in request
- batchId must be positive
- AmazonDocumentDB option '' must be a valid BSON/JSON…
- AmazonDocumentDB option '' must not be blank
- API-01
AI-assisted analysis of apache/seatunnel@cf67b549a7 (2026-09-10).
Data as JSON: /api/errors/fa17abe5a30bbcfe.
Report an issue: GitHub.
Appendix: source
Thrown at seatunnel-connectors-v2/connector-edge-socket/src/main/java/org/apache/seatunnel/connectors/seatunnel/edgesocket/protocol/IngressProtocolHandler.java:119
EdgeSocketLogUtils.abbreviateForLog(request));
return EdgeSocketResponseCode.BAD_REQUEST.getCode();
}
switch (command) {
case COMMIT:
return dispatchCommit(request);
case BATCH:
return dispatchBatch(request);
default:
log.warn("Command {} is not dispatched yet", command);
return EdgeSocketResponseCode.BAD_REQUEST.getCode();
}
}
private String dispatchCommit(String request) {
Long batchId = parseBatchId(request, IngressCommand.COMMIT.prefix());
if (batchId == null || batchId <= 0) {
log.warn(
"Invalid COMMIT batchId in request: {}",
EdgeSocketLogUtils.abbreviateForLog(request));
return EdgeSocketResponseCode.INVALID_PARAM.getCode();
}
return handler.handleCommitRequest(batchId);
}
private String dispatchBatch(String request) {
int separatorIndex = request.indexOf(':', IngressCommand.BATCH.prefix().length());
if (separatorIndex < 0) {
log.warn(
"Malformed BATCH request, missing payload separator: {}",
EdgeSocketLogUtils.abbreviateForLog(request));
return EdgeSocketResponseCode.BAD_REQUEST.getCode();
}
Long batchId =
parseBatchId(request.substring(0, separatorIndex), IngressCommand.BATCH.prefix());
if (batchId == null || batchId <= 0) {
log.warn(View on GitHub (pinned to cf67b549a7)