{"record":{"id":"ad1796a14d5f1734","repo":"apache/seatunnel","slug":"dropping-database-s-exception","errorCode":null,"errorMessage":"Dropping database %s exception.","messagePattern":"Dropping 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":319,"sourceCode":"            if (ignoreIfNotExists) {\n                return;\n            } else {\n                throw new DatabaseNotExistException(catalogName, tablePath.getDatabaseName());\n            }\n        }\n\n        List<String> tables = listTables(tablePath.getDatabaseName());\n        if (!tables.isEmpty()) {\n            throw new CatalogException(\n                    String.format(\n                            \"Database %s not empty, can't drop it.\", tablePath.getDatabaseName()));\n        }\n\n        Path dbPath = new Path(tableParentDfsPath, tablePath.getDatabaseName());\n        try {\n            fs.delete(dbPath, true);\n        } catch (IOException e) {\n            throw new CatalogException(\n                    String.format(\"Dropping database %s exception.\", tablePath.getDatabaseName()),\n                    e);\n        }\n    }\n\n    private TableSchema convertSchema(\n            TableSchema.Builder tableSchemaBuilder, HoodieTableConfig tableConfig) {\n        if (tableConfig.getTableCreateSchema().isPresent()) {\n            Schema schema = tableConfig.getTableCreateSchema().get();\n            List<Schema.Field> fields = schema.getFields();\n            for (Schema.Field field : fields) {\n                tableSchemaBuilder.column(\n                        PhysicalColumn.of(\n                                field.name(),\n                                convertSeaTunnelType(field.name(), field.schema()),\n                                (Long) null,\n                                true,\n                                null,","sourceCodeStart":301,"sourceCodeEnd":337,"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#L301-L337","documentation":"After verifying the database is empty, HudiCatalog.dropDatabase() deletes the database directory via the Hadoop FileSystem. If that filesystem operation throws IOException (NameNode unreachable, permission denied, network failure to S3, etc.), it is rethrown as a CatalogException with this message and the original cause attached. The drop did not complete; inspect the wrapped cause.","triggerScenarios":"fs.delete(dbPath, true) on the database's DFS path throws IOException — e.g. HDFS NameNode unavailable, S3 credentials/expiry, missing permission on the parent path, or transient network failure.","commonSituations":"Cluster connectivity problems during a drop; misconfigured fs.defaultFS or S3A endpoint; Kerberos/token expiry; HDFS permission denied for the job user on the warehouse path.","solutions":["Inspect the wrapped cause exception to identify the filesystem failure (connection refused, permission denied, auth).","Verify the HDFS/S3 connection settings and credentials used by the SeaTunnel job; test fs delete access with a small path.","Retry the dropDatabase after connectivity/auth is restored — the pre-check guarantees the DB is empty so a retry is safe.","Check HDFS permissions (hdfs dfs -rmdir) for the warehouse directory for the user running SeaTunnel."],"exampleFix":null,"handlingStrategy":"retry","validationCode":"// pre-check connectivity\nFileSystem fs = FileSystem.get(conf);\nfs.exists(new Path(warehousePath)); // throws if FS unreachable","typeGuard":null,"tryCatchPattern":"try {\n    catalog.dropDatabase(tablePath);\n} catch (CatalogException e) {\n    if (e.getCause() instanceof IOException) {\n        // log cause, backoff and retry; verify DB emptiness before retry\n    } else throw e;\n}","preventionTips":["Check HDFS/S3 credentials and reachability before running drop jobs.","Watch for Kerberos token expiry on long-running jobs.","Ensure the SeaTunnel user has delete permission on the warehouse path."],"tags":["hudi","catalog","hadoop-filesystem","io"],"backgroundTag":"database-write-failed","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"}