apache/seatunnel · error · CatalogException

Failed listing database in catalog %s

Error message

Failed listing database in catalog %s

What it means

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.

Source

Thrown at seatunnel-connectors-v2/connector-jdbc/src/main/java/org/apache/seatunnel/connectors/seatunnel/jdbc/catalog/oceanbase/OceanBaseOracleCatalog.java:74

    @Override
    public boolean tableExists(TablePath tablePath) throws CatalogException {
        try {
            return querySQLResultExists(
                    this.getUrlFromDatabaseName(tablePath.getDatabaseName()),
                    getTableWithConditionSql(tablePath));
        } catch (SQLException e) {
            throw new SeaTunnelException("Failed to querySQLResult", e);
        }
    }

    @Override
    public List<String> listTables(String databaseName)
            throws CatalogException, DatabaseNotExistException {
        String dbUrl = getUrlFromDatabaseName(databaseName);
        try {
            return queryString(dbUrl, getListTableSql(databaseName), this::getTableName);
        } catch (Exception e) {
            throw new CatalogException(
                    String.format("Failed listing database in catalog %s", catalogName), e);
        }
    }

    @Override
    public void createTable(
            TablePath tablePath, CatalogTable table, boolean ignoreIfExists, boolean createIndex)
            throws TableAlreadyExistException, DatabaseNotExistException, CatalogException {
        checkNotNull(tablePath, "Table path cannot be null");

        if (defaultSchema.isPresent()) {
            tablePath =
                    new TablePath(
                            tablePath.getDatabaseName(),
                            defaultSchema.get(),
                            tablePath.getTableName());
        }

View on GitHub (pinned to cf67b549a7)

Solutions

  1. Check the cause exception for the underlying SQL/network error
  2. Confirm the schema (databaseName) exists and the user has visibility into it
  3. Test the db URL produced by getUrlFromDatabaseName independently
  4. Retry on transient connection failures

Example fix

// before
List<String> tables = catalog.listTables(db); // CatalogException
// after
try { List<String> tables = catalog.listTables(db); } catch (CatalogException e) {
    log.error("listTables({}) failed: {}", db, e.getCause());
}
Defensive patterns

Strategy: try-catch

Validate before calling

// ensure schema is reachable first
boolean ok = !catalog.listTables(validatedSchemaName).isEmpty() || true; // or probe one known table

Try / catch

try { catalog.listTables(db); } catch (CatalogException e) { log.error("cause", e.getCause()); /* retry or fail fast */ }

Prevention

When it happens

Trigger: listTables(databaseName) failing on queryString with getListTableSql — typically a connection failure, SQL error, or the database/schema not existing.

Common situations: Nonexistent schema name passed to listTables, expired DB session, OBProxy routing failure, permission denied on ALL_TABLES-style metadata query.

Understand the failure class

Background: Database query failed: Internal Server Error 500s wrapping SQL, Prisma, and connection failures — what to check first — this error's family across 16 libraries.

Related errors


AI-assisted analysis of apache/seatunnel@cf67b549a7 (2026-09-10). Data as JSON: /api/errors/22181054d34c0abc. Report an issue: GitHub.