apache/seatunnel · error · OptionValidationException

tables_configs[%d]: 'start_mode.timestamp' must be >= 0, got

Error message

tables_configs[%d]: 'start_mode.timestamp' must be >= 0, got: %d

What it means

KafkaSourceFactory.evaluate statically validates each entry of tables_configs. If an entry declares start_mode=TIMESTAMP, its start_mode.timestamp must be a non-negative epoch-millis value; null or negative values throw OptionValidationException with this message.

Source

Thrown at seatunnel-connectors-v2/connector-kafka/src/main/java/org/apache/seatunnel/connectors/seatunnel/kafka/source/KafkaSourceFactory.java:210

        public String description() {
            return "each tables_configs entry: start_mode.timestamp >= 0 when TIMESTAMP, "
                    + "non-empty start_mode.offsets when SPECIFIC_OFFSETS";
        }

        @Override
        public boolean evaluate(ReadonlyConfig config, List<Map<String, Object>> entries)
                throws OptionValidationException {
            if (entries == null || entries.isEmpty()) {
                return true;
            }
            for (int i = 0; i < entries.size(); i++) {
                ReadonlyConfig entryConfig = ReadonlyConfig.fromMap(entries.get(i));
                StartMode startMode =
                        entryConfig.getOptional(KafkaSourceOptions.START_MODE).orElse(null);
                if (startMode == StartMode.TIMESTAMP) {
                    Long ts = entryConfig.get(KafkaSourceOptions.START_MODE_TIMESTAMP);
                    if (ts == null || ts < 0) {
                        throw new OptionValidationException(
                                "tables_configs[%d]: 'start_mode.timestamp' must be >= 0, got: %d",
                                i, ts);
                    }
                    if (entries.get(i).containsKey(KafkaSourceOptions.START_MODE_OFFSETS.key())) {
                        throw new OptionValidationException(
                                "tables_configs[%d]: 'start_mode.offsets' is only valid "
                                        + "when start_mode=SPECIFIC_OFFSETS",
                                i);
                    }
                    Long endTs = entryConfig.get(KafkaSourceOptions.START_MODE_END_TIMESTAMP);
                    if (endTs != null && endTs < 0) {
                        throw new OptionValidationException(
                                "tables_configs[%d]: 'start_mode.end_timestamp' must be >= 0, got: %d",
                                i, endTs);
                    }
                } else if (startMode == StartMode.SPECIFIC_OFFSETS) {
                    Map<String, Long> offsets =
                            entryConfig.get(KafkaSourceOptions.START_MODE_OFFSETS);

View on GitHub (pinned to cf67b549a7)

Solutions

  1. Set start_mode.timestamp to a valid non-negative epoch-millis value in each TIMESTAMP-mode entry.
  2. Remove start_mode.timestamp if you don't intend TIMESTAMP mode.
  3. Check every tables_configs entry individually — the error names the offending index.

Example fix

// before
start_mode = TIMESTAMP
start_mode.timestamp = -1
// after
start_mode = TIMESTAMP
start_mode.timestamp = 1704067200000
Defensive patterns

Strategy: validation

Validate before calling

Long ts = entry.get("start_mode.timestamp");
if ("TIMESTAMP".equals(entry.get("start_mode")) && (ts == null || ts < 0)) throw new IllegalArgumentException("invalid start_mode.timestamp in tables_configs");

Try / catch

try { factory.evaluate(ctx); } catch (OptionValidationException e) { log.error("Fix table entry per message: {}", e.getMessage()); }

Prevention

When it happens

Trigger: A tables_configs entry with start_mode=TIMESTAMP where start_mode.timestamp is absent (null) or set to a negative number; validation runs during factory evaluate() at job build time.

Common situations: Placeholder negative values left in multi-table configs; forgetting to set timestamp after switching start_mode to TIMESTAMP; expression placeholders that resolve to null.

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