{"record":{"id":"389169d57513c864","repo":"apache/seatunnel","slug":"t-skipping-database-due-to-error-reading-tab-389169","errorCode":null,"errorMessage":"\\t skipping database '{}' due to error reading tables: {}","messagePattern":"\\\\t skipping database '(.+?)' due to error reading tables: (.+?)","errorType":"console","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"seatunnel-connectors-v2/connector-cdc/connector-cdc-postgres/src/main/java/org/apache/seatunnel/connectors/seatunnel/cdc/postgres/utils/TableDiscoveryUtils.java","lineNumber":83,"sourceCode":"                        \"SELECT * FROM \\\"\"\n                                + dbName\n                                + \"\\\".INFORMATION_SCHEMA.TABLES WHERE TABLE_TYPE = 'BASE TABLE';\",\n                        rs -> {\n                            while (rs.next()) {\n                                TableId tableId =\n                                        new TableId(\n                                                rs.getString(1), rs.getString(2), rs.getString(3));\n                                if (tableFilters.dataCollectionFilter().isIncluded(tableId)) {\n                                    capturedTableIds.add(tableId);\n                                    LOG.info(\"\\t including '{}' for further processing\", tableId);\n                                } else {\n                                    LOG.info(\"\\t '{}' is filtered out of capturing\", tableId);\n                                }\n                            }\n                        });\n            } catch (SQLException e) {\n                // We were unable to execute the query or process the results, so skip this ...\n                LOG.warn(\n                        \"\\t skipping database '{}' due to error reading tables: {}\",\n                        dbName,\n                        e.getMessage());\n            }\n        }\n        return capturedTableIds;\n    }\n}\n","sourceCodeStart":65,"sourceCodeEnd":92,"githubUrl":"https://github.com/apache/seatunnel/blob/cf67b549a7a6c35fa0beb12d83c62892427ea919/seatunnel-connectors-v2/connector-cdc/connector-cdc-postgres/src/main/java/org/apache/seatunnel/connectors/seatunnel/cdc/postgres/utils/TableDiscoveryUtils.java#L65-L92","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","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."],"exampleFix":null,"handlingStrategy":"validation","validationCode":"-- run as the CDC role before job start\nSELECT has_database_privilege(current_user, 'mydb', 'CONNECT'); -- must be true\n-- and ensure schemas are usable:\nSELECT has_schema_privilege(current_user, 'public', 'USAGE');","typeGuard":null,"tryCatchPattern":null,"preventionTips":["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"],"tags":["cdc","postgres","table-discovery","sql","swallowed-exception"],"backgroundTag":"sql-query-failed","analyzedSha":"cf67b549a7a6c35fa0beb12d83c62892427ea919","analyzedAt":"2026-09-10T21:44:55.265Z","contentChangedAt":"2026-09-10T21:44:55.265Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}