apache/seatunnel · warning

MySQL-CDC diagnostic: failed to query SHOW MASTER STATUS: {}

Error message

MySQL-CDC diagnostic: failed to query SHOW MASTER STATUS: {}

What it means

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.

Source

Thrown at seatunnel-connectors-v2/connector-cdc/connector-cdc-mysql/src/main/java/org/apache/seatunnel/connectors/seatunnel/cdc/mysql/source/reader/fetch/MySqlSourceFetchTaskContext.java:533

            connection.query(
                    "SHOW MASTER STATUS",
                    rs -> {
                        if (!rs.next()) {
                            LOG.warn(
                                    "MySQL-CDC diagnostic: SHOW MASTER STATUS returned empty result");
                            return;
                        }
                        String file = safeGetString(rs, "File");
                        String position = safeGetString(rs, "Position");
                        String gtidSet = safeGetString(rs, "Executed_Gtid_Set");
                        LOG.warn(
                                "MySQL-CDC diagnostic: master status file={}, position={}, executed_gtid_set={}",
                                file,
                                position,
                                gtidSet);
                    });
        } catch (SQLException e) {
            LOG.warn(
                    "MySQL-CDC diagnostic: failed to query SHOW MASTER STATUS: {}", e.getMessage());
        }
    }

    private void logMySqlReplicationStatus() {
        if (logReplicationStatus("SHOW REPLICA STATUS", "replica")) {
            return;
        }
        logReplicationStatus("SHOW SLAVE STATUS", "slave");
    }

    private boolean logReplicationStatus(String sql, String label) {
        try {
            final List<String> row = new ArrayList<>(8);
            connection.query(
                    sql,
                    rs -> {
                        if (!rs.next()) {

View on GitHub (pinned to cf67b549a7)

Solutions

  1. GRANT REPLICATION CLIENT (and REPLICATION SLAVE) to the CDC user
  2. 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
  3. Check preceding logs for the real connection error if privilege is not the cause

Example fix

// before
GRANT SELECT ON db.* TO 'stuser'@'%';
// after
GRANT SELECT, RELOAD, REPLICATION CLIENT, REPLICATION SLAVE ON *.* TO 'stuser'@'%';
Defensive patterns

Strategy: try-catch

Validate before calling

SHOW GRANTS FOR 'stuser'@'%'; -- needs REPLICATION CLIENT for SHOW MASTER STATUS
SELECT VERSION(); -- 8.4+ removed SHOW MASTER STATUS

Try / catch

try {
    queryMasterStatus(connection);
} catch (SQLException e) {
    LOG.warn("SHOW MASTER STATUS failed: {}", e.getMessage());
    // on MySQL 8.4+ fall back to SHOW BINARY LOG STATUS
}

Prevention

When it happens

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

Common situations: Least-privilege CDC user without REPLICATION CLIENT; hardened DB proxies rejecting administrative SHOW statements; upgraded MySQL server version.

Understand the failure class

Background: "query failed", "%w: SQL error" — wrapped database query errors in Go libraries explained — this error's family across 3 libraries.

Related errors


AI-assisted analysis of apache/seatunnel@cf67b549a7 (2026-09-10). Data as JSON: /api/errors/e5b831ee673e93bf. Report an issue: GitHub.