{"record":{"id":"f46423be600c7cb2","repo":"apache/seatunnel","slug":"retry-max-attempts-must-be-1","errorCode":null,"errorMessage":"retry.max-attempts must be >= 1.","messagePattern":"retry\\.max-attempts must be >= 1\\.","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/RetryConfig.java","lineNumber":43,"sourceCode":"import java.io.Serializable;\nimport java.util.Objects;\n\n@Getter\npublic class RetryConfig implements Serializable {\n\n    private static final long serialVersionUID = 1L;\n\n    private final int maxAttempts;\n    private final long backoffMs;\n    private final long backoffMaxMs;\n\n    public RetryConfig(ReadonlyConfig config) {\n        Objects.requireNonNull(config, \"config\");\n        ConfigValidator.of(config).validate(EdgeAgentRuntimeOptionRules.retryRule());\n\n        this.maxAttempts = config.get(EdgeAgentRuntimeOptions.RETRY_MAX_ATTEMPTS);\n        if (this.maxAttempts < 1) {\n            throw new IllegalArgumentException(\"retry.max-attempts must be >= 1.\");\n        }\n        this.backoffMs = config.get(EdgeAgentRuntimeOptions.RETRY_BACKOFF_MS);\n        if (this.backoffMs < 0L) {\n            throw new IllegalArgumentException(\"retry.backoff-ms must be >= 0.\");\n        }\n        this.backoffMaxMs = config.get(EdgeAgentRuntimeOptions.RETRY_BACKOFF_MAX_MS);\n        if (this.backoffMaxMs < this.backoffMs) {\n            throw new IllegalArgumentException(\n                    \"retry.backoff-max-ms must be >= effective retry.backoff-ms (\"\n                            + this.backoffMs\n                            + \" ms).\");\n        }\n    }\n\n    public static RetryConfig from(ReadonlyConfig config) {\n        return new RetryConfig(config);\n    }\n}","sourceCodeStart":25,"sourceCodeEnd":61,"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/RetryConfig.java#L25-L61","documentation":"RetryConfig validates retry settings from the agent config. retry.max-attempts is the number of delivery retries and must be at least 1; a value below 1 (0 or negative) would make retries a no-op or underflow, so the constructor throws IllegalArgumentException immediately.","triggerScenarios":"Constructing RetryConfig with ReadonlyConfig where EdgeAgentRuntimeOptions.RETRY_MAX_ATTEMPTS is 0 or negative.","commonSituations":"User sets 'retry.max-attempts: 0' intending to disable retries; copying config from a zero-based system; typos like '-1'.","solutions":["Set retry.max-attempts to 1 or higher in the YAML.","If retries should be effectively disabled, use the minimum (1) or consult the delivery-guarantee setting instead.","Validate the value with EdgeAgentRuntimeOptionRules.retryRule before startup."],"exampleFix":"# before\nretry:\n  max-attempts: 0\n# after\nretry:\n  max-attempts: 3","handlingStrategy":"validation","validationCode":"Integer attempts = config.get(EdgeAgentRuntimeOptions.RETRY_MAX_ATTEMPTS);\nif (attempts != null && attempts < 1) {\n    throw new IllegalArgumentException(\"retry.max-attempts must be >= 1\");\n}","typeGuard":null,"tryCatchPattern":"try { RetryConfig retry = new RetryConfig(config); } catch (IllegalArgumentException e) { log.error(\"Retry config invalid: {}\", e.getMessage()); }","preventionTips":["Never set max-attempts to 0 or negative; use >= 1.","To disable retries, adjust delivery-guarantee instead.","Run ConfigValidator (retryRule) before startup."],"tags":["config","retry","validation"],"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-14T05:17:10.506Z"}