apache/seatunnel · error · IllegalArgumentException

input.close-inactive-ms must be >= 0 when set

Error message

input.close-inactive-ms must be >= 0 when set (input id=${id}).

What it means

input.close-inactive-ms determines how long an inactive file cursor is kept open before being closed. Negative values are rejected by FileCollectConfig with this IllegalArgumentException; 0 is allowed (close immediately when idle).

Solutions

  1. Set input.close-inactive-ms to 0 or a positive value (e.g. 60000)
  2. Remove the option to keep the default inactivity window
  3. Correct any negative sentinel logic in config generators

Example fix

# before
input.close-inactive-ms = -1000
# after
input.close-inactive-ms = 60000
Defensive patterns

Strategy: validation

Validate before calling

if (cfg.contains(FileCollectOptions.CLOSE_INACTIVE_MS) && cfg.get(FileCollectOptions.CLOSE_INACTIVE_MS) < 0L) { throw new IllegalArgumentException("close-inactive-ms must be >= 0"); }

Try / catch

try { FileCollectConfig.from(config); } catch (IllegalArgumentException e) { log.error("Invalid close-inactive-ms: {}", e.getMessage()); }

Prevention

When it happens

Trigger: Configuring input.close-inactive-ms with a negative value in a file-collect input.

Common situations: Sign mistakes when tuning cursor retention, or configs generated from negative sentinel values meaning 'never close'.

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/081454fb668f165b. 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:112

                    "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) {
            throw new IllegalArgumentException(
                    "input.close-inactive-ms must be >= 0 when set (input id=" + this.id + ").");
        }
    }

    public static FileCollectConfig from(ReadonlyConfig config) {
        return new FileCollectConfig(config);
    }

    public boolean isMultilineEnabled() {
        return multilinePattern != null && !multilinePattern.isEmpty();
    }

    public boolean isJsonOutput() {
        return "json".equalsIgnoreCase(outputType);
    }

    public boolean isSkipOnError() {
        return !"fail".equalsIgnoreCase(onError);

View on GitHub (pinned to cf67b549a7)