apache/seatunnel · error · IllegalArgumentException
input.multiline.flush-idle-timeout-ms must be > 0 when multi
Error message
input.multiline.flush-idle-timeout-ms must be > 0 when multiline is enabled, otherwise the buffer may never flush (input id=${id}). What it means
When multiline aggregation is enabled, a flush idle timeout of 0 or less means an unterminated multiline buffer may never be flushed. FileCollectConfig enforces a strictly positive timeout in that case and throws this IllegalArgumentException.
Source
Thrown at seatunnel-edge-agent/seatunnel-edge-agent-connector/src/main/java/org/apache/seatunnel/edge/agent/connector/config/FileCollectConfig.java:93
config.getOptional(FileCollectOptions.MULTILINE_PATTERN).orElse(null);
this.multilineMatch = config.get(FileCollectOptions.MULTILINE_MATCH);
validateMultilineMatch(this.multilineMatch);
this.multilineNegate = config.get(FileCollectOptions.MULTILINE_NEGATE);
this.multilineMaxLines = config.get(FileCollectOptions.MULTILINE_MAX_LINES);
if (this.multilineMaxLines < 1) {
throw new IllegalArgumentException(
"input.multiline.max-lines must be >= 1 when set (input id=" + this.id + ").");
}
this.multilineFlushIdleTimeoutMs =
config.get(FileCollectOptions.MULTILINE_FLUSH_IDLE_TIMEOUT_MS);
if (this.multilineFlushIdleTimeoutMs < 0L) {
throw new IllegalArgumentException(
"input.multiline.flush-idle-timeout-ms must not be negative (input id="
+ this.id
+ ").");
}
if (isMultilineEnabled() && this.multilineFlushIdleTimeoutMs <= 0L) {
throw new IllegalArgumentException(
"input.multiline.flush-idle-timeout-ms must be > 0 when multiline is enabled,"
+ " otherwise the buffer may never flush (input id="
+ this.id
+ ").");
}
this.outputType = config.get(FileCollectOptions.OUTPUT_FORMAT_TYPE);
validateOutputType(this.outputType);
this.onError = config.get(FileCollectOptions.ON_ERROR);
validateOnError(this.onError);
this.globScanIntervalMs = config.get(FileCollectOptions.GLOB_SCAN_INTERVAL_MS);
if (this.globScanIntervalMs < 1L) {
throw new IllegalArgumentException(
"input.glob-scan-interval-ms must be >= 1 when set (input id="
+ this.id
+ ").");
}
this.closeInactiveMs = config.get(FileCollectOptions.CLOSE_INACTIVE_MS);
if (this.closeInactiveMs < 0L) {View on GitHub (pinned to cf67b549a7)
Solutions
- Set input.multiline.flush-idle-timeout-ms to a positive value, e.g. 5000-60000
- Disable multiline aggregation if line-by-line parsing is intended
- Keep the timeout >0 whenever multiline.pattern/multiline.match are configured
Example fix
# before
multiline.pattern = "^[0-9]{4}-"
multiline.match = "after"
multiline.flush-idle-timeout-ms = 0
# after
multiline.pattern = "^[0-9]{4}-"
multiline.match = "after"
multiline.flush-idle-timeout-ms = 10000 Defensive patterns
Strategy: validation
Validate before calling
boolean multilineEnabled = cfg.contains(FileCollectOptions.MULTILINE_PATTERN) || cfg.contains(FileCollectOptions.MULTILINE_MATCH);
Long t = cfg.getOptional(FileCollectOptions.MULTILINE_FLUSH_IDLE_TIMEOUT_MS).orElse(null);
if (multilineEnabled && t != null && t <= 0L) { throw new IllegalArgumentException("flush-idle-timeout-ms must be > 0 when multiline enabled"); } Try / catch
try { FileCollectConfig.from(config); } catch (IllegalArgumentException e) { log.error("Multiline config invalid: {}", e.getMessage()); } Prevention
- Whenever multiline.pattern is set, also set a positive flush-idle-timeout-ms
- Treat 0 as 'never flush', not 'flush now'
- Test multiline configs with an unterminated final record
When it happens
Trigger: Enabling multiline (multiline.pattern or multiline.match set) while input.multiline.flush-idle-timeout-ms is 0 or omitted-but-resolves-to-0.
Common situations: Users set the timeout to 0 thinking it means 'flush immediately', not realizing it means 'never flush' when multiline is active.
Understand the failure class
- Timeouts: ETIMEDOUT, deadlines, and hung requests — what actually expires when a request times out.
Related errors
- input.multiline.match must be "after" or "before".
- Schema config can not be empty
- Unknown format type:
- Option '${option}' cannot be blank
- Option '${valuesAndOptions[index + 1]}' is not valid for the
AI-assisted analysis of apache/seatunnel@cf67b549a7 (2026-09-10).
Data as JSON: /api/errors/169dd1a2eeb2a9a6.
Report an issue: GitHub.