{"record":{"id":"2997ee03358c5647","repo":"apache/iceberg","slug":"cannot-find-namespace-s","errorCode":null,"errorMessage":"Cannot find namespace %s","messagePattern":"Cannot find namespace (.+?)","errorType":"exception","errorClass":"NoSuchNamespaceException","httpStatus":404,"severity":"error","filePath":"aws/src/main/java/org/apache/iceberg/aws/dynamodb/DynamoDbCatalog.java","lineNumber":272,"sourceCode":"    } while (!lastEvaluatedKey.isEmpty());\n\n    return namespaces;\n  }\n\n  @Override\n  public Map<String, String> loadNamespaceMetadata(Namespace namespace)\n      throws NoSuchNamespaceException {\n    validateNamespace(namespace);\n    GetItemResponse response =\n        dynamo.getItem(\n            GetItemRequest.builder()\n                .tableName(awsProperties.dynamoDbTableName())\n                .consistentRead(true)\n                .key(namespacePrimaryKey(namespace))\n                .build());\n\n    if (!response.hasItem()) {\n      throw new NoSuchNamespaceException(\"Cannot find namespace %s\", namespace);\n    }\n\n    return response.item().entrySet().stream()\n        .filter(e -> isProperty(e.getKey()))\n        .collect(Collectors.toMap(e -> toPropertyKey(e.getKey()), e -> e.getValue().s()));\n  }\n\n  @Override\n  public boolean dropNamespace(Namespace namespace) throws NamespaceNotEmptyException {\n    validateNamespace(namespace);\n    if (!listTables(namespace).isEmpty()) {\n      throw new NamespaceNotEmptyException(\"Cannot delete non-empty namespace %s\", namespace);\n    }\n\n    try {\n      dynamo.deleteItem(\n          DeleteItemRequest.builder()\n              .tableName(awsProperties.dynamoDbTableName())","sourceCodeStart":254,"sourceCodeEnd":290,"githubUrl":"https://github.com/apache/iceberg/blob/86d9c8fc543e7c56c9f624eb725f76c9baff9570/aws/src/main/java/org/apache/iceberg/aws/dynamodb/DynamoDbCatalog.java#L254-L290","documentation":"DynamoDbCatalog.loadNamespaceMetadata() performs a consistent GetItem for the namespace's primary key; if no item is returned it throws NoSuchNamespaceException with this message. It signals that the requested namespace does not exist in the DynamoDB-backed catalog.","triggerScenarios":"Calling catalog.loadNamespaceMetadata(namespace), listTables flows that validate the namespace, or any catalog operation that resolves a namespace when the DynamoDB item for that key is absent (never created or already dropped).","commonSituations":"Misspelled or case-mismatched namespace name; querying after dropNamespace; pointing the catalog at the wrong DynamoDB table or region; an environment (dev vs prod) that never had the namespace created.","solutions":["Verify the namespace name spelling and case, then create it with catalog.createNamespace(namespace) if genuinely missing.","Check the catalog configuration (s3.table.dynamo-db-table-name, region, credentials) to ensure you are reading the intended catalog table.","If the namespace was dropped intentionally, update the calling code to handle NoSuchNamespaceException."],"exampleFix":"// before\nMap<String, String> props = catalog.loadNamespaceMetadata(Namespace.of(\"Analytcis\"));\n\n// after\nNamespace ns = Namespace.of(\"analytics\");\nif (!catalog.namespaceExists(ns)) {\n  catalog.createNamespace(ns);\n}\nMap<String, String> props = catalog.loadNamespaceMetadata(ns);","handlingStrategy":"validation","validationCode":"Namespace ns = Namespace.of(\"analytics\");\nif (!catalog.namespaceExists(ns)) {\n  throw new IllegalStateException(\"Namespace \" + ns + \" not found in \" + catalogName);\n}","typeGuard":null,"tryCatchPattern":"try {\n  props = catalog.loadNamespaceMetadata(ns);\n} catch (NoSuchNamespaceException e) {\n  props = Map.of(); // or create the namespace / fail fast with clear context\n}","preventionTips":["Verify namespace spelling and case before catalog calls","Double-check s3.table.dynamo-db-table-name and region configuration per environment","Use namespaceExists as a precondition in setup scripts"],"tags":["aws","dynamodb","catalog","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"}