alibaba/canal · error · CanalParseException

start timestamp : {} binlog files is empty

Error message

start timestamp : {} binlog files is empty

What it means

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.

Source

Thrown at parse/src/main/java/com/alibaba/otter/canal/parse/inbound/mysql/rds/RdsLocalBinlogEventParser.java:72

            EntryPosition entryPosition = findStartPosition(null);
            if (entryPosition == null) {
                throw new PositionNotFoundException("position not found!");
            }
            Long startTimeInMill = entryPosition.getTimestamp();
            if (startTimeInMill == null || startTimeInMill <= 0) {
                throw new PositionNotFoundException("position timestamp is empty!");
            }

            startTime = startTimeInMill;
            List<BinlogFile> binlogFiles = RdsBinlogOpenApi.listBinlogFiles(url,
                accesskey,
                secretkey,
                instanceId,
                new Date(startTime),
                new Date(endTime));
            if (binlogFiles.isEmpty()) {
                throw new CanalParseException("start timestamp : " + startTimeInMill + " binlog files is empty");
            }

            binlogDownloadQueue = new BinlogDownloadQueue(binlogFiles, batchFileSize, directory);
            binlogDownloadQueue.silenceDownload();
            needWait = true;
            // try to download one file,use to test server id
            binlogDownloadQueue.tryOne();
        } catch (Throwable e) {
            logger.error("download binlog failed", e);
            throw new CanalParseException(e);
        }
        setParserExceptionHandler(this::handleMysqlParserException);
        super.start();
    }

    private void handleMysqlParserException(Throwable throwable) {
        if (throwable instanceof ServerIdNotMatchException) {
            logger.error("server id not match, try download another rds binlog!");

View on GitHub (pinned to 87be50e876)

Solutions

  1. Verify the startTime falls within the RDS binlog backup retention window (typically last 7 days).
  2. Check the RDS console to confirm binlog backup files exist for the requested time range.
  3. Adjust the startTime to a more recent timestamp that has available binlog files.
  4. Confirm the instanceId is correct and matches the RDS instance that generated the binlogs.
Defensive patterns

Strategy: validation

Validate before calling

// Validate time range is within RDS retention before starting
long now = System.currentTimeMillis();
long maxRetentionMs = 7L * 24 * 60 * 60 * 1000; // 7 days
if (startTime != null && (now - startTime) > maxRetentionMs) {
    logger.warn("Start time is older than RDS binlog retention period, files may not be available");
}

Try / catch

try {
    parser.start();
} catch (CanalParseException e) {
    if (e.getMessage().contains("binlog files is empty")) {
        // adjust startTime to within retention window
    }
}

Prevention

When it happens

Trigger: 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.

Common situations: 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.

Related errors


AI-assisted analysis of alibaba/canal@87be50e876 (2026-08-14). Data as JSON: /api/errors/534f90f1050b6a48. Report an issue: GitHub.