{"record":{"id":"d6337d3dcf321070","repo":"apache/seatunnel","slug":"start-mode-end-timestamp-must-not-be-greater-than","errorCode":null,"errorMessage":"start_mode.end_timestamp must not be greater than the current time","messagePattern":"start_mode\\.end_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":227,"sourceCode":"                                    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;\n                                case SPECIFIC_OFFSETS:\n                                    Map<String, Long> offsetMap =\n                                            readonlyConfig.get(START_MODE_OFFSETS);\n                                    Map<TopicPartition, Long> specificStartOffsets =\n                                            new HashMap<>();\n                                    offsetMap.forEach(\n                                            (topicPartitionKey, offset) -> {\n                                                int splitIndex = topicPartitionKey.lastIndexOf(\"-\");\n                                                String topic =\n                                                        topicPartitionKey.substring(0, splitIndex);\n                                                String partition =\n                                                        topicPartitionKey.substring(splitIndex + 1);","sourceCodeStart":209,"sourceCodeEnd":245,"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#L209-L245","documentation":"When start_mode.end_timestamp is set (bounded consumption until a timestamp), KafkaSourceConfig validates that it is not greater than the current time. An end timestamp in the future is rejected with IllegalArgumentException because the bound cannot be resolved against existing offsets yet.","triggerScenarios":"Configuring start_mode=TIMESTAMP with start_mode.end_timestamp set to a future epoch-millis value; createConsumerMetadata performs the wall-clock comparison when building consumer metadata.","commonSituations":"Intending 'read up to now' but setting a future value; timezone/unit confusion (seconds vs millis); scheduling a job for later replay with a precomputed end time.","solutions":["Set start_mode.end_timestamp to a past epoch-millis value (must be <= now).","Compute end_timestamp at job submission time rather than hardcoding.","If you want 'read until now and stop', use the latest/current-time semantics appropriate to the connector instead of a future timestamp."],"exampleFix":"// before\nstart_mode.end_timestamp = 1893456000000  # future\n// after\nstart_mode.end_timestamp = 1704067200000  # past epoch millis","handlingStrategy":"validation","validationCode":"Long endTs = config.getStartModeEndTimestamp();\nif (endTs != null && endTs > System.currentTimeMillis()) throw new IllegalArgumentException(\"start_mode.end_timestamp must be in the past (epoch millis)\");","typeGuard":null,"tryCatchPattern":"try { submitJob(cfg); } catch (IllegalArgumentException e) { if (e.getMessage().contains(\"end_timestamp\")) fixEndTimestamp(cfg); else throw e; }","preventionTips":["Validate end_timestamp <= now at config load.","Never precompute end timestamps for future scheduled runs."],"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"}