apache/seatunnel · error · IllegalStateException
Cannot read the binlog filename and position via '${showMast
Error message
Cannot read the binlog filename and position via '${showMasterStmt}'. Make sure your server is correctly configured What it means
After taking a snapshot, SnapshotReader.readBinlogPosition issues a binlog status statement (SHOW MASTER STATUS or SHOW BINARY LOG STATUS, depending on server version) and expects exactly one row with the current binlog filename and position. If the query returns no usable row, an IllegalStateException is thrown telling the user the server appears incorrectly configured.
Source
Thrown at seatunnel-connectors-v2/connector-cdc/connector-cdc-mysql/src/main/java/io/debezium/connector/mysql/legacy/SnapshotReader.java:1050
String gtidSet =
rs.getString(
5); // GTID set, may be null, blank, or contain a
// GTID set
source.setCompletedGtidSet(gtidSet);
logger.info(
"\t using binlog '{}' at position '{}' and gtid '{}'",
binlogFilename,
binlogPosition,
gtidSet);
} else {
logger.info(
"\t using binlog '{}' at position '{}'",
binlogFilename,
binlogPosition);
}
source.startSnapshot();
} else {
throw new IllegalStateException(
"Cannot read the binlog filename and position via '"
+ showMasterStmt
+ "'. Make sure your server is correctly configured");
}
});
}
}
/**
* Get the filters for table creation. Depending on the configuration, this may not be the
* default filter set.
*
* @param filters the default filters of this {@link SnapshotReader}
* @return {@link Filters} that represent all the tables that this snapshot reader should CREATE
*/
private Filters getCreateTableFilters(Filters filters) {
MySqlConnectorConfig.SnapshotNewTables snapshotNewTables =
context.getConnectorConfig().getSnapshotNewTables();View on GitHub (pinned to cf67b549a7)
Solutions
- Enable binary logging: set log_bin=ON and restart/confirm the server has binlogs.
- Grant REPLICATION CLIENT (and REPLICATION SLAVE) to the connector user so SHOW MASTER STATUS returns rows.
- On MySQL 8.4+/9 verify the correct status statement is supported (SHOW BINARY LOG STATUS) — upgrade the Debezium/connector version if needed.
- If using GTID replication, ensure GTID mode is ON and consistent across the topology.
Example fix
// before (my.cnf) # skip-log-bin // after (my.cnf) log_bin=mysql-bin binlog_format=ROW binlog_row_image=FULL
Defensive patterns
Strategy: validation
Validate before calling
// Confirm binlog is on and status is readable
try (ResultSet rs = conn.createStatement().executeQuery("SHOW MASTER STATUS")) {
if (!rs.next()) throw new IllegalStateException("binlog disabled or REPLICATION CLIENT missing");
} Try / catch
try { snapshot(); } catch (IllegalStateException e) { if (e.getMessage().contains("Cannot read the binlog filename")) { /* check log_bin and grants */ } throw e; } Prevention
- Ensure log_bin=ON and binlog_format=ROW on the source server.
- Grant REPLICATION CLIENT and REPLICATION SLAVE to the CDC user.
- On MySQL 8.4+ verify connector support for SHOW BINARY LOG STATUS.
When it happens
Trigger: Executing readBinlogPosition during snapshot when the binlog status query returns an empty result — typically because binlog is disabled, the user lacks REPLICATION CLIENT/SLAVE privileges, or a GTID-only setup suppresses the expected output.
Common situations: MySQL with log_bin=OFF; managed databases where SHOW MASTER STATUS is denied; MariaDB vs MySQL version differences changing the statement's availability; missing REPLICATION CLIENT grant.
Understand the failure class
Background: Database query failed: Internal Server Error 500s wrapping SQL, Prisma, and connection failures — what to check first — this error's family across 16 libraries.
Related errors
- MySQL-CDC diagnostic: required binlog sequence {}{} is newer
- Read split %s error due to %s.
- Unexpected error while connecting to MySQL and looking at gt
- Unexpected error while connecting to MySQL and looking for b
- Unexpected error while connecting to MySQL and looking at BI
AI-assisted analysis of apache/seatunnel@cf67b549a7 (2026-09-10).
Data as JSON: /api/errors/fa36e9a267f0898f.
Report an issue: GitHub.