{"record":{"id":"941de04560978dc5","repo":"apache/seatunnel","slug":"databasenotexistexception-database-databasenam","errorCode":null,"errorMessage":"DatabaseNotExistException: database '${databaseName}' does not exist in catalog '${catalogName}'","messagePattern":"DatabaseNotExistException: database '(.+?)' does not exist in catalog '(.+?)'","errorType":"exception","errorClass":"DatabaseNotExistException","httpStatus":null,"severity":"error","filePath":"seatunnel-connectors-v2/connector-hbase/src/main/java/org/apache/seatunnel/connectors/seatunnel/hbase/catalog/HbaseCatalog.java","lineNumber":99,"sourceCode":"    public String getDefaultDatabase() throws CatalogException {\n        return defaultDatabase;\n    }\n\n    @Override\n    public boolean databaseExists(String databaseName) throws CatalogException {\n        return hbaseClient.databaseExists(databaseName);\n    }\n\n    @Override\n    public List<String> listDatabases() throws CatalogException {\n        return hbaseClient.listDatabases();\n    }\n\n    @Override\n    public List<String> listTables(String databaseName)\n            throws CatalogException, DatabaseNotExistException {\n        if (!databaseExists(databaseName)) {\n            throw new DatabaseNotExistException(catalogName, databaseName);\n        }\n        return hbaseClient.listTables(databaseName);\n    }\n\n    @Override\n    public boolean tableExists(TablePath tablePath) throws CatalogException {\n        checkNotNull(tablePath);\n        String databaseName = tablePath.getDatabaseName();\n        String tableName = tablePath.getTableName();\n        String fullTableName =\n                (databaseName == null || databaseName.isEmpty())\n                        ? tableName\n                        : databaseName + \":\" + tableName;\n        return hbaseClient.tableExists(fullTableName);\n    }\n\n    @Override\n    public CatalogTable getTable(TablePath tablePath)","sourceCodeStart":81,"sourceCodeEnd":117,"githubUrl":"https://github.com/apache/seatunnel/blob/cf67b549a7a6c35fa0beb12d83c62892427ea919/seatunnel-connectors-v2/connector-hbase/src/main/java/org/apache/seatunnel/connectors/seatunnel/hbase/catalog/HbaseCatalog.java#L81-L117","documentation":"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.","triggerScenarios":"Calling listTables(databaseName) (directly or via catalog/table discovery) where databaseExists(databaseName) returns false because the HBase namespace was never created or is misnamed.","commonSituations":"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.","solutions":["Create the namespace first (HBase shell: create_namespace 'my_ns', or catalog.createDatabase).","Check the exact namespace name spelling and case in the config.","Run list_namespaces in the HBase shell to confirm what exists."],"exampleFix":"// before\ncatalog.listTables(\"MyNS\"); // namespace is actually 'myns'\n// after\nif (!catalog.databaseExists(\"myns\")) {\n    catalog.createDatabase(TablePath.of(\"myns\"), false);\n}\ncatalog.listTables(\"myns\");","handlingStrategy":"try-catch","validationCode":"if (!catalog.databaseExists(databaseName)) {\n    catalog.createDatabase(TablePath.of(databaseName), true); // ensure namespace first\n}","typeGuard":null,"tryCatchPattern":"try {\n    tables = catalog.listTables(databaseName);\n} catch (DatabaseNotExistException e) {\n    LOG.warn(\"Namespace {} missing; creating it\", databaseName);\n    catalog.createDatabase(TablePath.of(databaseName), true);\n    tables = catalog.listTables(databaseName);\n}","preventionTips":["Create HBase namespaces before jobs that reference them.","Match namespace name and case exactly (HBase is case-sensitive).","Use catalog.databaseExists as a preflight check.","Document namespace ownership to avoid external deletion."],"tags":["hbase","catalog","namespace"],"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-14T11:17:12.474Z"}