{"record":{"id":"6471151d26045201","repo":"apache/seatunnel","slug":"start-mode-timestamp-must-not-be-greater-than-the","errorCode":null,"errorMessage":"start_mode.timestamp must not be greater than the current time","messagePattern":"start_mode\\.timestamp must not be greater than the current time","errorType":"validation","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"seatunnel-connectors-v2/connector-kafka/src/main/java/org/apache/seatunnel/connectors/seatunnel/kafka/source/KafkaSourceConfig.java","lineNumber":215,"sourceCode":"\n        consumerMetadata.setCatalogTable(outputCatalogTable);\n        consumerMetadata.setDeserializationSchema(schema);\n\n        // parse start mode\n        readonlyConfig\n                .getOptional(START_MODE)\n                .ifPresent(\n                        startMode -> {\n                            consumerMetadata.setStartMode(startMode);\n                            switch (startMode) {\n                                case TIMESTAMP:\n                                    long startOffsetsTimestamp =\n                                            readonlyConfig.get(START_MODE_TIMESTAMP);\n                                    long currentTimestamp = System.currentTimeMillis();\n                                    // Runtime check: cannot be declarative (depends on current\n                                    // time)\n                                    if (startOffsetsTimestamp > currentTimestamp) {\n                                        throw new IllegalArgumentException(\n                                                \"start_mode.timestamp must not be greater than the current time\");\n                                    }\n                                    consumerMetadata.setStartOffsetsTimestamp(\n                                            startOffsetsTimestamp);\n                                    if (Objects.nonNull(\n                                            readonlyConfig.get(START_MODE_END_TIMESTAMP))) {\n                                        long endOffsetsTimestamp =\n                                                readonlyConfig.get(START_MODE_END_TIMESTAMP);\n                                        // Runtime check: cannot be declarative (depends on current\n                                        // time)\n                                        if (endOffsetsTimestamp > currentTimestamp) {\n                                            throw new IllegalArgumentException(\n                                                    \"start_mode.end_timestamp must not be greater than the current time\");\n                                        }\n                                        consumerMetadata.setEndOffsetsTimestamp(\n                                                endOffsetsTimestamp);\n                                    }\n                                    break;","sourceCodeStart":197,"sourceCodeEnd":233,"githubUrl":"https://github.com/apache/seatunnel/blob/cf67b549a7a6c35fa0beb12d83c62892427ea919/seatunnel-connectors-v2/connector-kafka/src/main/java/org/apache/seatunnel/connectors/seatunnel/kafka/source/KafkaSourceConfig.java#L197-L233","documentation":"When start_mode=TIMESTAMP, KafkaSourceConfig validates at consumer-metadata creation that start_mode.timestamp is not in the future. Since consumption starts from offsets at that timestamp, a future time is meaningless and would yield no offsets, so an IllegalArgumentException is thrown.","triggerScenarios":"Setting start_mode=TIMESTAMP with start_mode.timestamp = System.currentTimeMillis() computed later in the config chain, or any hardcoded timestamp greater than current wall-clock time when createConsumerMetadata runs.","commonSituations":"Timestamps generated at build/codegen time but job launched later; copy-pasted future dates; timezone confusion (e.g. interpreting local time as epoch millis incorrectly); clock skew on the submitting host.","solutions":["Set start_mode.timestamp to a past epoch-millis value (System.currentTimeMillis() computed at job submission or earlier).","Compute the timestamp dynamically at job start instead of hardcoding it.","Verify the value is in milliseconds (13-digit for recent dates), not seconds."],"exampleFix":"// before\nstart_mode.timestamp = 1893456000000  # 2030-01-01, in the future\n// after\nstart_mode.timestamp = 1704067200000  # 2024-01-01, in the past","handlingStrategy":"validation","validationCode":"long ts = config.getStartModeTimestamp();\nif (ts > System.currentTimeMillis()) throw new IllegalArgumentException(\"start_mode.timestamp must be in the past (epoch millis)\");","typeGuard":null,"tryCatchPattern":"try { submitJob(cfg); } catch (IllegalArgumentException e) { if (e.getMessage().contains(\"start_mode.timestamp\")) fixTimestamp(cfg); else throw e; }","preventionTips":["Compute timestamps at submission time, never hardcode.","Confirm values are epoch milliseconds and in the past."],"tags":["kafka","config","timestamp","validation"],"backgroundTag":"invalid-config-value","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"}