{"record":{"id":"002d9957cf316b17","repo":"apache/seatunnel","slug":"creating-database-s-exception","errorCode":null,"errorMessage":"Creating database %s exception.","messagePattern":"Creating database (.+?) exception\\.","errorType":"exception","errorClass":"CatalogException","httpStatus":null,"severity":"error","filePath":"seatunnel-connectors-v2/connector-hudi/src/main/java/org/apache/seatunnel/connectors/seatunnel/hudi/catalog/HudiCatalog.java","lineNumber":290,"sourceCode":"        throw new UnsupportedOperationException(\"Hudi catalog not support truncate table.\");\n    }\n\n    @Override\n    public void createDatabase(TablePath tablePath, boolean ignoreIfExists)\n            throws DatabaseAlreadyExistException, CatalogException {\n        if (databaseExists(tablePath.getDatabaseName())) {\n            if (ignoreIfExists) {\n                return;\n            } else {\n                throw new DatabaseAlreadyExistException(catalogName, tablePath.getDatabaseName());\n            }\n        }\n\n        Path dbPath = new Path(tableParentDfsPath, tablePath.getDatabaseName());\n        try {\n            fs.mkdirs(dbPath);\n        } catch (IOException e) {\n            throw new CatalogException(\n                    String.format(\"Creating database %s exception.\", tablePath.getDatabaseName()),\n                    e);\n        }\n    }\n\n    @Override\n    public void dropDatabase(TablePath tablePath, boolean ignoreIfNotExists)\n            throws DatabaseNotExistException, CatalogException {\n        // do nothing\n        if (!databaseExists(tablePath.getDatabaseName())) {\n            if (ignoreIfNotExists) {\n                return;\n            } else {\n                throw new DatabaseNotExistException(catalogName, tablePath.getDatabaseName());\n            }\n        }\n\n        List<String> tables = listTables(tablePath.getDatabaseName());","sourceCodeStart":272,"sourceCodeEnd":308,"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#L272-L308","documentation":"Thrown by HudiCatalog.createDatabase when creating the database directory on the underlying filesystem (mkdirs on the derived DFS path) fails with an IOException, after the existence checks already passed.","triggerScenarios":"Calling createDatabase (also reached via catalog.open()) when the parent DFS path is not writable, the storage is unreachable, or the path already exists as a file.","commonSituations":"Permission denied for the connector user on table_parent_dfs_path; HDFS in safemode; cloud storage credentials/endpoint misconfiguration; table_parent_dfs_path points to a file instead of a directory.","solutions":["Grant the connector user write permission on table_parent_dfs_path.","Verify storage connectivity/credentials and retry after fixing.","Ensure table_parent_dfs_path is an existing directory, not a file.","Check the wrapped IOException cause in the stack trace for the concrete error."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":"// Java\nPath root = new Path(tableParentDfsPath);\nFileSystem fs = root.getFileSystem(conf);\nif (!fs.exists(root) || !fs.getFileStatus(root).isDirectory()) {\n    throw new IllegalStateException(\"table_parent_dfs_path must be an existing directory\");\n}","typeGuard":null,"tryCatchPattern":"// Java\ntry {\n    catalog.createDatabase(tablePath, false);\n} catch (CatalogException e) {\n    if (e.getCause() instanceof IOException) {\n        // permissions / storage health; fix then retry\n    }\n    throw e;\n}","preventionTips":["Ensure table_parent_dfs_path exists, is a directory, and is writable by the job user.","Fix HDFS/cloud credentials before job submission.","Avoid pointing the parent path at a file.","Watch for HDFS safemode during cluster startup."],"tags":["hadoop","mkdir","io","permission"],"backgroundTag":"mkdir-permission-denied","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"}