apache/seatunnel · error · IllegalArgumentException

Stripe option 'rate_limit_max_retries' must not be negative

Error message

Stripe option 'rate_limit_max_retries' must not be negative

What it means

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.

Solutions

  1. Set rate_limit_max_retries to 0 to effectively disable retries.
  2. Set a positive value (e.g. 3-5) to enable rate-limit retries with backoff.
  3. Remove the option to use the built-in default.
  4. Audit the config file for accidental negative numbers.

Example fix

// before
rate_limit_max_retries = -1
// after
rate_limit_max_retries = 0
Defensive patterns

Strategy: validation

Validate before calling

int retries = pluginConfig.get(StripeSourceOptions.RATE_LIMIT_MAX_RETRIES);
if (retries < 0) {
    throw new IllegalArgumentException("rate_limit_max_retries must be >= 0 (use 0 to disable)");
}

Try / catch

try {
    StripeSourceParameter p = StripeSourceParameter.buildWithConfig(pluginConfig);
} catch (IllegalArgumentException e) {
    throw new IllegalArgumentException("Invalid rate_limit_max_retries: " + e.getMessage(), e);
}

Prevention

When it happens

Trigger: Calling buildWithConfig with pluginConfig where RATE_LIMIT_MAX_RETRIES resolves to a negative integer, e.g. rate_limit_max_retries = -1.

Common situations: User tries to 'disable retries' with -1 not knowing 0 is the correct value; typo or stray minus sign in HOCON config.

Understand the failure class

Background: "Invalid value" and "allowed values are" config errors: what your library rejected and how to fix it — this error's family across 41 libraries.

Related errors


AI-assisted analysis of apache/seatunnel@cf67b549a7 (2026-09-10). Data as JSON: /api/errors/9f9824b24df41617. Report an issue: GitHub.

Appendix: source

Thrown at seatunnel-connectors-v2/connector-http/connector-http-stripe/src/main/java/org/apache/seatunnel/connectors/seatunnel/stripe/source/config/StripeSourceParameter.java:75

        }

        Long createdGte = pluginConfig.getOptional(StripeSourceOptions.CREATED_GTE).orElse(null);
        Long createdLt = pluginConfig.getOptional(StripeSourceOptions.CREATED_LT).orElse(null);
        if (createdGte != null && createdGte < 0) {
            throw new IllegalArgumentException("Stripe option 'created_gte' must not be negative");
        }
        if (createdLt != null && createdLt < 0) {
            throw new IllegalArgumentException("Stripe option 'created_lt' must not be negative");
        }
        if (createdGte != null && createdLt != null && createdGte >= createdLt) {
            throw new IllegalArgumentException(
                    "Stripe option 'created_gte' must be less than 'created_lt'");
        }

        this.rateLimitMaxRetries = pluginConfig.get(StripeSourceOptions.RATE_LIMIT_MAX_RETRIES);
        this.rateLimitBackoffMs = pluginConfig.get(StripeSourceOptions.RATE_LIMIT_BACKOFF_MS);
        if (rateLimitMaxRetries < 0) {
            throw new IllegalArgumentException(
                    "Stripe option 'rate_limit_max_retries' must not be negative");
        }
        if (rateLimitBackoffMs < 0) {
            throw new IllegalArgumentException(
                    "Stripe option 'rate_limit_backoff_ms' must not be negative");
        }

        setUrl(trimTrailingSlash(apiBaseUrl.trim()) + PAYMENT_INTENTS_PATH);
        setMethod(HttpRequestMethod.GET);

        Map<String, String> requestHeaders = new LinkedHashMap<>();
        requestHeaders.put(AUTHORIZATION, "Bearer " + secretKey);
        requestHeaders.put(ACCEPT, "application/json");
        pluginConfig
                .getOptional(StripeSourceOptions.API_VERSION)
                .filter(version -> !version.trim().isEmpty())
                .ifPresent(version -> requestHeaders.put(STRIPE_VERSION, version.trim()));
        setHeaders(requestHeaders);

View on GitHub (pinned to cf67b549a7)