apache/seatunnel · error · DatabaseNotExistException
Database ${databaseName} does not exist in catalog ${catalog
Error message
Database ${databaseName} does not exist in catalog ${catalogName} What it means
PaimonCatalog.listTables translates Paimon's native Catalog.DatabaseNotExistException into SeaTunnel's DatabaseNotExistException, reporting that the requested database does not exist in this catalog. It is a standard catalog-API error so callers can distinguish a missing database from other failures.
Source
Thrown at seatunnel-connectors-v2/connector-paimon/src/main/java/org/apache/seatunnel/connectors/seatunnel/paimon/catalog/PaimonCatalog.java:125
@Override
public boolean databaseExists(String databaseName) throws CatalogException {
List<String> listDatabases = catalog.listDatabases();
return listDatabases.contains(databaseName);
}
@Override
public List<String> listDatabases() throws CatalogException {
return catalog.listDatabases();
}
@Override
public List<String> listTables(String databaseName)
throws CatalogException, DatabaseNotExistException {
try {
return catalog.listTables(databaseName);
} catch (org.apache.paimon.catalog.Catalog.DatabaseNotExistException e) {
throw new DatabaseNotExistException(this.catalogName, databaseName);
}
}
@Override
public boolean tableExists(TablePath tablePath) throws CatalogException {
Identifier identifier = toIdentifier(tablePath);
List<String> tables = new ArrayList<>();
try {
if (databaseExists(identifier.getDatabaseName())) {
tables = catalog.listTables(identifier.getDatabaseName());
}
} catch (org.apache.paimon.catalog.Catalog.DatabaseNotExistException e) {
return false;
}
return tables.contains(identifier.getTableName());
}
@OverrideView on GitHub (pinned to cf67b549a7)
Solutions
- Verify the database name spelling and case against the actual Paimon catalog.
- Check the catalog's warehouse/metastore config points to the environment that really holds the database.
- Create the database first (createDatabase or via Paimon/Spark/Flink SQL) before listing its tables.
- Guard with databaseExists(databaseName) before calling listTables.
Example fix
// before
catalog.listTables("Db1"); // actual database is "db1"
// after
if (catalog.databaseExists("db1")) {
catalog.listTables("db1");
} Defensive patterns
Strategy: try-catch
Validate before calling
if (catalog.databaseExists(TablePath.of(databaseName, "x")) == false) {
throw new IllegalArgumentException("Database not found: " + databaseName);
}
catalog.listTables(databaseName); Try / catch
try {
tables = catalog.listTables(databaseName);
} catch (DatabaseNotExistException e) {
LOG.warn("Paimon database {} not in catalog {}; check warehouse config", databaseName, catalogName);
tables = Collections.emptyList();
} Prevention
- Validate database names with databaseExists before listing.
- Keep warehouse/metastore URIs consistent across environments.
- Use exact, case-matched names from the Paimon catalog.
When it happens
Trigger: Calling listTables(databaseName) when the Paimon underlying catalog (filesystem/Hive/Glue, etc.) has no database with that exact name — case-sensitive name mismatch or wrong warehouse/warehouse path configured.
Common situations: Typo or case mismatch in the database name in the job config, warehouse or metastore URI pointing to a different Paimon warehouse, database dropped by another job, or using a catalog that was never initialized with the database.
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
- DatabaseNotExistException: catalogName, databaseName
- Database ${databaseName} does not exist in catalog hive
- Database 'null' does not exist in catalog 'null'
- Database ${databaseName} does not exist in catalog ${name()}
- Database ${tablePath.getDatabaseName()} does not exist in ca
AI-assisted analysis of apache/seatunnel@cf67b549a7 (2026-09-10).
Data as JSON: /api/errors/fc3c8ffda24d4b10.
Report an issue: GitHub.