apache/seatunnel · warning
\t skipping database '{}' due to error reading tables: {}
Error message
\t skipping database '{}' due to error reading tables: {} What it means
This is a WARN (not a throw) in Debezium's MySqlSnapshotChangeEventSource.getAllTableIds: when reading the list of tables of a database via JDBC raises SQLException, that database is skipped and logged. The snapshot proceeds with the remaining readable databases, potentially silently excluding tables.
Source
Thrown at seatunnel-connectors-v2/connector-cdc/connector-cdc-mysql/src/main/java/io/debezium/connector/mysql/MySqlSnapshotChangeEventSource.java:177
LOGGER.info("Read list of available tables in each database");
final Set<TableId> tableIds = new HashSet<>();
final Set<String> readableDatabaseNames = new HashSet<>();
for (String dbName : databaseNames) {
try {
// MySQL sometimes considers some local files as databases (see DBZ-164),
// so we will simply try each one and ignore the problematic ones ...
connection.query(
"SHOW FULL TABLES IN " + quote(dbName) + " where Table_Type = 'BASE TABLE'",
rs -> {
while (rs.next()) {
TableId id = new TableId(dbName, null, rs.getString(1));
tableIds.add(id);
}
});
readableDatabaseNames.add(dbName);
} catch (SQLException e) {
// We were unable to execute the query or process the results, so skip this ...
LOGGER.warn(
"\t skipping database '{}' due to error reading tables: {}",
dbName,
e.getMessage());
}
}
final Set<String> includedDatabaseNames =
readableDatabaseNames.stream()
.filter(filters.databaseFilter())
.collect(Collectors.toSet());
LOGGER.info("\tsnapshot continuing with database(s): {}", includedDatabaseNames);
return tableIds;
}
@Override
protected void lockTablesForSchemaSnapshot(
ChangeEventSourceContext sourceContext,
RelationalSnapshotContext<MySqlPartition, MySqlOffsetContext> snapshotContext)
throws SQLException, InterruptedException {View on GitHub (pinned to cf67b549a7)
Solutions
- Grant the CDC user privileges on the skipped database (SELECT, and SHOW VIEW if views) and rerun the snapshot.
- Verify the database still exists and is spelled correctly in table include/exclude lists.
- Check DB server error log around the time for the underlying SQLException details.
- If the skip is expected (unrelated schemas), silence by adjusting table include lists so the database isn't enumerated.
- Fix connectivity issues (timeouts, max_connections) if the error is transient.
Example fix
-- before GRANT SELECT ON db1.* TO 'cdc'@'%'; -- after (include the skipped schema) GRANT SELECT ON db1.* TO 'cdc'@'%'; GRANT SELECT ON db2.* TO 'cdc'@'%';
Defensive patterns
Strategy: validation
Validate before calling
-- verify grants before snapshot SELECT SCHEMA_NAME FROM information_schema.schemata; SHOW GRANTS FOR CURRENT_USER;
Prevention
- Grant the CDC user SELECT on every schema expected to be captured
- Confirm databases in table lists exist before starting the snapshot
- Watch snapshot logs for 'skipping database' warnings and verify table coverage afterward
- Keep include/exclude lists tight so only intended schemas are enumerated
When it happens
Trigger: During snapshot split enumeration, executing the SHOW TABLES / information_schema query for a specific database fails — e.g. permission denied for that schema, the database was dropped mid-snapshot, or connection error on that statement.
Common situations: CDC user lacking SELECT/SHOW privileges on particular schemas; database removed between listing and reading; corrupted catalog; partial connectivity issues.
Understand the failure class
Background: Permission denied / not authorized / 403 Forbidden: access-control rejections when the caller lacks the required role, grant, or ownership — this error's family across 18 libraries.
Related errors
- \t skipping database '{}' due to error reading tables: {}
- Snapshot is using user '{}' but it likely doesn't have prope
- Cannot read the binlog filename and position via '<showMaste
- Interrupted while emitting initial DROP TABLE events
- User does not have the 'LOCK TABLES' privilege required to o
AI-assisted analysis of apache/seatunnel@cf67b549a7 (2026-09-10).
Data as JSON: /api/errors/6830aa7f9fbee9ad.
Report an issue: GitHub.