{"record":{"id":"e5b831ee673e93bf","repo":"apache/seatunnel","slug":"mysql-cdc-diagnostic-failed-to-query-show-master","errorCode":null,"errorMessage":"MySQL-CDC diagnostic: failed to query SHOW MASTER STATUS: {}","messagePattern":"MySQL-CDC diagnostic: failed to query SHOW MASTER STATUS: (.+?)","errorType":"console","errorClass":null,"httpStatus":null,"severity":"warning","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":533,"sourceCode":"            connection.query(\n                    \"SHOW MASTER STATUS\",\n                    rs -> {\n                        if (!rs.next()) {\n                            LOG.warn(\n                                    \"MySQL-CDC diagnostic: SHOW MASTER STATUS returned empty result\");\n                            return;\n                        }\n                        String file = safeGetString(rs, \"File\");\n                        String position = safeGetString(rs, \"Position\");\n                        String gtidSet = safeGetString(rs, \"Executed_Gtid_Set\");\n                        LOG.warn(\n                                \"MySQL-CDC diagnostic: master status file={}, position={}, executed_gtid_set={}\",\n                                file,\n                                position,\n                                gtidSet);\n                    });\n        } catch (SQLException e) {\n            LOG.warn(\n                    \"MySQL-CDC diagnostic: failed to query SHOW MASTER STATUS: {}\", e.getMessage());\n        }\n    }\n\n    private void logMySqlReplicationStatus() {\n        if (logReplicationStatus(\"SHOW REPLICA STATUS\", \"replica\")) {\n            return;\n        }\n        logReplicationStatus(\"SHOW SLAVE STATUS\", \"slave\");\n    }\n\n    private boolean logReplicationStatus(String sql, String label) {\n        try {\n            final List<String> row = new ArrayList<>(8);\n            connection.query(\n                    sql,\n                    rs -> {\n                        if (!rs.next()) {","sourceCodeStart":515,"sourceCodeEnd":551,"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#L515-L551","documentation":"Diagnostic WARN from logMySqlMasterStatus's catch block: SHOW MASTER STATUS raised a SQLException so the binlog position diagnostics could not be collected. Common cause is lack of privileges (SHOW MASTER STATUS requires REPLICATION CLIENT / SUPER) or the command being removed on newer MySQL versions. The CDC task continues; only the diagnostic line is lost.","triggerScenarios":"SQLException on SHOW MASTER STATUS during logBinlogNotAvailableDiagnostics/logGtidNotAvailableDiagnostics — typically insufficient privileges (missing REPLICATION CLIENT) or MySQL 8.4+/9.x where the statement is removed in favor of SHOW BINARY LOG STATUS.","commonSituations":"Least-privilege CDC user without REPLICATION CLIENT; hardened DB proxies rejecting administrative SHOW statements; upgraded MySQL server version.","solutions":["GRANT REPLICATION CLIENT (and REPLICATION SLAVE) to the CDC user","Run SHOW BINARY LOG STATUS manually if on MySQL 8.4+/9.x, or upgrade the SeaTunnel CDC connector to a Debezium/connector version using the new command","Check preceding logs for the real connection error if privilege is not the cause"],"exampleFix":"// before\nGRANT SELECT ON db.* TO 'stuser'@'%';\n// after\nGRANT SELECT, RELOAD, REPLICATION CLIENT, REPLICATION SLAVE ON *.* TO 'stuser'@'%';","handlingStrategy":"try-catch","validationCode":"SHOW GRANTS FOR 'stuser'@'%'; -- needs REPLICATION CLIENT for SHOW MASTER STATUS\nSELECT VERSION(); -- 8.4+ removed SHOW MASTER STATUS","typeGuard":null,"tryCatchPattern":"try {\n    queryMasterStatus(connection);\n} catch (SQLException e) {\n    LOG.warn(\"SHOW MASTER STATUS failed: {}\", e.getMessage());\n    // on MySQL 8.4+ fall back to SHOW BINARY LOG STATUS\n}","preventionTips":["Grant REPLICATION CLIENT and REPLICATION SLAVE to the CDC user","Plan for MySQL 8.4+/9.x statement changes by upgrading the connector","Validate all CDC grants after any user/privilege refactoring"],"tags":["mysql","cdc","diagnostics","sql","permissions"],"backgroundTag":"sql-query-failed","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"}