{"record":{"id":"e6b4f894fd458812","repo":"apache/seatunnel","slug":"database-databasename-does-not-exist-in-catalog-e6b4f8","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-hudi/src/main/java/org/apache/seatunnel/connectors/seatunnel/hudi/catalog/HudiCatalog.java","lineNumber":148,"sourceCode":"\n    @Override\n    public List<String> listDatabases() throws CatalogException {\n        try {\n            FileStatus[] fileStatuses = fs.listStatus(tableParentDfsPath);\n            return Arrays.stream(fileStatuses)\n                    .filter(FileStatus::isDirectory)\n                    .map(fileStatus -> fileStatus.getPath().getName())\n                    .collect(Collectors.toList());\n        } catch (IOException e) {\n            throw new CatalogException(\"Listing database exception.\", e);\n        }\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\n        Path dbPath = new Path(tableParentDfsPath, databaseName);\n        try {\n            return Arrays.stream(fs.listStatus(dbPath))\n                    .filter(FileStatus::isDirectory)\n                    .map(fileStatus -> fileStatus.getPath().getName())\n                    .collect(Collectors.toList());\n        } catch (IOException e) {\n            throw new CatalogException(\n                    String.format(\"Listing table in database %s exception.\", dbPath), e);\n        }\n    }\n\n    @Override\n    public boolean tableExists(TablePath tablePath) throws CatalogException {\n        String basePath = inferTablePath(tableParentDfsPathStr, tablePath);\n        try {","sourceCodeStart":130,"sourceCodeEnd":166,"githubUrl":"https://github.com/apache/seatunnel/blob/cf67b549a7a6c35fa0beb12d83c62892427ea919/seatunnel-connectors-v2/connector-hudi/src/main/java/org/apache/seatunnel/connectors/seatunnel/hudi/catalog/HudiCatalog.java#L130-L166","documentation":"HudiCatalog.listTables first verifies the requested database exists (as a subdirectory under the catalog path). If databaseExists returns false, it throws DatabaseNotExistException naming the catalog and database. This is SeaTunnel's standard signal that the namespace portion of a table path does not exist.","triggerScenarios":"Calling listTables(databaseName) where no directory named databaseName exists under tableParentDfsPath — database never created, name misspelled, wrong warehouse path configured, or different case than on disk.","commonSituations":"Typo in database name in the table config; database dropped by another process; pointing the catalog at a different warehouse than the one containing the database; case sensitivity mismatch on a case-sensitive filesystem.","solutions":["Verify the database directory exists under the configured warehouse path (hdfs dfs -ls <warehouse>).","Correct the database name spelling/case in the table path configuration.","Create the database first via catalog.createDatabase or manually create the directory.","Ensure the catalog warehouse path points to the filesystem location that actually contains the database.","Run listDatabases() to see the names that do exist and match against them."],"exampleFix":"// before\ncatalog.listTables(\"MyDB\"); // directory is 'mydb'\n// after\ncatalog.listTables(\"mydb\");","handlingStrategy":"try-catch","validationCode":"if (!catalog.databaseExists(databaseName)) {\n    // fail fast or create the database before calling listTables\n    catalog.createDatabase(databaseName, false);\n}","typeGuard":null,"tryCatchPattern":"try {\n    List<String> tables = catalog.listTables(databaseName);\n} catch (DatabaseNotExistException e) {\n    // e.getDatabase() tells you the missing namespace\n    throw new IllegalStateException(\"Database '\" + databaseName + \"' not found in catalog; existing: \" + catalog.listDatabases(), e);\n}","preventionTips":["Verify database names against listDatabases() before referencing them in table paths.","Watch for case-sensitivity mismatches between config values and filesystem directories.","Use one shared warehouse path across jobs so databases are where the catalog expects."],"tags":["catalog","hudi","not-found","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"}