apache/seatunnel · warning
\t skipping database '{}' due to error reading tables: {}
Error message
\t skipping database '{}' due to error reading tables: {} What it means
Postgres TableDiscoveryUtils.listTables() catches SQLException while listing tables of a database and logs it at WARN ('\t skipping database ... due to error reading tables'), then skips that database. Discovery continues with tables from other databases, so the connector may run with an incomplete captured-table set.
Source
Thrown at seatunnel-connectors-v2/connector-cdc/connector-cdc-postgres/src/main/java/org/apache/seatunnel/connectors/seatunnel/cdc/postgres/utils/TableDiscoveryUtils.java:83
"SELECT * FROM \""
+ dbName
+ "\".INFORMATION_SCHEMA.TABLES WHERE TABLE_TYPE = 'BASE TABLE';",
rs -> {
while (rs.next()) {
TableId tableId =
new TableId(
rs.getString(1), rs.getString(2), rs.getString(3));
if (tableFilters.dataCollectionFilter().isIncluded(tableId)) {
capturedTableIds.add(tableId);
LOG.info("\t including '{}' for further processing", tableId);
} else {
LOG.info("\t '{}' is filtered out of capturing", tableId);
}
}
});
} catch (SQLException e) {
// We were unable to execute the query or process the results, so skip this ...
LOG.warn(
"\t skipping database '{}' due to error reading tables: {}",
dbName,
e.getMessage());
}
}
return capturedTableIds;
}
}
View on GitHub (pinned to cf67b549a7)
Solutions
- Grant the CDC role CONNECT on the database and USAGE on the relevant schemas.
- Verify the table-path/database configuration matches existing databases the user can read.
- Test the table-listing query manually as the CDC user to reproduce the SQLException.
- Check the WARN message for the SQL error text and fix accordingly; exclude unreachable databases from table discovery config.
Defensive patterns
Strategy: validation
Validate before calling
-- run as the CDC role before job start SELECT has_database_privilege(current_user, 'mydb', 'CONNECT'); -- must be true -- and ensure schemas are usable: SELECT has_schema_privilege(current_user, 'public', 'USAGE');
Prevention
- Grant CONNECT and schema USAGE to the CDC role on every database to be discovered
- Validate table-path config points to existing, readable databases
- Treat this WARN as fatal in pipelines — verify discovered table count matches expectations
- Test table discovery manually with the same credentials
When it happens
Trigger: The query enumerating tables for a Postgres database (via JDBC DatabaseMetaData or information_schema) throws SQLException: connection error, permission denied on the database/schema, or the database is unavailable.
Common situations: CDC user lacks connect/usage privileges on a database listed in the catalog; a template/dropped database in the catalog errors during metadata reads; transient network failure during startup discovery.
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
- SQL execute error, sql:{}
- \t skipping database '{}' due to error reading tables: {}
- Error to discover tables:
- Error to discover tables: ${e.getMessage()}
- Snapshotting of table ${table.id()} failed
AI-assisted analysis of apache/seatunnel@cf67b549a7 (2026-09-10).
Data as JSON: /api/errors/389169d57513c864.
Report an issue: GitHub.