{"record":{"id":"6830aa7f9fbee9ad","repo":"apache/seatunnel","slug":"t-skipping-database-due-to-error-reading-tab","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-mysql/src/main/java/io/debezium/connector/mysql/MySqlSnapshotChangeEventSource.java","lineNumber":177,"sourceCode":"        LOGGER.info(\"Read list of available tables in each database\");\n        final Set<TableId> tableIds = new HashSet<>();\n        final Set<String> readableDatabaseNames = new HashSet<>();\n        for (String dbName : databaseNames) {\n            try {\n                // MySQL sometimes considers some local files as databases (see DBZ-164),\n                // so we will simply try each one and ignore the problematic ones ...\n                connection.query(\n                        \"SHOW FULL TABLES IN \" + quote(dbName) + \" where Table_Type = 'BASE TABLE'\",\n                        rs -> {\n                            while (rs.next()) {\n                                TableId id = new TableId(dbName, null, rs.getString(1));\n                                tableIds.add(id);\n                            }\n                        });\n                readableDatabaseNames.add(dbName);\n            } catch (SQLException e) {\n                // We were unable to execute the query or process the results, so skip this ...\n                LOGGER.warn(\n                        \"\\t skipping database '{}' due to error reading tables: {}\",\n                        dbName,\n                        e.getMessage());\n            }\n        }\n        final Set<String> includedDatabaseNames =\n                readableDatabaseNames.stream()\n                        .filter(filters.databaseFilter())\n                        .collect(Collectors.toSet());\n        LOGGER.info(\"\\tsnapshot continuing with database(s): {}\", includedDatabaseNames);\n        return tableIds;\n    }\n\n    @Override\n    protected void lockTablesForSchemaSnapshot(\n            ChangeEventSourceContext sourceContext,\n            RelationalSnapshotContext<MySqlPartition, MySqlOffsetContext> snapshotContext)\n            throws SQLException, InterruptedException {","sourceCodeStart":159,"sourceCodeEnd":195,"githubUrl":"https://github.com/apache/seatunnel/blob/cf67b549a7a6c35fa0beb12d83c62892427ea919/seatunnel-connectors-v2/connector-cdc/connector-cdc-mysql/src/main/java/io/debezium/connector/mysql/MySqlSnapshotChangeEventSource.java#L159-L195","documentation":"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.","triggerScenarios":"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.","commonSituations":"CDC user lacking SELECT/SHOW privileges on particular schemas; database removed between listing and reading; corrupted catalog; partial connectivity issues.","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."],"exampleFix":"-- before\nGRANT SELECT ON db1.* TO 'cdc'@'%';\n-- after (include the skipped schema)\nGRANT SELECT ON db1.* TO 'cdc'@'%';\nGRANT SELECT ON db2.* TO 'cdc'@'%';","handlingStrategy":"validation","validationCode":"-- verify grants before snapshot\nSELECT SCHEMA_NAME FROM information_schema.schemata;\nSHOW GRANTS FOR CURRENT_USER;","typeGuard":null,"tryCatchPattern":null,"preventionTips":["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"],"tags":["cdc","mysql","snapshot","permissions"],"backgroundTag":"permission-denied","analyzedSha":"cf67b549a7a6c35fa0beb12d83c62892427ea919","analyzedAt":"2026-09-10T21:44:55.265Z","contentChangedAt":"2026-09-10T21:44:55.265Z","schemaVersion":2},"datasetVersion":"2026-09-14T11:17:12.474Z"}