apache/seatunnel · error · DatabaseNotExistException

DatabaseNotExistException: database '${databaseName}' does n

Error message

DatabaseNotExistException: database '${databaseName}' does not exist in catalog '${catalogName}'

What it means

Thrown by HbaseCatalog.listTables when the requested database (HBase namespace) does not exist. HBase maps SeaTunnel 'databases' to namespaces; if the namespace is absent the catalog refuses and reports DatabaseNotExistException.

Source

Thrown at seatunnel-connectors-v2/connector-hbase/src/main/java/org/apache/seatunnel/connectors/seatunnel/hbase/catalog/HbaseCatalog.java:99

    public String getDefaultDatabase() throws CatalogException {
        return defaultDatabase;
    }

    @Override
    public boolean databaseExists(String databaseName) throws CatalogException {
        return hbaseClient.databaseExists(databaseName);
    }

    @Override
    public List<String> listDatabases() throws CatalogException {
        return hbaseClient.listDatabases();
    }

    @Override
    public List<String> listTables(String databaseName)
            throws CatalogException, DatabaseNotExistException {
        if (!databaseExists(databaseName)) {
            throw new DatabaseNotExistException(catalogName, databaseName);
        }
        return hbaseClient.listTables(databaseName);
    }

    @Override
    public boolean tableExists(TablePath tablePath) throws CatalogException {
        checkNotNull(tablePath);
        String databaseName = tablePath.getDatabaseName();
        String tableName = tablePath.getTableName();
        String fullTableName =
                (databaseName == null || databaseName.isEmpty())
                        ? tableName
                        : databaseName + ":" + tableName;
        return hbaseClient.tableExists(fullTableName);
    }

    @Override
    public CatalogTable getTable(TablePath tablePath)

View on GitHub (pinned to cf67b549a7)

Solutions

  1. Create the namespace first (HBase shell: create_namespace 'my_ns', or catalog.createDatabase).
  2. Check the exact namespace name spelling and case in the config.
  3. Run list_namespaces in the HBase shell to confirm what exists.

Example fix

// before
catalog.listTables("MyNS"); // namespace is actually 'myns'
// after
if (!catalog.databaseExists("myns")) {
    catalog.createDatabase(TablePath.of("myns"), false);
}
catalog.listTables("myns");
Defensive patterns

Strategy: try-catch

Validate before calling

if (!catalog.databaseExists(databaseName)) {
    catalog.createDatabase(TablePath.of(databaseName), true); // ensure namespace first
}

Try / catch

try {
    tables = catalog.listTables(databaseName);
} catch (DatabaseNotExistException e) {
    LOG.warn("Namespace {} missing; creating it", databaseName);
    catalog.createDatabase(TablePath.of(databaseName), true);
    tables = catalog.listTables(databaseName);
}

Prevention

When it happens

Trigger: Calling listTables(databaseName) (directly or via catalog/table discovery) where databaseExists(databaseName) returns false because the HBase namespace was never created or is misnamed.

Common situations: Namespace deleted by an admin or another job; typo in database/namespace name in config; case-sensitivity mismatch (HBase namespaces are case-sensitive); assuming the 'default' namespace under a different name.

Understand the failure class

Background: 'Could not be found', 'does not exist', 'not found in database': the resource-not-found family when an ID, slug, key, or URI lookup comes back empty — this error's family across 20 libraries.

Related errors


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