apache/seatunnel · error · IllegalArgumentException

${option} must be greater than zero

Error message

${option} must be greater than zero

What it means

DeepLakeSinkConfig.requirePositive validates numeric options (batch_size, connect_timeout_ms, socket_timeout_ms) and throws IllegalArgumentException('<option> must be greater than zero') when the value is <= 0, guaranteeing the HTTP client and batching logic receive sane parameters.

Source

Thrown at seatunnel-connectors-v2/connector-deeplake/src/main/java/org/apache/seatunnel/connectors/seatunnel/deeplake/config/DeepLakeSinkConfig.java:84

        if (value == null) {
            return null;
        }
        int end = value.length();
        while (end > 0 && value.charAt(end - 1) == '/') {
            end--;
        }
        return value.substring(0, end);
    }

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

    private static void requirePositive(int value, String option) {
        if (value <= 0) {
            throw new IllegalArgumentException(option + " must be greater than zero");
        }
    }

    public String getApiUrl() {
        return apiUrl;
    }

    public String getApiKey() {
        return apiKey;
    }

    public String getOrgId() {
        return orgId;
    }

    public String getWorkspace() {
        return workspace;
    }

View on GitHub (pinned to cf67b549a7)

Solutions

  1. Set the reported option to a positive integer (e.g. batch_size = 100, connect_timeout_ms = 60000)
  2. Remove the option to fall back to the documented default instead of forcing 0
  3. Fix templated config expressions that evaluate to zero

Example fix

// before
socket_timeout_ms = 0
// after
socket_timeout_ms = 120000
Defensive patterns

Strategy: validation

Validate before calling

for (String k : java.util.List.of("batch_size","connect_timeout_ms","socket_timeout_ms")) {
  int v = config.getInt(k, 1);
  if (v <= 0) throw new IllegalStateException(k + " must be > 0");
}

Try / catch

try { new DeepLakeSinkConfig(options); } catch (IllegalArgumentException e) { if (e.getMessage().contains("must be greater than zero")) log.error("Bad numeric option: {}", e.getMessage()); throw e; }

Prevention

When it happens

Trigger: Configuring batch_size, connect_timeout_ms, or socket_timeout_ms with 0 or a negative number in the Deep Lake sink options.

Common situations: Setting a timeout to 0 thinking it means 'no timeout'; templated config arithmetic evaluating to 0; unit mistakes (seconds vs ms) producing tiny or negative values.

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