{"record":{"id":"e509f29741b6a4c5","repo":"apache/iceberg","slug":"invalid-namespace-s","errorCode":null,"errorMessage":"Invalid namespace: %s","messagePattern":"Invalid namespace: (.+?)","errorType":"exception","errorClass":"NoSuchNamespaceException","httpStatus":404,"severity":"error","filePath":"core/src/main/java/org/apache/iceberg/rest/RESTSessionCatalog.java","lineNumber":1418,"sourceCode":"    configResponse.validate();\n    return configResponse;\n  }\n\n  private void checkIdentifierIsValid(TableIdentifier tableIdentifier) {\n    if (tableIdentifier.namespace().isEmpty()) {\n      throw new NoSuchTableException(\"Invalid table identifier: %s\", tableIdentifier);\n    }\n  }\n\n  private void checkViewIdentifierIsValid(TableIdentifier identifier) {\n    if (identifier.namespace().isEmpty()) {\n      throw new NoSuchViewException(\"Invalid view identifier: %s\", identifier);\n    }\n  }\n\n  private void checkNamespaceIsValid(Namespace namespace) {\n    if (namespace.isEmpty()) {\n      throw new NoSuchNamespaceException(\"Invalid namespace: %s\", namespace);\n    }\n  }\n\n  public void commitTransaction(SessionContext context, List<TableCommit> commits) {\n    Endpoint.check(endpoints, Endpoint.V1_COMMIT_TRANSACTION);\n    List<UpdateTableRequest> tableChanges = Lists.newArrayListWithCapacity(commits.size());\n\n    for (TableCommit commit : commits) {\n      tableChanges.add(\n          UpdateTableRequest.create(commit.identifier(), commit.requirements(), commit.updates()));\n    }\n\n    AuthSession contextualSession = authManager.contextualSession(context, catalogAuth);\n    client\n        .withAuthSession(contextualSession)\n        .post(\n            paths.commitTransaction(),\n            new CommitTransactionRequest(tableChanges),","sourceCodeStart":1400,"sourceCodeEnd":1436,"githubUrl":"https://github.com/apache/iceberg/blob/86d9c8fc543e7c56c9f624eb725f76c9baff9570/core/src/main/java/org/apache/iceberg/rest/RESTSessionCatalog.java#L1400-L1436","documentation":"A NoSuchNamespaceException thrown by RESTSessionCatalog.checkNamespaceIsValid when the given Namespace is empty. REST catalog namespace operations (create/namespace metadata/drop/list) require a non-empty namespace; an empty one is invalid and rejected client-side.","triggerScenarios":"Calling namespace APIs (createNamespace, namespaceExists, dropNamespace, loadNamespaceMetadata, listNamespaces with a namespace argument) passing Namespace.empty() or Namespace.of().","commonSituations":"Passing an empty namespace intentionally to mean 'root' — REST requires an explicit level; misconfigured default-namespace resolution; namespace parsed from an empty string.","solutions":["Provide at least one namespace level: Namespace.of(\"analytics\").","For listing top-level namespaces use listNamespaces() without arguments rather than passing an empty namespace.","Guard with namespace.isEmpty() before calling namespace operations.","Catch NoSuchNamespaceException if empty namespaces should be treated as 'namespace absent'."],"exampleFix":"// before\ncatalog.createNamespace(Namespace.of());\n// after\ncatalog.createNamespace(Namespace.of(\"staging\"));","handlingStrategy":"validation","validationCode":"if (namespace == null || namespace.isEmpty()) { throw new IllegalArgumentException(\"namespace must be non-empty (use listNamespaces() to list root)\"); }","typeGuard":null,"tryCatchPattern":"try { catalog.createNamespace(ns); } catch (NoSuchNamespaceException e) { /* invalid namespace */ }","preventionTips":["Never pass Namespace.empty() to REST namespace operations","Use the no-argument listNamespaces() for the root listing","Validate namespace.isEmpty() before calling namespace APIs","Ensure namespace parsing of user input never yields empty levels"],"tags":["rest","namespace","validation"],"backgroundTag":"invalid-identifier","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"}