{"record":{"id":"22181054d34c0abc","repo":"apache/seatunnel","slug":"failed-listing-database-in-catalog-s-221810","errorCode":null,"errorMessage":"Failed listing database in catalog %s","messagePattern":"Failed listing database in catalog (.+?)","errorType":"exception","errorClass":"CatalogException","httpStatus":null,"severity":"error","filePath":"seatunnel-connectors-v2/connector-jdbc/src/main/java/org/apache/seatunnel/connectors/seatunnel/jdbc/catalog/oceanbase/OceanBaseOracleCatalog.java","lineNumber":74,"sourceCode":"    @Override\n    public boolean tableExists(TablePath tablePath) throws CatalogException {\n        try {\n            return querySQLResultExists(\n                    this.getUrlFromDatabaseName(tablePath.getDatabaseName()),\n                    getTableWithConditionSql(tablePath));\n        } catch (SQLException e) {\n            throw new SeaTunnelException(\"Failed to querySQLResult\", e);\n        }\n    }\n\n    @Override\n    public List<String> listTables(String databaseName)\n            throws CatalogException, DatabaseNotExistException {\n        String dbUrl = getUrlFromDatabaseName(databaseName);\n        try {\n            return queryString(dbUrl, getListTableSql(databaseName), this::getTableName);\n        } catch (Exception e) {\n            throw new CatalogException(\n                    String.format(\"Failed listing database in catalog %s\", catalogName), e);\n        }\n    }\n\n    @Override\n    public void createTable(\n            TablePath tablePath, CatalogTable table, boolean ignoreIfExists, boolean createIndex)\n            throws TableAlreadyExistException, DatabaseNotExistException, CatalogException {\n        checkNotNull(tablePath, \"Table path cannot be null\");\n\n        if (defaultSchema.isPresent()) {\n            tablePath =\n                    new TablePath(\n                            tablePath.getDatabaseName(),\n                            defaultSchema.get(),\n                            tablePath.getTableName());\n        }\n","sourceCodeStart":56,"sourceCodeEnd":92,"githubUrl":"https://github.com/apache/seatunnel/blob/cf67b549a7a6c35fa0beb12d83c62892427ea919/seatunnel-connectors-v2/connector-jdbc/src/main/java/org/apache/seatunnel/connectors/seatunnel/jdbc/catalog/oceanbase/OceanBaseOracleCatalog.java#L56-L92","documentation":"OceanBaseOracleCatalog.listTables wraps any failure from querying table names into CatalogException(\"Failed listing database in catalog %s\", catalogName). The message text says 'database' but the operation lists tables; the root cause is in the chained exception.","triggerScenarios":"listTables(databaseName) failing on queryString with getListTableSql — typically a connection failure, SQL error, or the database/schema not existing.","commonSituations":"Nonexistent schema name passed to listTables, expired DB session, OBProxy routing failure, permission denied on ALL_TABLES-style metadata query.","solutions":["Check the cause exception for the underlying SQL/network error","Confirm the schema (databaseName) exists and the user has visibility into it","Test the db URL produced by getUrlFromDatabaseName independently","Retry on transient connection failures"],"exampleFix":"// before\nList<String> tables = catalog.listTables(db); // CatalogException\n// after\ntry { List<String> tables = catalog.listTables(db); } catch (CatalogException e) {\n    log.error(\"listTables({}) failed: {}\", db, e.getCause());\n}","handlingStrategy":"try-catch","validationCode":"// ensure schema is reachable first\nboolean ok = !catalog.listTables(validatedSchemaName).isEmpty() || true; // or probe one known table","typeGuard":null,"tryCatchPattern":"try { catalog.listTables(db); } catch (CatalogException e) { log.error(\"cause\", e.getCause()); /* retry or fail fast */ }","preventionTips":["Confirm the schema exists and the user can see its tables","Retry transient network failures with backoff","Log the cause chain, not just the wrapper message"],"tags":["jdbc","oceanbase","sql","metadata"],"backgroundTag":"database-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"}