{"record":{"id":"fc3c8ffda24d4b10","repo":"apache/seatunnel","slug":"database-databasename-does-not-exist-in-catalog-fc3c8f","errorCode":null,"errorMessage":"Database ${databaseName} does not exist in catalog ${catalogName}","messagePattern":"Database (.+?) does not exist in catalog (.+?)","errorType":"exception","errorClass":"DatabaseNotExistException","httpStatus":null,"severity":"error","filePath":"seatunnel-connectors-v2/connector-paimon/src/main/java/org/apache/seatunnel/connectors/seatunnel/paimon/catalog/PaimonCatalog.java","lineNumber":125,"sourceCode":"\n    @Override\n    public boolean databaseExists(String databaseName) throws CatalogException {\n        List<String> listDatabases = catalog.listDatabases();\n        return listDatabases.contains(databaseName);\n    }\n\n    @Override\n    public List<String> listDatabases() throws CatalogException {\n        return catalog.listDatabases();\n    }\n\n    @Override\n    public List<String> listTables(String databaseName)\n            throws CatalogException, DatabaseNotExistException {\n        try {\n            return catalog.listTables(databaseName);\n        } catch (org.apache.paimon.catalog.Catalog.DatabaseNotExistException e) {\n            throw new DatabaseNotExistException(this.catalogName, databaseName);\n        }\n    }\n\n    @Override\n    public boolean tableExists(TablePath tablePath) throws CatalogException {\n        Identifier identifier = toIdentifier(tablePath);\n        List<String> tables = new ArrayList<>();\n        try {\n            if (databaseExists(identifier.getDatabaseName())) {\n                tables = catalog.listTables(identifier.getDatabaseName());\n            }\n        } catch (org.apache.paimon.catalog.Catalog.DatabaseNotExistException e) {\n            return false;\n        }\n        return tables.contains(identifier.getTableName());\n    }\n\n    @Override","sourceCodeStart":107,"sourceCodeEnd":143,"githubUrl":"https://github.com/apache/seatunnel/blob/cf67b549a7a6c35fa0beb12d83c62892427ea919/seatunnel-connectors-v2/connector-paimon/src/main/java/org/apache/seatunnel/connectors/seatunnel/paimon/catalog/PaimonCatalog.java#L107-L143","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","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."],"exampleFix":"// before\ncatalog.listTables(\"Db1\"); // actual database is \"db1\"\n// after\nif (catalog.databaseExists(\"db1\")) {\n    catalog.listTables(\"db1\");\n}","handlingStrategy":"try-catch","validationCode":"if (catalog.databaseExists(TablePath.of(databaseName, \"x\")) == false) {\n    throw new IllegalArgumentException(\"Database not found: \" + databaseName);\n}\ncatalog.listTables(databaseName);","typeGuard":null,"tryCatchPattern":"try {\n    tables = catalog.listTables(databaseName);\n} catch (DatabaseNotExistException e) {\n    LOG.warn(\"Paimon database {} not in catalog {}; check warehouse config\", databaseName, catalogName);\n    tables = Collections.emptyList();\n}","preventionTips":["Validate database names with databaseExists before listing.","Keep warehouse/metastore URIs consistent across environments.","Use exact, case-matched names from the Paimon catalog."],"tags":["paimon","catalog","database-not-exist"],"backgroundTag":"resource-not-found","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"}