apache/seatunnel · error · IllegalArgumentException

Option '${option}' must be greater than 0

Error message

Option '${option}' must be greater than 0

What it means

Thrown by requirePositive in GooglePubSubSourceConfig when a numeric tuning option (max_outstanding_messages, max_outstanding_bytes, parallel_pull_count) is supplied but is zero or negative. Null is allowed (falls back to client default); a present value must be > 0.

Source

Thrown at seatunnel-connectors-v2/connector-google-pubsub/src/main/java/org/apache/seatunnel/connectors/seatunnel/google/pubsub/config/GooglePubSubSourceConfig.java:97

                .parallelPullCount(parallelPullCount)
                .build();
    }

    private static void requireNonBlank(String value, String option) {
        if (value == null || value.trim().isEmpty()) {
            throw new IllegalArgumentException("Option '" + option + "' cannot be blank");
        }
    }

    private static void requireNonBlankIfPresent(String value, String option) {
        if (value != null) {
            requireNonBlank(value, option);
        }
    }

    private static void requirePositive(Number value, String option) {
        if (value != null && value.longValue() <= 0) {
            throw new IllegalArgumentException("Option '" + option + "' must be greater than 0");
        }
    }
}

View on GitHub (pinned to cf67b549a7)

Solutions

  1. Change the offending option to a positive value (e.g. max_outstanding_messages = 1000, parallel_pull_count = 5).
  2. Remove the option entirely to let the connector/GCP client use its default.
  3. Review any templated config where arithmetic or env defaults may produce 0.

Example fix

// before
max_outstanding_messages = 0
// after
max_outstanding_messages = 1000
Defensive patterns

Strategy: validation

Validate before calling

long msgs = Long.parseLong(config.get("max_outstanding_messages"));
long bytes = Long.parseLong(config.get("max_outstanding_bytes"));
int pullers = Integer.parseInt(config.get("parallel_pull_count"));
if (msgs <= 0 || bytes <= 0 || pullers <= 0) throw new IllegalArgumentException("numeric options must be > 0");

Prevention

When it happens

Trigger: Calling GooglePubSubSourceConfig.from with any of max_outstanding_messages, max_outstanding_bytes, or parallel_pull_count set to 0 or a negative number.

Common situations: Users set max_outstanding_messages = 0 intending 'unlimited', or a computed/default-interpolated value evaluates to 0. The Google Pub/Sub client itself requires strictly positive values for these builder parameters.

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/dcabc2c005e173ad. Report an issue: GitHub.