apache/seatunnel · error · IllegalArgumentException

Stripe option 'page_size' must be between 1 and 100

Error message

Stripe option 'page_size' must be between 1 and 100

What it means

StripeSourceParameter.buildWithConfig validates the page_size option when constructing the Stripe source request parameters. page_size controls how many Stripe PaymentIntents records are fetched per page, and Stripe's API only accepts values between 1 and 100. Any configured value outside that range makes the connector fail fast with this IllegalArgumentException instead of sending a request Stripe would reject.

Solutions

  1. Set page_size to an integer between 1 and 100 in the source config (100 maximizes throughput per request).
  2. Remove the page_size key so the option default is used instead of an out-of-range value.
  3. If higher throughput is needed, keep page_size <= 100 and increase source parallelism rather than page size.
  4. Check for accidental string-to-int coercion or wrong unit in the config (e.g. page_size = 1000 intending 1000 rows total).

Example fix

// before
page_size = 500
// after
page_size = 100
Defensive patterns

Strategy: validation

Validate before calling

int pageSize = pluginConfig.get(StripeSourceOptions.PAGE_SIZE);
if (pageSize < 1 || pageSize > 100) {
    throw new IllegalArgumentException("page_size must be between 1 and 100, got: " + pageSize);
}

Try / catch

try {
    StripeSourceParameter p = StripeSourceParameter.buildWithConfig(pluginConfig);
} catch (IllegalArgumentException e) {
    // log config key + value, fail job with clear message
    throw new IllegalArgumentException("Invalid Stripe source config: " + e.getMessage(), e);
}

Prevention

When it happens

Trigger: Calling buildWithConfig (directly or via buildParameter/createReader during source reader creation) with pluginConfig where PAGE_SIZE resolves to an integer < 1 or > 100, e.g. page_size = 0, page_size = 500, or a negative number.

Common situations: User copies a page_size from a different API's docs; user thinks page_size is a byte/row-count batch size and sets 1000 for throughput; typo in HOCON unit (e.g. page_size = 1000 rows).

Understand the failure class

Background: "value must be between 0 and 1" / "out of range" / "must not be negative" errors: fixing range-validation failures across open-source libraries — this error's family across 42 libraries.

Related errors


AI-assisted analysis of apache/seatunnel@cf67b549a7 (2026-09-10). Data as JSON: /api/errors/81971cae970718f8. 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:55

    private int rateLimitMaxRetries;
    private int rateLimitBackoffMs;

    @Override
    public void buildWithConfig(ReadonlyConfig pluginConfig) {
        String secretKey = pluginConfig.get(StripeSourceOptions.SECRET_KEY);
        if (Strings.isNullOrEmpty(secretKey) || secretKey.trim().isEmpty()) {
            throw new IllegalArgumentException("Stripe option 'secret_key' must not be blank");
        }

        String apiBaseUrl = pluginConfig.get(StripeSourceOptions.API_BASE_URL);
        if (Strings.isNullOrEmpty(apiBaseUrl) || apiBaseUrl.trim().isEmpty()) {
            throw new IllegalArgumentException("Stripe option 'api_base_url' must not be blank");
        }

        int pageSize = pluginConfig.get(StripeSourceOptions.PAGE_SIZE);
        if (pageSize < 1 || pageSize > 100) {
            throw new IllegalArgumentException(
                    "Stripe option 'page_size' must be between 1 and 100");
        }

        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);

View on GitHub (pinned to cf67b549a7)