{"record":{"id":"ba112ede6fabc256","repo":"apache/seatunnel","slug":"cannot-read-the-binlog-filename-and-position-via","errorCode":null,"errorMessage":"Cannot read the binlog filename and position via '<showMasterStmt>'. Make sure your server is correctly configured","messagePattern":"Cannot read the binlog filename and position via '<showMasterStmt>'\\. Make sure your server is correctly configured","errorType":"exception","errorClass":"DebeziumException","httpStatus":null,"severity":"error","filePath":"seatunnel-connectors-v2/connector-cdc/connector-cdc-mysql/src/main/java/io/debezium/connector/mysql/MySqlSnapshotChangeEventSource.java","lineNumber":373,"sourceCode":"                            // This column exists only in MySQL 5.6.5 or later ...\n                            final String gtidSet =\n                                    rs.getString(\n                                            5); // GTID set, may be null, blank, or contain a GTID\n                            // set\n                            offsetContext.setCompletedGtidSet(gtidSet);\n                            LOGGER.info(\n                                    \"\\t using binlog '{}' at position '{}' and gtid '{}'\",\n                                    binlogFilename,\n                                    binlogPosition,\n                                    gtidSet);\n                        } else {\n                            LOGGER.info(\n                                    \"\\t using binlog '{}' at position '{}'\",\n                                    binlogFilename,\n                                    binlogPosition);\n                        }\n                    } else {\n                        throw new DebeziumException(\n                                \"Cannot read the binlog filename and position via '\"\n                                        + showMasterStmt\n                                        + \"'. Make sure your server is correctly configured\");\n                    }\n                });\n        tryStartingSnapshot(ctx);\n    }\n\n    private void addSchemaEvent(\n            RelationalSnapshotContext<MySqlPartition, MySqlOffsetContext> snapshotContext,\n            String database,\n            String ddl) {\n        schemaEvents.addAll(\n                databaseSchema.parseSnapshotDdl(\n                        snapshotContext.partition,\n                        ddl,\n                        database,\n                        snapshotContext.offset,","sourceCodeStart":355,"sourceCodeEnd":391,"githubUrl":"https://github.com/apache/seatunnel/blob/cf67b549a7a6c35fa0beb12d83c62892427ea919/seatunnel-connectors-v2/connector-cdc/connector-cdc-mysql/src/main/java/io/debezium/connector/mysql/MySqlSnapshotChangeEventSource.java#L355-L391","documentation":"determineSnapshotOffset() executes showMasterStmt (SHOW MASTER STATUS, or SHOW SLAVE STATUS/replica variants for replicas) and expects at least one row with the current binlog file and position. If the result set is empty, it throws this DebeziumException, meaning the server did not report a binlog position at snapshot start. Usually the server has binlogging disabled or the user lacks the privilege to see it.","triggerScenarios":"Calling determineSnapshotOffset() with no previous offset when 'SHOW MASTER STATUS' returns an empty result — i.e. log_bin=OFF on the server, binlog disabled on the replica, or the account lacks REPLICATION CLIENT so MySQL hides the binlog status row.","commonSituations":"Fresh MySQL installs where log_bin is not enabled; Docker MySQL images without --log-bin; RDS instances with automated backups disabled (binlog off); CDC user created without REPLICATION CLIENT; pointing the connector at a replica that has log_slave_updates/binlogs disabled.","solutions":["Enable binlogging on the server: set log_bin=ON (MySQL 8 enables it by default; 5.7 needs a log-bin config) and restart.","Grant the CDC user REPLICATION CLIENT (and REPLICATION SLAVE): GRANT REPLICATION CLIENT ON *.* TO 'user'@'%';","Run 'SHOW MASTER STATUS' (or SHOW BINARY LOG STATUS on 8.4+) with the same credentials to confirm a row is returned.","On managed MySQL (RDS), enable automated backups / binlog retention: call mysql.rds_set_configuration('binlog retention hours', 24).","If snapshotting from a replica, ensure the replica has its own binlogs (log_bin=ON, log_slave_updates=ON) or snapshot from the primary."],"exampleFix":"-- before: my.cnf (binlog off)\n# no log-bin setting\n-- after\n[mysqld]\nlog_bin = mysql-bin\nbinlog_format = ROW\nserver_id = 1\n-- plus privileges\nGRANT REPLICATION CLIENT, REPLICATION SLAVE ON *.* TO 'stuser'@'%';","handlingStrategy":"validation","validationCode":"// Pre-flight check with the exact CDC credentials:\n// mysql -u stuser -p -h <host> -e \"SHOW MASTER STATUS;\"\n// A one-row result means the snapshot offset can be determined.\n// On MySQL 8.4+ use: SHOW BINARY LOG STATUS;","typeGuard":null,"tryCatchPattern":"try {\n    startCdcJob();\n} catch (DebeziumException e) {\n    if (e.getMessage().startsWith(\"Cannot read the binlog filename and position\")) {\n        // enable binlog (log_bin=ON) and grant REPLICATION CLIENT, then rerun\n    } else {\n        throw e;\n    }\n}","preventionTips":["Confirm log_bin is ON and 'SHOW MASTER STATUS' returns a row before configuring CDC.","Grant REPLICATION CLIENT and REPLICATION SLAVE to the CDC user on *.*.","On RDS/Aurora enable automated backups and set binlog retention hours.","Ensure replicas used for snapshotting have log_bin and log_slave_updates enabled."],"tags":["mysql","cdc","binlog","server-configuration","snapshot"],"backgroundTag":"binlog-not-enabled","analyzedSha":"cf67b549a7a6c35fa0beb12d83c62892427ea919","analyzedAt":"2026-09-10T21:44:55.265Z","contentChangedAt":"2026-09-10T21:44:55.265Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}