{"record":{"id":"e077ce12a7632742","repo":"apache/seatunnel","slug":"tables-configs-d-start-mode-timestamp-is-only","errorCode":null,"errorMessage":"tables_configs[%d]: 'start_mode.timestamp' is only valid when start_mode=TIMESTAMP","messagePattern":"tables_configs\\[(.+?)\\]: 'start_mode\\.timestamp' is only valid when start_mode=TIMESTAMP","errorType":"validation","errorClass":"OptionValidationException","httpStatus":null,"severity":"error","filePath":"seatunnel-connectors-v2/connector-kafka/src/main/java/org/apache/seatunnel/connectors/seatunnel/kafka/source/KafkaSourceFactory.java","lineNumber":236,"sourceCode":"                                i);\n                    }\n                    Long endTs = entryConfig.get(KafkaSourceOptions.START_MODE_END_TIMESTAMP);\n                    if (endTs != null && endTs < 0) {\n                        throw new OptionValidationException(\n                                \"tables_configs[%d]: 'start_mode.end_timestamp' must be >= 0, got: %d\",\n                                i, endTs);\n                    }\n                } else if (startMode == StartMode.SPECIFIC_OFFSETS) {\n                    Map<String, Long> offsets =\n                            entryConfig.get(KafkaSourceOptions.START_MODE_OFFSETS);\n                    if (offsets == null || offsets.isEmpty()) {\n                        throw new OptionValidationException(\n                                \"tables_configs[%d]: 'start_mode.offsets' must not be empty \"\n                                        + \"when start_mode=SPECIFIC_OFFSETS\",\n                                i);\n                    }\n                    if (entries.get(i).containsKey(KafkaSourceOptions.START_MODE_TIMESTAMP.key())) {\n                        throw new OptionValidationException(\n                                \"tables_configs[%d]: 'start_mode.timestamp' is only valid \"\n                                        + \"when start_mode=TIMESTAMP\",\n                                i);\n                    }\n                } else if (entries.get(i).containsKey(KafkaSourceOptions.START_MODE_TIMESTAMP.key())\n                        || entries.get(i)\n                                .containsKey(KafkaSourceOptions.START_MODE_OFFSETS.key())) {\n                    throw new OptionValidationException(\n                            \"tables_configs[%d]: 'start_mode.timestamp' and \"\n                                    + \"'start_mode.offsets' require an appropriate start_mode\",\n                            i);\n                }\n            }\n            return true;\n        }\n    }\n}\n","sourceCodeStart":218,"sourceCodeEnd":254,"githubUrl":"https://github.com/apache/seatunnel/blob/cf67b549a7a6c35fa0beb12d83c62892427ea919/seatunnel-connectors-v2/connector-kafka/src/main/java/org/apache/seatunnel/connectors/seatunnel/kafka/source/KafkaSourceFactory.java#L218-L254","documentation":"evaluate() enforces that start_mode.timestamp is only set when start_mode=TIMESTAMP. Entries with other start modes (e.g. SPECIFIC_OFFSETS or any mode reached in the final else branch) that still carry start_mode.timestamp (or end_timestamp) throw OptionValidationException.","triggerScenarios":"A tables_configs entry where start_mode is not TIMESTAMP but start_mode.timestamp (or end_timestamp) key is present in the entry map; checked at the end of evaluate()'s per-entry validation chain.","commonSituations":"Copy-pasted table configs carrying stale timestamp options after switching to SPECIFIC_OFFSETS or LATEST; merged YAML/HOCON blocks retaining both keys.","solutions":["Remove start_mode.timestamp (and end_timestamp) from entries not using start_mode=TIMESTAMP.","Set start_mode=TIMESTAMP if the timestamp is actually intended.","Sweep all tables_configs entries for leftover options when changing start modes."],"exampleFix":"// before\nstart_mode = SPECIFIC_OFFSETS\nstart_mode.offsets = {\"partition-0\": 100}\nstart_mode.timestamp = 1704067200000\n// after\nstart_mode = SPECIFIC_OFFSETS\nstart_mode.offsets = {\"partition-0\": 100}","handlingStrategy":"validation","validationCode":"if (!\"TIMESTAMP\".equals(entry.get(\"start_mode\")) && entry.containsKey(\"start_mode.timestamp\")) { throw new IllegalArgumentException(\"start_mode.timestamp requires start_mode=TIMESTAMP\"); }","typeGuard":null,"tryCatchPattern":"try { factory.evaluate(ctx); } catch (OptionValidationException e) { stripTimestampOptions(ctx); reevaluate(ctx); }","preventionTips":["When changing start modes, delete options belonging to other modes.","Lint tables_configs for cross-mode option leakage before submission."],"tags":["kafka","config","validation","conflicting-options"],"backgroundTag":"conflicting-config-options","analyzedSha":"cf67b549a7a6c35fa0beb12d83c62892427ea919","analyzedAt":"2026-09-10T21:44:55.265Z","contentChangedAt":"2026-09-10T21:44:55.265Z","schemaVersion":2},"datasetVersion":"2026-09-14T11:17:12.474Z"}