{"record":{"id":"9f9824b24df41617","repo":"apache/seatunnel","slug":"stripe-option-rate-limit-max-retries-must-not-be","errorCode":null,"errorMessage":"Stripe option 'rate_limit_max_retries' must not be negative","messagePattern":"Stripe option 'rate_limit_max_retries' must not be negative","errorType":"validation","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"seatunnel-connectors-v2/connector-http/connector-http-stripe/src/main/java/org/apache/seatunnel/connectors/seatunnel/stripe/source/config/StripeSourceParameter.java","lineNumber":75,"sourceCode":"        }\n\n        Long createdGte = pluginConfig.getOptional(StripeSourceOptions.CREATED_GTE).orElse(null);\n        Long createdLt = pluginConfig.getOptional(StripeSourceOptions.CREATED_LT).orElse(null);\n        if (createdGte != null && createdGte < 0) {\n            throw new IllegalArgumentException(\"Stripe option 'created_gte' must not be negative\");\n        }\n        if (createdLt != null && createdLt < 0) {\n            throw new IllegalArgumentException(\"Stripe option 'created_lt' must not be negative\");\n        }\n        if (createdGte != null && createdLt != null && createdGte >= createdLt) {\n            throw new IllegalArgumentException(\n                    \"Stripe option 'created_gte' must be less than 'created_lt'\");\n        }\n\n        this.rateLimitMaxRetries = pluginConfig.get(StripeSourceOptions.RATE_LIMIT_MAX_RETRIES);\n        this.rateLimitBackoffMs = pluginConfig.get(StripeSourceOptions.RATE_LIMIT_BACKOFF_MS);\n        if (rateLimitMaxRetries < 0) {\n            throw new IllegalArgumentException(\n                    \"Stripe option 'rate_limit_max_retries' must not be negative\");\n        }\n        if (rateLimitBackoffMs < 0) {\n            throw new IllegalArgumentException(\n                    \"Stripe option 'rate_limit_backoff_ms' must not be negative\");\n        }\n\n        setUrl(trimTrailingSlash(apiBaseUrl.trim()) + PAYMENT_INTENTS_PATH);\n        setMethod(HttpRequestMethod.GET);\n\n        Map<String, String> requestHeaders = new LinkedHashMap<>();\n        requestHeaders.put(AUTHORIZATION, \"Bearer \" + secretKey);\n        requestHeaders.put(ACCEPT, \"application/json\");\n        pluginConfig\n                .getOptional(StripeSourceOptions.API_VERSION)\n                .filter(version -> !version.trim().isEmpty())\n                .ifPresent(version -> requestHeaders.put(STRIPE_VERSION, version.trim()));\n        setHeaders(requestHeaders);","sourceCodeStart":57,"sourceCodeEnd":93,"githubUrl":"https://github.com/apache/seatunnel/blob/cf67b549a7a6c35fa0beb12d83c62892427ea919/seatunnel-connectors-v2/connector-http/connector-http-stripe/src/main/java/org/apache/seatunnel/connectors/seatunnel/stripe/source/config/StripeSourceParameter.java#L57-L93","documentation":"buildWithConfig validates the rate_limit_max_retries option, which controls how many times the source retries Stripe 429 (rate-limited) responses. A negative retry count is invalid, so the connector throws this IllegalArgumentException when building the source parameters.","triggerScenarios":"Calling buildWithConfig with pluginConfig where RATE_LIMIT_MAX_RETRIES resolves to a negative integer, e.g. rate_limit_max_retries = -1.","commonSituations":"User tries to 'disable retries' with -1 not knowing 0 is the correct value; typo or stray minus sign in HOCON config.","solutions":["Set rate_limit_max_retries to 0 to effectively disable retries.","Set a positive value (e.g. 3-5) to enable rate-limit retries with backoff.","Remove the option to use the built-in default.","Audit the config file for accidental negative numbers."],"exampleFix":"// before\nrate_limit_max_retries = -1\n// after\nrate_limit_max_retries = 0","handlingStrategy":"validation","validationCode":"int retries = pluginConfig.get(StripeSourceOptions.RATE_LIMIT_MAX_RETRIES);\nif (retries < 0) {\n    throw new IllegalArgumentException(\"rate_limit_max_retries must be >= 0 (use 0 to disable)\");\n}","typeGuard":null,"tryCatchPattern":"try {\n    StripeSourceParameter p = StripeSourceParameter.buildWithConfig(pluginConfig);\n} catch (IllegalArgumentException e) {\n    throw new IllegalArgumentException(\"Invalid rate_limit_max_retries: \" + e.getMessage(), e);\n}","preventionTips":["Use 0 to disable retries, never -1.","Keep retry counts modest (3-5) to avoid amplifying load on Stripe.","Add config-schema validation so negatives are rejected at parse time."],"tags":["config-validation","retry","range-check"],"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"}