apache/seatunnel · warning

\t skipping database '{}' due to error reading tables: {}

Error message

\t skipping database '{}' due to error reading tables: {}

What it means

SQL Server TableDiscoveryUtils.listTables() catches SQLException when reading table metadata for a database and logs it at WARN ('\t skipping database ... due to error reading tables'), skipping that database. The job continues with a possibly incomplete table list, which can silently miss tables you expect to capture.

Source

Thrown at seatunnel-connectors-v2/connector-cdc/connector-cdc-sqlserver/src/main/java/org/apache/seatunnel/connectors/seatunnel/cdc/sqlserver/utils/TableDiscoveryUtils.java:84

                        "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.debug("\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

  1. Grant the CDC login the needed permissions (VIEW DEFINITION / access to catalog views) on the target databases.
  2. Confirm all configured databases are ONLINE and readable by the CDC user.
  3. Run the table-listing query manually with the CDC login to see the real SQLException.
  4. Check the WARN text for the SQL error and either fix the cause or remove the problematic database from discovery scope.
Defensive patterns

Strategy: validation

Validate before calling

-- verify as the CDC login before job start
SELECT name, state, HAS_DBACCESS(name) AS accessible
FROM sys.databases;  -- filter for databases you expect to discover

Prevention

When it happens

Trigger: The metadata query listing tables of a SQL Server database fails with SQLException: login lacks VIEW DEFINITION/SELECT on catalog views, database offline or inaccessible, or transient connection failure during discovery.

Common situations: CDC login missing permissions on sys tables of some database; a database in the instance is in restoring/offline state; network instability at job start.

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/9b408bb6310b30c9. Report an issue: GitHub.