{"record":{"id":"fe4aea1072b39d43","repo":"apache/shardingsphere","slug":"2-fe4aea","errorCode":"2","errorMessage":"Can not load table with database name '%s' and data source name '%s'.","messagePattern":"Can not load table with database name '(.+?)' and data source name '(.+?)'\\.","errorType":"exception","errorClass":"SingleTablesLoadingException","httpStatus":null,"severity":"error","filePath":"kernel/single/core/src/main/java/org/apache/shardingsphere/single/datanode/SingleTableDataNodeLoader.java","lineNumber":237,"sourceCode":"    \n    /**\n     * Load schema table names.\n     *\n     * @param databaseName database name\n     * @param storageType storage type\n     * @param dataSource data source\n     * @param dataSourceName data source name\n     * @param includedTables included tables\n     * @param excludedTables excluded tables\n     * @return schema table names\n     * @throws SingleTablesLoadingException Single tables loading exception\n     */\n    public static Map<String, Collection<String>> loadSchemaTableNames(final String databaseName, final DatabaseType storageType, final DataSource dataSource, final String dataSourceName,\n                                                                       final Collection<String> includedTables, final Collection<String> excludedTables) {\n        try {\n            return new SchemaMetaDataLoader(storageType).loadSchemaTableNames(databaseName, dataSource, includedTables, excludedTables);\n        } catch (final SQLException ex) {\n            throw new SingleTablesLoadingException(databaseName, dataSourceName, ex);\n        }\n    }\n}\n","sourceCodeStart":219,"sourceCodeEnd":241,"githubUrl":"https://github.com/apache/shardingsphere/blob/e952770a215630a3659c75d64369168cd3e26b82/kernel/single/core/src/main/java/org/apache/shardingsphere/single/datanode/SingleTableDataNodeLoader.java#L219-L241","documentation":"SingleTableDataNodeLoader.loadSchemaTableNames delegates to SchemaMetaDataLoader to enumerate tables in one storage unit; any SQLException from that metadata scan is wrapped in SingleTablesLoadingException (XOpen SQLState GENERAL_ERROR, code 2) naming the database and data source. The original driver exception is preserved as the cause.","triggerScenarios":"During metadata loading of a single-table database: the loader connects to the given DataSource to list schemas/tables, and the driver throws — connection failure, missing privileges on information_schema/pg_catalog, unsupported catalog queries, or an unreadable metadata table.","commonSituations":"Wrong username/password or insufficient grants for metadata queries; network/firewall issues between proxy and storage; using a JDBC driver or database whose metadata queries the loader does not support; database restarted while metadata loads; connection pool exhaustion.","solutions":["Inspect getCause()/logged stack trace to see the underlying SQLException (auth, timeout, permission).","Verify connectivity and credentials from the proxy host to that data source with the same JDBC URL.","Grant the metadata user privileges to read information_schema (MySQL) or pg_catalog (PostgreSQL).","Use a database and JDBC driver version supported by ShardingSphere single-table loading; if the engine cannot be scanned, configure NOT-LOADED tables or the single-table rule explicitly."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":"try (Connection c = dataSource.getConnection(); Statement s = c.createStatement()) {\n    s.execute(\"SELECT 1\");\n    // optionally verify metadata read privilege\n    s.execute(\"SELECT 1 FROM information_schema.tables LIMIT 1\");\n} catch (SQLException e) { /* fix connectivity/privileges before adding unit */ }","typeGuard":null,"tryCatchPattern":"try {\n    SingleTableDataNodeLoader.loadSchemaTableNames(dbName, storageType, dataSource, dsName, included, excluded);\n} catch (final SingleTablesLoadingException ex) {\n    SQLException root = (SQLException) ex.getCause();\n    // branch on root: auth failure, timeout, privilege\n}","preventionTips":["Test the JDBC URL and credentials from the proxy host before registering the storage unit.","Grant information_schema/pg_catalog read privileges to the proxy user.","Keep connection pool sizes adequate for metadata scans."],"tags":["single-table","metadata","jdbc","loading"],"backgroundTag":null,"analyzedSha":"e952770a215630a3659c75d64369168cd3e26b82","analyzedAt":"2026-08-14T13:54:53.392Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}