{"record":{"id":"c5554d1ee85a2208","repo":"apache/iceberg","slug":"namespace-s-is-not-empty-c5554d","errorCode":null,"errorMessage":"Namespace %s is not empty","messagePattern":"Namespace (.+?) is not empty","errorType":"exception","errorClass":"NamespaceNotEmptyException","httpStatus":null,"severity":"error","filePath":"dell/src/main/java/org/apache/iceberg/dell/ecs/EcsCatalog.java","lineNumber":342,"sourceCode":"    if (!objectMetadata(namespaceObject).isPresent()) {\n      throw new NoSuchNamespaceException(\n          \"Namespace %s(%s) properties object is absent\", namespace, namespaceObject);\n    }\n\n    Map<String, String> result = loadProperties(namespaceObject).content();\n\n    LOG.debug(\"Loaded metadata for namespace {} found {}\", namespace, result);\n    return result;\n  }\n\n  @Override\n  public boolean dropNamespace(Namespace namespace) throws NamespaceNotEmptyException {\n    if (!namespace.isEmpty() && !namespaceExists(namespace)) {\n      throw new NoSuchNamespaceException(\"Namespace %s does not exist\", namespace);\n    }\n\n    if (!listNamespaces(namespace).isEmpty() || !listTables(namespace).isEmpty()) {\n      throw new NamespaceNotEmptyException(\"Namespace %s is not empty\", namespace);\n    }\n\n    EcsURI namespaceObject = namespaceURI(namespace);\n    client.deleteObject(namespaceObject.bucket(), namespaceObject.name());\n    LOG.info(\"Dropped namespace: {}\", namespace);\n    return true;\n  }\n\n  @Override\n  public boolean setProperties(Namespace namespace, Map<String, String> properties)\n      throws NoSuchNamespaceException {\n    return updateProperties(namespace, r -> r.putAll(properties));\n  }\n\n  @Override\n  public boolean removeProperties(Namespace namespace, Set<String> properties)\n      throws NoSuchNamespaceException {\n    return updateProperties(namespace, r -> r.keySet().removeAll(properties));","sourceCodeStart":324,"sourceCodeEnd":360,"githubUrl":"https://github.com/apache/iceberg/blob/86d9c8fc543e7c56c9f624eb725f76c9baff9570/dell/src/main/java/org/apache/iceberg/dell/ecs/EcsCatalog.java#L324-L360","documentation":"NamespaceNotEmptyException thrown by EcsCatalog.dropNamespace when the namespace still contains sub-namespaces or tables. ECS namespaces are marker objects, so the catalog refuses to drop a parent while children exist.","triggerScenarios":"Calling dropNamespace on a namespace whose listNamespaces or listTables results are non-empty.","commonSituations":"Recursive cleanup that forgot to drop child tables first, tables created by another engine under the namespace, leftover orphan table objects in ECS.","solutions":["Drop all tables with listTables + dropTable first","Drop sub-namespaces recursively before the parent","Clean orphaned ECS objects if children no longer exist logically"],"exampleFix":"// before\ncatalog.dropNamespace(ns);\n// after\nfor (TableIdentifier t : catalog.listTables(ns)) { catalog.dropTable(t); }\nfor (Namespace child : catalog.listNamespaces(ns)) { catalog.dropNamespace(child); }\ncatalog.dropNamespace(ns);","handlingStrategy":"validation","validationCode":"boolean empty = catalog.listNamespaces(ns).isEmpty() && catalog.listTables(ns).isEmpty();\nif (empty) { catalog.dropNamespace(ns); }","typeGuard":null,"tryCatchPattern":"try { catalog.dropNamespace(ns); } catch (NamespaceNotEmptyException e) { /* purge children first */ }","preventionTips":["Always purge tables and sub-namespaces before dropping a namespace","Use recursive cleanup helpers","Check for orphan ECS objects left by prior failed drops"],"tags":["catalog","namespace","ecs"],"backgroundTag":"invalid-state-transition","analyzedSha":"86d9c8fc543e7c56c9f624eb725f76c9baff9570","analyzedAt":"2026-09-12T00:46:39.097Z","contentChangedAt":"2026-09-12T00:46:39.097Z","schemaVersion":2},"datasetVersion":"2026-09-14T16:17:12.679Z"}