{"record":{"id":"eade82a667244c58","repo":"apache/seatunnel","slug":"start-timestamp-can-t-be-negative","errorCode":null,"errorMessage":"start_timestamp can't be negative","messagePattern":"start_timestamp can't be negative","errorType":"validation","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"seatunnel-connectors-v2/connector-hbase/src/main/java/org/apache/seatunnel/connectors/seatunnel/hbase/client/HbaseClient.java","lineNumber":404,"sourceCode":"        scan.setCaching(hbaseParameters.getCaching());\n        scan.setBatch(hbaseParameters.getBatch());\n        for (String columnName : columnNames) {\n            String[] columnNameSplit = columnName.split(\":\");\n            scan.addColumn(Bytes.toBytes(columnNameSplit[0]), Bytes.toBytes(columnNameSplit[1]));\n        }\n        return scan;\n    }\n\n    private static void applyTimeRange(Scan scan, HbaseParameters hbaseParameters)\n            throws IOException {\n        Long startTimestamp = hbaseParameters.getStartTimestamp();\n        Long endTimestamp = hbaseParameters.getEndTimestamp();\n        if (startTimestamp == null && endTimestamp == null) {\n            return;\n        }\n\n        if (startTimestamp != null && startTimestamp < 0) {\n            throw new IllegalArgumentException(\"start_timestamp can't be negative\");\n        }\n        if (endTimestamp != null && endTimestamp < 0) {\n            throw new IllegalArgumentException(\"end_timestamp can't be negative\");\n        }\n\n        long min = startTimestamp == null ? 0L : startTimestamp;\n        long max = endTimestamp == null ? Long.MAX_VALUE : endTimestamp;\n        if (min >= max) {\n            throw new IllegalArgumentException(\"start_timestamp must be less than end_timestamp\");\n        }\n        scan.setTimeRange(min, max);\n    }\n\n    /**\n     * Get a RegionLocator.\n     *\n     * @param tableName table name (preferably fully qualified as {@code namespace:table})\n     * @return RegionLocator","sourceCodeStart":386,"sourceCodeEnd":422,"githubUrl":"https://github.com/apache/seatunnel/blob/cf67b549a7a6c35fa0beb12d83c62892427ea919/seatunnel-connectors-v2/connector-hbase/src/main/java/org/apache/seatunnel/connectors/seatunnel/hbase/client/HbaseClient.java#L386-L422","documentation":"The time-range validation in HbaseClient.applyTimeRange rejects a start_timestamp option that is negative, throwing IllegalArgumentException('start_timestamp can't be negative'). HBase timestamp ranges are epoch millis and must be non-negative, so the library fails fast before building the Scan. This is a config validation error, not a runtime I/O failure.","triggerScenarios":"Configuring source/sink option start_timestamp with a negative value (e.g. -1 or a misparsed epoch in milliseconds) that reaches buildScan via applyTimeRange.","commonSituations":"Passing a timestamp in seconds or as a signed relative offset instead of epoch millis; template placeholder unresolved to -1; copy-paste typo.","solutions":["Set start_timestamp to a valid epoch-millisecond value >= 0","Check how the value is computed/templated in your job config (e.g. Unix ts * 1000)","Remove start_timestamp if you do not need a lower time bound (defaults to 0)"],"exampleFix":"// before\nstart_timestamp = -1000\n// after\nstart_timestamp = 1700000000000","handlingStrategy":"validation","validationCode":"Long start = config.getStartTimestamp();\nif (start != null && start < 0) {\n    throw new IllegalArgumentException(\"start_timestamp must be >= 0 (epoch millis)\");\n}","typeGuard":"static boolean validStartTimestamp(Long ts) { return ts == null || ts >= 0; }","tryCatchPattern":"try { client.buildScan(params); }\ncatch (IllegalArgumentException e) {\n    if (e.getMessage().contains(\"start_timestamp\")) {\n        // fix config to a non-negative epoch-millis value\n    } else throw e;\n}","preventionTips":["Always express HBase timestamps as non-negative epoch milliseconds","Validate connector options before job submission","Watch for seconds-vs-millis conversion errors"],"tags":["hbase","validation","timestamp","config"],"backgroundTag":"invalid-argument-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"}