{"record":{"id":"26cf36ad38e75585","repo":"apache/iceberg","slug":"namespace-does-not-exist-s-26cf36","errorCode":null,"errorMessage":"Namespace does not exist: %s","messagePattern":"Namespace does not exist: (.+?)","errorType":"exception","errorClass":"NoSuchNamespaceException","httpStatus":404,"severity":"error","filePath":"nessie/src/main/java/org/apache/iceberg/nessie/NessieIcebergClient.java","lineNumber":281,"sourceCode":"    }\n  }\n\n  public List<Namespace> listNamespaces(Namespace namespace) throws NoSuchNamespaceException {\n    try {\n      String filter = \"entry.contentType == 'NAMESPACE' && \";\n      if (namespace.isEmpty()) {\n        filter += \"size(entry.keyElements) == 1\";\n      } else {\n        org.projectnessie.model.Namespace root =\n            org.projectnessie.model.Namespace.of(namespace.levels());\n        Content existing =\n            api.getContent()\n                .reference(getReference())\n                .key(root.toContentKey())\n                .get()\n                .get(root.toContentKey());\n        if (existing == null) {\n          throw new NoSuchNamespaceException(\"Namespace does not exist: %s\", namespace);\n        }\n\n        filter +=\n            String.format(\n                Locale.ROOT,\n                \"size(entry.keyElements) == %d && entry.encodedKey.startsWith('%s.')\",\n                root.getElementCount() + 1,\n                root.name());\n      }\n      List<ContentKey> entries =\n          withReference(api.getEntries()).filter(filter).stream()\n              .map(EntriesResponse.Entry::getName)\n              .collect(Collectors.toList());\n      if (entries.isEmpty()) {\n        return Collections.emptyList();\n      }\n      GetContentBuilder getContent = withReference(api.getContent());\n      entries.forEach(getContent::key);","sourceCodeStart":263,"sourceCodeEnd":299,"githubUrl":"https://github.com/apache/iceberg/blob/86d9c8fc543e7c56c9f624eb725f76c9baff9570/nessie/src/main/java/org/apache/iceberg/nessie/NessieIcebergClient.java#L263-L299","documentation":"listNamespaces(namespace) with a non-empty namespace first checks that the root namespace content actually exists on the current reference. If the content lookup returns null, it throws NoSuchNamespaceException 'Namespace does not exist'. This is a client-side existence check before issuing the filtered entries query.","triggerScenarios":"Calling Catalog.listNamespaces(Namespace.of(\"a\",\"b\")) where namespace 'a.b' was never created or was already dropped on the current ref.","commonSituations":"Typo in namespace name or wrong separator handling (dots vs multi-level); listing children under a namespace that exists on a different branch; listing after another job dropped the namespace.","solutions":["Call catalog.namespaceExists(namespace) or listNamespaces(Namespace.empty()) to see which top-level namespaces actually exist before drilling down.","Correct the namespace spelling/level structure in the caller.","Verify you are connected to the intended branch/ref where the namespace was created."],"exampleFix":"// before\nList<Namespace> children = catalog.listNamespaces(Namespace.of(\"a\", \"b\")); // a.b may not exist\n// after\nif (catalog.namespaceExists(Namespace.of(\"a\", \"b\"))) {\n  List<Namespace> children = catalog.listNamespaces(Namespace.of(\"a\", \"b\"));\n}","handlingStrategy":"validation","validationCode":"if (!catalog.namespaceExists(namespace)) {\n  throw new IllegalArgumentException(\"Namespace not found: \" + namespace);\n}\nList<Namespace> children = catalog.listNamespaces(namespace);","typeGuard":null,"tryCatchPattern":"try {\n  return catalog.listNamespaces(ns);\n} catch (NoSuchNamespaceException e) {\n  return Collections.emptyList();\n}","preventionTips":["Call namespaceExists before enumerating children.","Beware multi-level namespaces vs dotted-name confusion.","Confirm you are on the branch where the namespace was created."],"tags":["nessie","namespace","not-found"],"backgroundTag":"entity-not-found","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"}