apache/seatunnel · error · IllegalArgumentException

input.multiline.max-lines must be >= 1 when set

Error message

input.multiline.max-lines must be >= 1 when set (input id=${id}).

What it means

FileCollectConfig validates the optional input.multiline.max-lines option after reading it from the job config. If the configured value is less than 1, the constructor throws this IllegalArgumentException at input-registration time so a malformed multiline aggregation bound is rejected before any file is read.

Solutions

  1. Set input.multiline.max-lines to a positive integer (e.g. 100) in the input config
  2. Remove the input.multiline.max-lines option entirely if multiline aggregation limits are not needed
  3. Check for variable interpolation failures producing 0 in templated configs

Example fix

# before
input {
  multiline.max-lines = 0
}
# after
input {
  multiline.max-lines = 100
}
Defensive patterns

Strategy: validation

Validate before calling

if (cfg.contains(FileCollectOptions.MULTILINE_MAX_LINES) && cfg.get(FileCollectOptions.MULTILINE_MAX_LINES) < 1) { throw new IllegalArgumentException("input.multiline.max-lines must be >= 1"); }

Try / catch

try { new FileCollectConfig(config); } catch (IllegalArgumentException e) { log.error("Invalid input config: {}", e.getMessage()); throw e; }

Prevention

When it happens

Trigger: Setting input.multiline.max-lines to 0, a negative number, or a value that resolves to <1 in the agent's file-collect input config.

Common situations: Copy-pasting a multiline config template with a placeholder 0, auto-generated configs defaulting to 0, or unit tests constructing configs with unset numeric placeholders.

Understand the failure class

Background: "Invalid value" and "allowed values are" config errors: what your library rejected and how to fix it — this error's family across 41 libraries.

Related errors


AI-assisted analysis of apache/seatunnel@cf67b549a7 (2026-09-10). Data as JSON: /api/errors/06a43f9d35ac38c4. Report an issue: GitHub.

Appendix: source

Thrown at seatunnel-edge-agent/seatunnel-edge-agent-connector/src/main/java/org/apache/seatunnel/edge/agent/connector/config/FileCollectConfig.java:81

        }
        for (String path : pathList) {
            if (path == null || path.trim().isEmpty()) {
                throw new IllegalArgumentException(
                        "input.paths must not contain blank entries (input id=" + this.id + ").");
            }
        }
        this.paths = Collections.unmodifiableList(new ArrayList<>(pathList));
        this.encoding = config.get(FileCollectOptions.ENCODING);
        this.charset = resolveCharset(this.encoding, this.id);
        this.readFromBeginning = config.get(FileCollectOptions.READ_FROM_BEGINNING);
        this.multilinePattern =
                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);

View on GitHub (pinned to cf67b549a7)