{"record":{"id":"534f90f1050b6a48","repo":"alibaba/canal","slug":"start-timestamp-binlog-files-is-empty","errorCode":null,"errorMessage":"start timestamp : {} binlog files is empty","messagePattern":"start timestamp : (.+?) binlog files is empty","errorType":"exception","errorClass":"CanalParseException","httpStatus":null,"severity":"error","filePath":"parse/src/main/java/com/alibaba/otter/canal/parse/inbound/mysql/rds/RdsLocalBinlogEventParser.java","lineNumber":72,"sourceCode":"\n            EntryPosition entryPosition = findStartPosition(null);\n            if (entryPosition == null) {\n                throw new PositionNotFoundException(\"position not found!\");\n            }\n            Long startTimeInMill = entryPosition.getTimestamp();\n            if (startTimeInMill == null || startTimeInMill <= 0) {\n                throw new PositionNotFoundException(\"position timestamp is empty!\");\n            }\n\n            startTime = startTimeInMill;\n            List<BinlogFile> binlogFiles = RdsBinlogOpenApi.listBinlogFiles(url,\n                accesskey,\n                secretkey,\n                instanceId,\n                new Date(startTime),\n                new Date(endTime));\n            if (binlogFiles.isEmpty()) {\n                throw new CanalParseException(\"start timestamp : \" + startTimeInMill + \" binlog files is empty\");\n            }\n\n            binlogDownloadQueue = new BinlogDownloadQueue(binlogFiles, batchFileSize, directory);\n            binlogDownloadQueue.silenceDownload();\n            needWait = true;\n            // try to download one file,use to test server id\n            binlogDownloadQueue.tryOne();\n        } catch (Throwable e) {\n            logger.error(\"download binlog failed\", e);\n            throw new CanalParseException(e);\n        }\n        setParserExceptionHandler(this::handleMysqlParserException);\n        super.start();\n    }\n\n    private void handleMysqlParserException(Throwable throwable) {\n        if (throwable instanceof ServerIdNotMatchException) {\n            logger.error(\"server id not match, try download another rds binlog!\");","sourceCodeStart":54,"sourceCodeEnd":90,"githubUrl":"https://github.com/alibaba/canal/blob/87be50e87686a3e8af08c368d0e1ffd1f59eb04a/parse/src/main/java/com/alibaba/otter/canal/parse/inbound/mysql/rds/RdsLocalBinlogEventParser.java#L54-L90","documentation":"Thrown as CanalParseException by RdsLocalBinlogEventParser.start() when RdsBinlogOpenApi.listBinlogFiles() returns an empty list — meaning RDS has no binlog backup files available for the time range [startTime, endTime]. The start timestamp is included in the message.","triggerScenarios":"The RDS OpenAPI call to DescribeBinlogFiles succeeds but returns zero files for the query time window. This occurs when the start timestamp is too old (beyond RDS binlog retention), too far in the future, or the RDS instance did not produce binlogs in that period.","commonSituations":"RDS binlog retention period (default 7 days, max 7 days for some tiers) has expired for the requested start time; the startTime was set to a date before the RDS instance was created; the instanceId is wrong and points to a different instance; RDS binlog backup was disabled by the account.","solutions":["Verify the startTime falls within the RDS binlog backup retention window (typically last 7 days).","Check the RDS console to confirm binlog backup files exist for the requested time range.","Adjust the startTime to a more recent timestamp that has available binlog files.","Confirm the instanceId is correct and matches the RDS instance that generated the binlogs."],"exampleFix":null,"handlingStrategy":"validation","validationCode":"// Validate time range is within RDS retention before starting\nlong now = System.currentTimeMillis();\nlong maxRetentionMs = 7L * 24 * 60 * 60 * 1000; // 7 days\nif (startTime != null && (now - startTime) > maxRetentionMs) {\n    logger.warn(\"Start time is older than RDS binlog retention period, files may not be available\");\n}","typeGuard":null,"tryCatchPattern":"try {\n    parser.start();\n} catch (CanalParseException e) {\n    if (e.getMessage().contains(\"binlog files is empty\")) {\n        // adjust startTime to within retention window\n    }\n}","preventionTips":["Keep the start time within the RDS binlog backup retention window (typically 7 days).","Verify binlog backup is enabled on the RDS instance.","Confirm the instanceId is correct and binlog files exist in the RDS console."],"tags":["rds","binlog","openapi","retention","canal-parse"],"backgroundTag":null,"analyzedSha":"87be50e87686a3e8af08c368d0e1ffd1f59eb04a","analyzedAt":"2026-08-14T04:30:11.918Z","schemaVersion":2},"datasetVersion":"2026-08-14T05:17:29.042Z"}