apache/seatunnel · error · IllegalArgumentException

Stripe option 'created_gte' must not be negative

Error message

Stripe option 'created_gte' must not be negative

What it means

buildWithConfig validates the optional created_gte option, which is passed to Stripe as a lower-bound epoch-seconds filter on PaymentIntents creation time. A negative timestamp is meaningless (dates before 1970), so the connector rejects it with this IllegalArgumentException during config build.

Solutions

  1. Set created_gte to a valid non-negative epoch-seconds value for the intended start time.
  2. Compute the epoch value with a correct tool (e.g. date -d '2024-01-01' +%s on Linux).
  3. Remove created_gte from the config if no lower time bound is needed.
  4. If a relative window is wanted, compute now - N in epoch seconds rather than using a negative literal.

Example fix

// before
created_gte = -1704067200
// after
created_gte = 1704067200
Defensive patterns

Strategy: validation

Validate before calling

long gte = pluginConfig.getOptional(StripeSourceOptions.CREATED_GTE).orElse(0L);
if (gte < 0) {
    throw new IllegalArgumentException("created_gte must be a non-negative epoch-seconds value");
}

Try / catch

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

Prevention

When it happens

Trigger: Calling buildWithConfig with pluginConfig providing CREATED_GTE as a negative long, e.g. created_gte = -1000000000, typically via buildParameter or createReader.

Common situations: User enters a negative offset intending a relative time ('one year ago'); epoch mistakenly computed with milliseconds vs seconds sign error; placeholder left as -1.

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/f5a693b1d672e89a. 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:62

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

View on GitHub (pinned to cf67b549a7)