apache/seatunnel · error · IllegalArgumentException

input.glob-scan-interval-ms must be >= 1 when set

Error message

input.glob-scan-interval-ms must be >= 1 when set (input id=${id}).

What it means

input.glob-scan-interval-ms controls how often the reader re-scans the glob for new files. FileCollectConfig requires it to be at least 1ms; values below 1 throw this IllegalArgumentException at config load.

Solutions

  1. Set input.glob-scan-interval-ms to a positive value (e.g. 1000)
  2. Remove the option to use the built-in default scan interval
  3. Fix template rendering that produces 0 for unset variables

Example fix

# before
input.glob-scan-interval-ms = 0
# after
input.glob-scan-interval-ms = 1000
Defensive patterns

Strategy: validation

Validate before calling

if (cfg.contains(FileCollectOptions.GLOB_SCAN_INTERVAL_MS) && cfg.get(FileCollectOptions.GLOB_SCAN_INTERVAL_MS) < 1L) { throw new IllegalArgumentException("glob-scan-interval-ms must be >= 1"); }

Try / catch

try { FileCollectConfig.from(config); } catch (IllegalArgumentException e) { log.error("Invalid scan interval: {}", e.getMessage()); }

Prevention

When it happens

Trigger: Setting input.glob-scan-interval-ms to 0 or a negative number in the file-collect input config.

Common situations: Attempting 'continuous scanning with no delay' via 0, or templated configs where an empty variable resolves to 0.

Understand the failure class

Background: "value must be between 0 and 1" / "out of range" / "must not be negative" errors: fixing range-validation failures across open-source libraries — this error's family across 42 libraries.

Related errors


AI-assisted analysis of apache/seatunnel@cf67b549a7 (2026-09-10). Data as JSON: /api/errors/e76050c2e09859dc. 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:105

            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) {
            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();
    }

View on GitHub (pinned to cf67b549a7)