{"record":{"id":"b775bb5ff9ef8178","repo":"apache/seatunnel","slug":"failed-to-create-table-s","errorCode":null,"errorMessage":"Failed to create table %s","messagePattern":"Failed to create table (.+?)","errorType":"exception","errorClass":"HoodieCatalogException","httpStatus":null,"severity":"error","filePath":"seatunnel-connectors-v2/connector-hudi/src/main/java/org/apache/seatunnel/connectors/seatunnel/hudi/catalog/HudiCatalog.java","lineNumber":245,"sourceCode":"                HoodieTableMetaClient.withPropertyBuilder()\n                        .setTableType(table.getOptions().get(TABLE_TYPE.key()))\n                        .setRecordKeyFields(table.getOptions().get(RECORD_KEY_FIELDS.key()))\n                        .setTableCreateSchema(\n                                convertToSchema(\n                                                table.getSeaTunnelRowType(),\n                                                AvroSchemaUtils.getAvroRecordQualifiedName(\n                                                        table.getTableId().getTableName()))\n                                        .toString())\n                        .setTableName(tablePath.getTableName())\n                        .setPartitionFields(String.join(\",\", table.getPartitionKeys()))\n                        .setPayloadClassName(HoodieAvroPayload.class.getName())\n                        .setCDCEnabled(\n                                Boolean.parseBoolean(table.getOptions().get(CDC_ENABLED.key())))\n                        .setPreCombineField(table.getOptions().get(PRECOMBINE_FIELD.key()))\n                        .initTable(new HadoopStorageConfiguration(hadoopConf), tablePathStr);\n            }\n        } catch (IOException e) {\n            throw new HoodieCatalogException(\n                    String.format(\"Failed to create table %s\", tablePath.getFullName()), e);\n        }\n    }\n\n    @Override\n    public void dropTable(TablePath tablePath, boolean ignoreIfNotExists)\n            throws TableNotExistException, CatalogException {\n        if (!tableExists(tablePath)) {\n            if (ignoreIfNotExists) {\n                return;\n            } else {\n                throw new TableNotExistException(catalogName, tablePath);\n            }\n        }\n\n        Path path = new Path(inferTablePath(tableParentDfsPathStr, tablePath));\n        try {\n            this.fs.delete(path, true);","sourceCodeStart":227,"sourceCodeEnd":263,"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#L227-L263","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","solutions":["Check write permissions for the connector user on table_parent_dfs_path/<db>.","Inspect the wrapped IOException cause for the concrete storage error and fix storage connectivity.","Validate table options (cdc_enabled, precombine_field, partitions) against supported Hudi values.","Delete any partially created/corrupt .hoodie directory and retry."],"exampleFix":"// before\noptions.put(\"cdc_enabled\", \"yes\"); // invalid parse target, Boolean.parseBoolean expects true/false\n// after\noptions.put(\"cdc_enabled\", \"true\");","handlingStrategy":"try-catch","validationCode":"// Java\nMap<String,String> opts = table.getOptions();\nif (opts.containsKey(\"cdc_enabled\")) {\n    Boolean.parseBoolean(opts.get(\"cdc_enabled\")); // throws early if not true/false\n}\nFileSystem fs = FileSystem.get(conf);\nif (!fs.exists(dbPath)) throw new IllegalStateException(\"DB dir missing\");","typeGuard":null,"tryCatchPattern":"// Java\ntry {\n    catalog.createTable(tablePath, table, false);\n} catch (HoodieCatalogException e) {\n    if (e.getCause() instanceof IOException) {\n        // inspect cause: permissions, storage outage, or corrupt target\n    }\n    throw e;\n}","preventionTips":["Verify write permissions on the target directory before creating tables.","Use only boolean values for cdc_enabled (true/false) since it is parsed with Boolean.parseBoolean.","Ensure no partial/corrupt .hoodie directory exists at the target path.","Validate precombine_field and partition options against the table schema."],"tags":["hudi","filesystem","io","write"],"backgroundTag":"file-write-failed","analyzedSha":"cf67b549a7a6c35fa0beb12d83c62892427ea919","analyzedAt":"2026-09-10T21:44:55.265Z","contentChangedAt":"2026-09-10T21:44:55.265Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}