{"record":{"id":"c3584ce7d8f7ac8c","repo":"apache/iceberg","slug":"namespace-s-with-snowflake-identifier-s-does","errorCode":null,"errorMessage":"Namespace '%s' with snowflake identifier '%s' doesn't exist","messagePattern":"Namespace '(.+?)' with snowflake identifier '(.+?)' doesn't exist","errorType":"exception","errorClass":"NoSuchNamespaceException","httpStatus":null,"severity":"error","filePath":"snowflake/src/main/java/org/apache/iceberg/snowflake/SnowflakeCatalog.java","lineNumber":219,"sourceCode":"    SnowflakeIdentifier id = NamespaceHelpers.toSnowflakeIdentifier(namespace);\n    boolean namespaceExists;\n    switch (id.type()) {\n      case DATABASE:\n        namespaceExists = snowflakeClient.databaseExists(id);\n        break;\n      case SCHEMA:\n        namespaceExists = snowflakeClient.schemaExists(id);\n        break;\n      default:\n        throw new IllegalArgumentException(\n            String.format(\n                \"loadNamespaceMetadata must be at either DATABASE or SCHEMA level; got %s from namespace %s\",\n                id, namespace));\n    }\n    if (namespaceExists) {\n      return ImmutableMap.of();\n    } else {\n      throw new NoSuchNamespaceException(\n          \"Namespace '%s' with snowflake identifier '%s' doesn't exist\", namespace, id);\n    }\n  }\n\n  @Override\n  public boolean dropNamespace(Namespace namespace) {\n    throw new UnsupportedOperationException(\n        \"SnowflakeCatalog does not currently support dropNamespace\");\n  }\n\n  @Override\n  public boolean setProperties(Namespace namespace, Map<String, String> properties) {\n    throw new UnsupportedOperationException(\n        \"SnowflakeCatalog does not currently support setProperties\");\n  }\n\n  @Override\n  public boolean removeProperties(Namespace namespace, Set<String> properties) {","sourceCodeStart":201,"sourceCodeEnd":237,"githubUrl":"https://github.com/apache/iceberg/blob/86d9c8fc543e7c56c9f624eb725f76c9baff9570/snowflake/src/main/java/org/apache/iceberg/snowflake/SnowflakeCatalog.java#L201-L237","documentation":"SnowflakeCatalog.loadNamespaceMetadata verified via snowflakeClient that the requested database or schema does not exist and throws NoSuchNamespaceException. Snowflake returns an empty metadata map when the namespace exists; there are no properties to report, so only existence is checked.","triggerScenarios":"Calling loadNamespaceMetadata with a one- or two-level namespace whose database (or database.schema) does not exist in the connected Snowflake account, or is not visible to the configured role.","commonSituations":"Typos in database/schema names or wrong letter-casing assumptions; connected with a role that lacks access to the namespace; pointing the catalog URI at a different Snowflake account/environment than expected; namespace dropped after being cached.","solutions":["Verify the database/schema exists with SHOW DATABASES / SHOW SCHEMAS in Snowflake using the configured credentials and role","Check catalog configuration (uri, role, database) points at the intended Snowflake account","Ensure the role grants (USAGE on database/schema) allow the connected user to see the namespace","Fix the namespace name spelling/casing in the calling code"],"exampleFix":"// before\nif (!catalog.namespaceExists(ns)) { /* assume missing */ }\n// after\ntry {\n  catalog.loadNamespaceMetadata(ns);\n} catch (NoSuchNamespaceException e) {\n  // create or locate the correct namespace before proceeding\n}","handlingStrategy":"try-catch","validationCode":"// optionally pre-check via Snowflake client\nboolean exists = namespace.levels().length == 1\n    ? snowflakeClient.databaseExists(id)\n    : snowflakeClient.schemaExists(id);","typeGuard":null,"tryCatchPattern":"try {\n  Map<String, String> meta = catalog.loadNamespaceMetadata(ns);\n} catch (NoSuchNamespaceException e) {\n  // provision the namespace or correct its name before proceeding\n}","preventionTips":["Verify database/schema names and casing against SHOW DATABASES/SCHEMAS","Confirm the configured Snowflake role has USAGE grants on target namespaces","Pin catalog URI/role config to the intended environment","Re-validate cached namespace names after drops/renames in Snowflake"],"tags":["snowflake","namespace","not-found","catalog"],"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"}