apache/seatunnel · error · HoodieCatalogException

Failed to create table %s

Error message

Failed to create table %s

What it means

HudiCatalog.createTable() wraps IOException raised while initializing a new Hudi table (HoodieTableMetaClient.initTable) into a HoodieCatalogException. It means the table metadata could not be written to storage, so table creation failed after the schema conversion succeeded.

Source

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

                HoodieTableMetaClient.withPropertyBuilder()
                        .setTableType(table.getOptions().get(TABLE_TYPE.key()))
                        .setRecordKeyFields(table.getOptions().get(RECORD_KEY_FIELDS.key()))
                        .setTableCreateSchema(
                                convertToSchema(
                                                table.getSeaTunnelRowType(),
                                                AvroSchemaUtils.getAvroRecordQualifiedName(
                                                        table.getTableId().getTableName()))
                                        .toString())
                        .setTableName(tablePath.getTableName())
                        .setPartitionFields(String.join(",", table.getPartitionKeys()))
                        .setPayloadClassName(HoodieAvroPayload.class.getName())
                        .setCDCEnabled(
                                Boolean.parseBoolean(table.getOptions().get(CDC_ENABLED.key())))
                        .setPreCombineField(table.getOptions().get(PRECOMBINE_FIELD.key()))
                        .initTable(new HadoopStorageConfiguration(hadoopConf), tablePathStr);
            }
        } catch (IOException e) {
            throw new HoodieCatalogException(
                    String.format("Failed to create table %s", tablePath.getFullName()), e);
        }
    }

    @Override
    public void dropTable(TablePath tablePath, boolean ignoreIfNotExists)
            throws TableNotExistException, CatalogException {
        if (!tableExists(tablePath)) {
            if (ignoreIfNotExists) {
                return;
            } else {
                throw new TableNotExistException(catalogName, tablePath);
            }
        }

        Path path = new Path(inferTablePath(tableParentDfsPathStr, tablePath));
        try {
            this.fs.delete(path, true);

View on GitHub (pinned to cf67b549a7)

Solutions

  1. Check write permissions for the connector user on table_parent_dfs_path/<db>.
  2. Inspect the wrapped IOException cause for the concrete storage error and fix storage connectivity.
  3. Validate table options (cdc_enabled, precombine_field, partitions) against supported Hudi values.
  4. Delete any partially created/corrupt .hoodie directory and retry.

Example fix

// before
options.put("cdc_enabled", "yes"); // invalid parse target, Boolean.parseBoolean expects true/false
// after
options.put("cdc_enabled", "true");
Defensive patterns

Strategy: try-catch

Validate before calling

// Java
Map<String,String> opts = table.getOptions();
if (opts.containsKey("cdc_enabled")) {
    Boolean.parseBoolean(opts.get("cdc_enabled")); // throws early if not true/false
}
FileSystem fs = FileSystem.get(conf);
if (!fs.exists(dbPath)) throw new IllegalStateException("DB dir missing");

Try / catch

// Java
try {
    catalog.createTable(tablePath, table, false);
} catch (HoodieCatalogException e) {
    if (e.getCause() instanceof IOException) {
        // inspect cause: permissions, storage outage, or corrupt target
    }
    throw e;
}

Prevention

When it happens

Trigger: Calling createTable(tablePath, table, ignoreIfExists) when initTable fails to write .hoodie metadata due to IOException: permission denied on the DB directory, underlying storage down, invalid partitions/cdc/precombine options triggering a Hudi-side failure surfaced as IOException.

Common situations: Connector user lacks write permission on the HDFS/S3 path; cloud storage outage; invalid option values (e.g., bad CDC_ENABLED or PRECOMBINE_FIELD) causing Hudi init to fail; target path already partially exists in a corrupt state.

Understand the failure class

Background: "failed to write file", "Could not save figure", "Error saving remote file" — file write failed: causes and fixes across languages and libraries — this error's family across 38 libraries.

Related errors


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