{"record":{"id":"572bb3569c9308f9","repo":"apache/iceberg","slug":"s","errorCode":null,"errorMessage":"%s","messagePattern":"%s","errorType":"exception","errorClass":"NoSuchNamespaceException","httpStatus":null,"severity":"error","filePath":"bigquery/src/main/java/org/apache/iceberg/gcp/bigquery/BigQueryMetastoreCatalog.java","lineNumber":270,"sourceCode":"    if (!namespaceExists(namespace)) {\n      throw new NoSuchNamespaceException(\"Namespace does not exist: %s\", namespace);\n    }\n\n    Preconditions.checkNotNull(properties, \"Invalid properties to remove: null\");\n\n    if (properties.isEmpty()) {\n      return false;\n    }\n\n    return client.removeParameters(toDatasetReference(namespace), properties);\n  }\n\n  @Override\n  public Map<String, String> loadNamespaceMetadata(Namespace namespace) {\n    try {\n      return toMetadata(client.load(toDatasetReference(namespace)));\n    } catch (IllegalArgumentException e) {\n      throw new NoSuchNamespaceException(\"%s\", e.getMessage());\n    }\n  }\n\n  @Override\n  protected boolean isValidIdentifier(TableIdentifier identifier) {\n    try {\n      validateNamespace(identifier.namespace());\n    } catch (IllegalArgumentException e) {\n      return false;\n    }\n    return true;\n  }\n\n  @Override\n  public String name() {\n    return catalogName;\n  }\n","sourceCodeStart":252,"sourceCodeEnd":288,"githubUrl":"https://github.com/apache/iceberg/blob/86d9c8fc543e7c56c9f624eb725f76c9baff9570/bigquery/src/main/java/org/apache/iceberg/gcp/bigquery/BigQueryMetastoreCatalog.java#L252-L288","documentation":"NoSuchNamespaceException raised by loadNamespaceMetadata when client.load(datasetReference) throws IllegalArgumentException while loading the BigQuery dataset backing the namespace. The catalog translates that failure into a namespace-not-found error, since the dataset cannot be loaded.","triggerScenarios":"Calling catalog.loadNamespaceMetadata(namespace) where the BigQuery dataset is missing or the client's load path rejects the dataset reference (invalid dataset id, dataset not found surfaced as IllegalArgumentException).","commonSituations":"Dataset deleted by a scheduled cleanup job while Iceberg metadata still references it, illegal characters in namespace producing an invalid dataset id, cross-project references the client does not resolve.","solutions":["Verify the dataset exists with bq show <project>:<dataset_id>","Check namespace components form a valid BigQuery dataset id (letters, numbers, underscores)","Confirm the catalog project id matches where the dataset lives","Catch NoSuchNamespaceException around loadNamespaceMetadata for missing-namespace handling"],"exampleFix":"// before\nMap<String,String> meta = catalog.loadNamespaceMetadata(ns);\n// after\ntry {\n  Map<String,String> meta = catalog.loadNamespaceMetadata(ns);\n} catch (NoSuchNamespaceException e) {\n  // namespace no longer backed by a BigQuery dataset\n}","handlingStrategy":"try-catch","validationCode":"if (!catalog.namespaceExists(namespace)) { /* skip load */ }","typeGuard":null,"tryCatchPattern":"try { catalog.loadNamespaceMetadata(ns); } catch (NoSuchNamespaceException e) { /* dataset backing namespace missing */ }","preventionTips":["Validate namespace components form a legal BigQuery dataset id","Keep dataset lifecycle in sync with Iceberg catalog usage","Verify dataset existence in the correct project"],"tags":["bigquery","namespace","metadata","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"}