{"record":{"id":"d9ffb1b3ca0da0d6","repo":"apache/seatunnel","slug":"cannot-read-the-binlog-filename-and-position-via-d9ffb1","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 '(.+?)'\\. Make sure your server is correctly configured","errorType":"exception","errorClass":"SeaTunnelException","httpStatus":null,"severity":"critical","filePath":"seatunnel-connectors-v2/connector-cdc/connector-cdc-mysql/src/main/java/org/apache/seatunnel/connectors/seatunnel/cdc/mysql/utils/MySqlConnectionUtils.java","lineNumber":125,"sourceCode":"                    return new BinlogOffset(\n                            binlogFilename, binlogPosition, 0L, 0, 0, gtidSet, null);\n                };\n        return getBinlogOffset(\n                jdbc, mySqlConnection.binaryLogStatusStatement(), getCurrentBinlogOffset);\n    }\n\n    private static BinlogOffset getBinlogOffset(\n            JdbcConnection jdbc,\n            String showMasterStmt,\n            JdbcConnection.ResultSetMapper<BinlogOffset> function) {\n        try {\n            return jdbc.queryAndMap(\n                    showMasterStmt,\n                    rs -> {\n                        if (rs.next()) {\n                            return function.apply(rs);\n                        } else {\n                            throw new SeaTunnelException(\n                                    \"Cannot read the binlog filename and position via '\"\n                                            + showMasterStmt\n                                            + \"'. Make sure your server is correctly configured\");\n                        }\n                    });\n        } catch (SQLException e) {\n            throw new SeaTunnelException(\n                    \"Cannot read the binlog filename and position via '\"\n                            + showMasterStmt\n                            + \"'. Make sure your server is correctly configured\",\n                    e);\n        }\n    }\n\n    // --------------------------------------------------------------------------------------------\n\n    private static MySqlValueConverters getValueConverters(MySqlConnectorConfig dbzMySqlConfig) {\n        TemporalPrecisionMode timePrecisionMode = dbzMySqlConfig.getTemporalPrecisionMode();","sourceCodeStart":107,"sourceCodeEnd":143,"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/utils/MySqlConnectionUtils.java#L107-L143","documentation":"MySqlConnectionUtils.getBinlogOffset executes a SHOW MASTER STATUS (or similar) statement and expects at least one result row. If the result set is empty it throws SeaTunnelException stating the binlog filename/position could not be read via that statement.","triggerScenarios":"Calling earliestBinlogOffset/currentBinlogOffset (via getBinlogOffset) against a MySQL server whose `SHOW MASTER STATUS` returns no rows — typically when binlogging is disabled.","commonSituations":"MySQL with log_bin=OFF; replica without binary log; cloud-managed MySQL (e.g. some RDS/Aurora configurations) restricting SHOW MASTER STATUS; GTID-only setups where the statement behaves unexpectedly.","solutions":["Enable binary logging: set log_bin=ON and restart MySQL","Verify with `SHOW VARIABLES LIKE 'log_bin'` that binlogging is active","Confirm the connecting user has REPLICATION CLIENT/SLAVE privileges","On MySQL 8.4+/managed instances, use the supported equivalent command instead of SHOW MASTER STATUS","If the source should start from earliest, configure the startup mode accordingly and check server capabilities first"],"exampleFix":"// my.cnf\n// before\n# log_bin disabled\n// after\n[mysqld]\nlog_bin = mysql-bin\nbinlog_format = ROW\nserver_id = 1","handlingStrategy":"validation","validationCode":"mysql -u seatunnel -p -e \"SHOW VARIABLES LIKE 'log_bin'; SHOW MASTER STATUS;\"\n// log_bin must be ON and SHOW MASTER STATUS must return a row","typeGuard":null,"tryCatchPattern":"try {\n    startCdcJob(config);\n} catch (Exception e) {\n    if (e.getMessage().contains(\"Cannot read the binlog filename\")) {\n        log.error(\"Binlog disabled or SHOW MASTER STATUS returned no rows\");\n    }\n}","preventionTips":["Enable log_bin with ROW format before starting CDC","Grant REPLICATION CLIENT and REPLICATION SLAVE","Check server compatibility (MySQL 8.4 renamed the command)","Pre-flight check SHOW MASTER STATUS in deployment scripts"],"tags":["mysql","cdc","binlog","empty-result-set"],"backgroundTag":"empty-result-set","analyzedSha":"cf67b549a7a6c35fa0beb12d83c62892427ea919","analyzedAt":"2026-09-10T21:44:55.265Z","contentChangedAt":"2026-09-10T21:44:55.265Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}