{"record":{"id":"9b502b6b9f150553","repo":"apache/seatunnel","slug":"optionpath-must-be-min-when-set","errorCode":null,"errorMessage":"${optionPath} must be >= ${min} when set.","messagePattern":"(.+?) must be >= (.+?) when set\\.","errorType":"validation","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"seatunnel-edge-agent/seatunnel-edge-agent-starter/src/main/java/org/apache/seatunnel/edge/agent/starter/config/AgentSchedulerConfig.java","lineNumber":57,"sourceCode":"        ConfigValidator.of(config).validate(EdgeAgentRuntimeOptionRules.runtimeRule());\n\n        this.idleSleepMs = config.get(EdgeAgentRuntimeOptions.RUNTIME_IDLE_SLEEP_MS);\n        requireAtLeast(this.idleSleepMs, 1L, \"agent.idle-sleep-ms\");\n\n        this.bulkMaxSize = config.get(EdgeAgentRuntimeOptions.RUNTIME_BULK_MAX_SIZE);\n        requireAtLeast(this.bulkMaxSize, 1, \"agent.bulk-max-size\");\n\n        this.flushIntervalMs = config.get(EdgeAgentRuntimeOptions.RUNTIME_FLUSH_INTERVAL_MS);\n        requireAtLeast(this.flushIntervalMs, 1L, \"agent.flush-interval-ms\");\n    }\n\n    public static AgentSchedulerConfig from(ReadonlyConfig config) {\n        return new AgentSchedulerConfig(config);\n    }\n\n    private static void requireAtLeast(int value, int min, String optionPath) {\n        if (value < min) {\n            throw new IllegalArgumentException(optionPath + \" must be >= \" + min + \" when set.\");\n        }\n    }\n\n    private static void requireAtLeast(long value, long min, String optionPath) {\n        if (value < min) {\n            throw new IllegalArgumentException(optionPath + \" must be >= \" + min + \" when set.\");\n        }\n    }\n}\n","sourceCodeStart":39,"sourceCodeEnd":67,"githubUrl":"https://github.com/apache/seatunnel/blob/cf67b549a7a6c35fa0beb12d83c62892427ea919/seatunnel-edge-agent/seatunnel-edge-agent-starter/src/main/java/org/apache/seatunnel/edge/agent/starter/config/AgentSchedulerConfig.java#L39-L67","documentation":"AgentSchedulerConfig.requireAtLeast(int,...) validates integer scheduler options against a minimum. When an option is set but below the allowed minimum, the config constructor throws IllegalArgumentException of the form '<optionPath> must be >= <min> when set.' This guards against nonsensical settings like zero or negative pool sizes or intervals.","triggerScenarios":"Building AgentSchedulerConfig.from(config) where a numeric option (interval, batch size, or thread count at its optionPath) is present but less than the documented minimum.","commonSituations":"Users set a scheduler interval or batch size to 0 in the HOCON/JSON config; scripts generate configs with uninitialized 0 values; tests build configs that fail minimum bounds.","solutions":["Set the offending option at <optionPath> to a value >= the stated minimum.","Remove the option so it falls back to the built-in default.","Read the error's optionPath and min to identify exactly which option and threshold applies.","Review AgentSchedulerConfig's constructor to see all requireAtLeast calls and pick compliant values."],"exampleFix":"// before (config)\nscheduler { poll-interval-ms = 0 }\n// after (config, assuming min 100)\nscheduler { poll-interval-ms = 500 }","handlingStrategy":"validation","validationCode":"# preflight in Python before submitting agent config\nMIN = {'poll-interval-ms': 100, 'batch-size': 1}\nfor key, m in MIN.items():\n    v = scheduler_cfg.get(key)\n    if v is not None and v < m:\n        raise ValueError(f'scheduler.{key} must be >= {m} when set.')","typeGuard":null,"tryCatchPattern":"try {\n    AgentSchedulerConfig.from(config);\n} catch (IllegalArgumentException e) {\n    if (e.getMessage().contains(\"must be >= \")) {\n        log.error(\"Scheduler option out of range: {}\", e.getMessage());\n    }\n}","preventionTips":["Validate the whole scheduler config block against documented minimums before submission.","Avoid overriding options with 0; remove the key to use the compliant built-in default.","Check the error's optionPath first; it names the exact config key to fix."],"tags":["config","validation","scheduler","minimum-value"],"backgroundTag":"invalid-config-value","analyzedSha":"cf67b549a7a6c35fa0beb12d83c62892427ea919","analyzedAt":"2026-09-10T21:44:55.265Z","contentChangedAt":"2026-09-10T21:44:55.265Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}