apache/seatunnel · error · CatalogException

Creating database %s exception.

Error message

Creating database %s exception.

What it means

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.

Source

Thrown at seatunnel-connectors-v2/connector-hudi/src/main/java/org/apache/seatunnel/connectors/seatunnel/hudi/catalog/HudiCatalog.java:290

        throw new UnsupportedOperationException("Hudi catalog not support truncate table.");
    }

    @Override
    public void createDatabase(TablePath tablePath, boolean ignoreIfExists)
            throws DatabaseAlreadyExistException, CatalogException {
        if (databaseExists(tablePath.getDatabaseName())) {
            if (ignoreIfExists) {
                return;
            } else {
                throw new DatabaseAlreadyExistException(catalogName, tablePath.getDatabaseName());
            }
        }

        Path dbPath = new Path(tableParentDfsPath, tablePath.getDatabaseName());
        try {
            fs.mkdirs(dbPath);
        } catch (IOException e) {
            throw new CatalogException(
                    String.format("Creating database %s exception.", tablePath.getDatabaseName()),
                    e);
        }
    }

    @Override
    public void dropDatabase(TablePath tablePath, boolean ignoreIfNotExists)
            throws DatabaseNotExistException, CatalogException {
        // do nothing
        if (!databaseExists(tablePath.getDatabaseName())) {
            if (ignoreIfNotExists) {
                return;
            } else {
                throw new DatabaseNotExistException(catalogName, tablePath.getDatabaseName());
            }
        }

        List<String> tables = listTables(tablePath.getDatabaseName());

View on GitHub (pinned to cf67b549a7)

Solutions

  1. Grant the connector user write permission on table_parent_dfs_path.
  2. Verify storage connectivity/credentials and retry after fixing.
  3. Ensure table_parent_dfs_path is an existing directory, not a file.
  4. Check the wrapped IOException cause in the stack trace for the concrete error.
Defensive patterns

Strategy: try-catch

Validate before calling

// Java
Path root = new Path(tableParentDfsPath);
FileSystem fs = root.getFileSystem(conf);
if (!fs.exists(root) || !fs.getFileStatus(root).isDirectory()) {
    throw new IllegalStateException("table_parent_dfs_path must be an existing directory");
}

Try / catch

// Java
try {
    catalog.createDatabase(tablePath, false);
} catch (CatalogException e) {
    if (e.getCause() instanceof IOException) {
        // permissions / storage health; fix then retry
    }
    throw e;
}

Prevention

When it happens

Trigger: 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.

Common situations: 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.

Understand the failure class

Background: mkdir permission denied (EACCES): failed to create directory errors explained — this error's family across 32 libraries.

Related errors


AI-assisted analysis of apache/seatunnel@cf67b549a7 (2026-09-10). Data as JSON: /api/errors/002d9957cf316b17. Report an issue: GitHub.