{"record":{"id":"a15788f50e89db9d","repo":"apache/seatunnel","slug":"connector-requires-binlog-file-but-it-is-not","errorCode":null,"errorMessage":"Connector requires binlog file '{}', but it is not available on the connected MySQL server. {}","messagePattern":"Connector requires binlog file '(.+?)', but it is not available on the connected MySQL server\\. (.+?)","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"seatunnel-connectors-v2/connector-cdc/connector-cdc-mysql/src/main/java/org/apache/seatunnel/connectors/seatunnel/cdc/mysql/source/reader/fetch/MySqlSourceFetchTaskContext.java","lineNumber":349,"sourceCode":"        return checkBinlogFilename(offset);\n    }\n\n    private boolean checkBinlogFilename(MySqlOffsetContext offset) {\n        String binlogFilename = offset.getSourceInfo().getString(BINLOG_FILENAME_OFFSET_KEY);\n        if (binlogFilename == null) {\n            return true; // start at current position\n        }\n        if (binlogFilename.equals(\"\")) {\n            return true; // start at beginning\n        }\n\n        // Accumulate the available binlog filenames ...\n        List<String> logNames = connection.availableBinlogFiles();\n\n        // And compare with the one we're supposed to use ...\n        boolean found = logNames.stream().anyMatch(binlogFilename::equals);\n        if (!found) {\n            LOG.warn(\n                    \"Connector requires binlog file '{}', but it is not available on the connected MySQL server. {}\",\n                    binlogFilename,\n                    summarizeBinlogFiles(logNames));\n            logBinlogNotAvailableDiagnostics(binlogFilename, logNames, offset);\n        } else {\n            LOG.info(\"MySQL has the binlog file '{}' required by the connector\", binlogFilename);\n        }\n        return found;\n    }\n\n    private boolean checkGtidSet(MySqlOffsetContext offset) {\n        String gtidStr = offset.gtidSet();\n\n        if (gtidStr.trim().isEmpty()) {\n            return true; // start at beginning ...\n        }\n\n        String availableGtidStr = connection.knownGtidSet();","sourceCodeStart":331,"sourceCodeEnd":367,"githubUrl":"https://github.com/apache/seatunnel/blob/cf67b549a7a6c35fa0beb12d83c62892427ea919/seatunnel-connectors-v2/connector-cdc/connector-cdc-mysql/src/main/java/org/apache/seatunnel/connectors/seatunnel/cdc/mysql/source/reader/fetch/MySqlSourceFetchTaskContext.java#L331-L367","documentation":"When restoring a MySQL CDC reader from a saved offset, checkBinlogFilename() (called from isBinlogAvailable) compares the binlog filename required by the connector's offset against the list returned by SHOW BINARY LOGS. If the required file is no longer on the server, the reader cannot resume from that offset; this warning plus diagnostics are logged and the fetch task aborts.","triggerScenarios":"checkBinlogFilename(): logNames.stream().anyMatch(binlogFilename::equals) is false — the offset's binlog file was purged by MySQL retention (expire_logs_days/binlog_expire_logs_seconds) or RESET BINARY LOGS ran, so the filename is absent from connection.availableBinlogFiles().","commonSituations":"Job checkpoint is older than the binlog retention window (server purged old binlogs while the job was stopped); failover to a replica with different binlog files; MySQL restarted with binlog files cleaned; resuming a long-idle job.","solutions":["Restart the CDC job with a fresh/earlier snapshot (drop the saved state) so a new consistent snapshot is taken.","Increase binlog retention: SET PERSIST binlog_expire_logs_seconds = <larger>; and ensure enough disk space before long job stoppages.","Restore the required binlog file from backup into the server's binlog directory if available.","Point the job at the same server (not a replica without the binlog) or use GTID-based offsets instead of filenames."],"exampleFix":"-- before (server)\nbinlog_expire_logs_seconds = 86400  -- 1 day\n-- after\nSET PERSIST binlog_expire_logs_seconds = 604800; -- 7 days","handlingStrategy":"validation","validationCode":"-- Before resuming a stopped job, verify the offset's binlog still exists:\nSHOW BINARY LOGS;\n-- Compare with the checkpoint's binlog filename.","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Keep jobs running or restart within binlog retention windows","Set binlog_expire_logs_seconds generously (e.g. 7 days) with adequate disk","Monitor checkpoints vs SHOW MASTER STATUS during long stoppages","Avoid RESET BINARY LOGS / PURGE BINARY LOGS on servers serving CDC","Fail over only to servers that retain the required binlog files"],"tags":["mysql","binlog","checkpoint","retention"],"backgroundTag":"resource-not-found","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"}