{"record":{"id":"5cbb9313adaf3295","repo":"apache/seatunnel","slug":"snmp-source-poll-interval-millis-must-be-greater-t","errorCode":null,"errorMessage":"SNMP source poll_interval_millis must be greater than 0","messagePattern":"SNMP source poll_interval_millis must be greater than 0","errorType":"validation","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"seatunnel-connectors-v2/connector-snmp/src/main/java/org/apache/seatunnel/connectors/seatunnel/snmp/config/SnmpSourceConfig.java","lineNumber":77,"sourceCode":"        this.pollIntervalMillis = config.get(SnmpSourceOptions.POLL_INTERVAL_MILLIS);\n        validate();\n    }\n\n    private void validate() {\n        if (port < 1 || port > 65535) {\n            throw new IllegalArgumentException(\"SNMP source port must be between 1 and 65535\");\n        }\n        if (isBlank(community)) {\n            throw new IllegalArgumentException(\"SNMP source community must not be blank\");\n        }\n        if (timeoutMillis <= 0) {\n            throw new IllegalArgumentException(\"SNMP source timeout_millis must be greater than 0\");\n        }\n        if (retries < 0) {\n            throw new IllegalArgumentException(\"SNMP source retries must not be negative\");\n        }\n        if (pollIntervalMillis <= 0) {\n            throw new IllegalArgumentException(\n                    \"SNMP source poll_interval_millis must be greater than 0\");\n        }\n    }\n\n    private static boolean isBlank(String value) {\n        return value == null || value.trim().isEmpty();\n    }\n\n    @Override\n    public String getHost() {\n        return host;\n    }\n\n    @Override\n    public int getPort() {\n        return port;\n    }\n","sourceCodeStart":59,"sourceCodeEnd":95,"githubUrl":"https://github.com/apache/seatunnel/blob/cf67b549a7a6c35fa0beb12d83c62892427ea919/seatunnel-connectors-v2/connector-snmp/src/main/java/org/apache/seatunnel/connectors/seatunnel/snmp/config/SnmpSourceConfig.java#L59-L95","documentation":"validate() requires poll_interval_millis to be strictly positive. This option sets how often the source polls the SNMP agent; a zero or negative interval is nonsensical and would break the polling scheduler.","triggerScenarios":"SnmpSourceConfig.validate() throws when the configured SnmpSourceOptions.POLL_INTERVAL_MILLIS value is <= 0, e.g. poll_interval_millis = 0 or a negative value.","commonSituations":"Setting 0 intending 'poll as fast as possible'; unit confusion (poll_interval_seconds written into a millis option as a decimal truncated to 0); template values left blank and resolved to 0.","solutions":["Set poll_interval_millis to a positive interval, e.g. poll_interval_millis = 60000 for one-minute polling","Remove the option to use the connector's default polling interval"],"exampleFix":"// before\npoll_interval_millis = 0\n// after\npoll_interval_millis = 60000","handlingStrategy":"validation","validationCode":"Long interval = config.get(SnmpSourceOptions.POLL_INTERVAL_MILLIS);\nif (interval == null || interval <= 0) {\n    throw new IllegalArgumentException(\"poll_interval_millis must be > 0\");\n}","typeGuard":"boolean isValidInterval(Long pollIntervalMillis) {\n    return pollIntervalMillis != null && pollIntervalMillis > 0;\n}","tryCatchPattern":"try {\n    SnmpSourceConfig cfg = new SnmpSourceConfig(config);\n} catch (IllegalArgumentException e) {\n    if (e.getMessage().contains(\"poll_interval_millis must be greater than 0\")) {\n        // substitute a default interval, e.g. 60000ms\n    }\n    throw e;\n}","preventionTips":["Express intervals in milliseconds (60000 = 1 minute); convert seconds explicitly","Omit the option to use the connector default instead of 0","Respect the agent's device load: don't set extremely small intervals even when valid"],"tags":["config","snmp","validation","polling"],"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-14T11:17:12.474Z"}