{"record":{"id":"a19e505cfb210cd3","repo":"apache/iceberg","slug":"failed-to-list-namespace-under-namespace-namespa","errorCode":null,"errorMessage":"Failed to list namespace under namespace: <namespace> in Hive Metastore","messagePattern":"Failed to list namespace under namespace: <namespace> in Hive Metastore","errorType":"exception","errorClass":"RuntimeException","httpStatus":null,"severity":"error","filePath":"hive-metastore/src/main/java/org/apache/iceberg/hive/HiveCatalog.java","lineNumber":681,"sourceCode":"    LOG.debug(\"Successfully removed properties {} from {}\", properties, namespace);\n\n    // Always successful, otherwise exception is thrown\n    return true;\n  }\n\n  private void alterHiveDataBase(Namespace namespace, Database database) {\n    try {\n      clients.run(\n          client -> {\n            client.alterDatabase(namespace.level(0), database);\n            return null;\n          });\n\n    } catch (NoSuchObjectException | UnknownDBException e) {\n      throw new NoSuchNamespaceException(e, \"Namespace does not exist: %s\", namespace);\n\n    } catch (TException e) {\n      throw new RuntimeException(\n          \"Failed to list namespace under namespace: \" + namespace + \" in Hive Metastore\", e);\n\n    } catch (InterruptedException e) {\n      Thread.currentThread().interrupt();\n      throw new RuntimeException(\n          \"Interrupted in call to getDatabase(name) \" + namespace + \" in Hive Metastore\", e);\n    }\n  }\n\n  @Override\n  public Map<String, String> loadNamespaceMetadata(Namespace namespace) {\n    if (!isValidateNamespace(namespace)) {\n      throw new NoSuchNamespaceException(\"Namespace does not exist: %s\", namespace);\n    }\n\n    try {\n      Database database = clients.run(client -> client.getDatabase(namespace.level(0)));\n      Map<String, String> metadata = convertToMetadata(database);","sourceCodeStart":663,"sourceCodeEnd":699,"githubUrl":"https://github.com/apache/iceberg/blob/86d9c8fc543e7c56c9f624eb725f76c9baff9570/hive-metastore/src/main/java/org/apache/iceberg/hive/HiveCatalog.java#L663-L699","documentation":"Thrown by HiveCatalog.alterHiveDataBase when the Hive Metastore client call getDatabase(name) fails with a generic Thrift exception (TException) while altering namespace properties. It is a plain RuntimeException wrapping the underlying Thrift cause, not a typed Iceberg exception. It usually indicates a metastore connectivity, protocol, or server-side problem rather than a missing namespace (that case throws NoSuchNamespaceException first).","triggerScenarios":"Calling HiveCatalog.setProperties or removeProperties when client.getDatabase throws TException (e.g. HMS connection dropped, thrift protocol mismatch, transient metastore failure).","commonSituations":"Hive Metastore is down or restarted mid-call; network/timeout between client and HMS; hive-metastore thrift version mismatch; Kerberos/authentication failure surfacing as TException.","solutions":["Inspect the wrapped cause (getCause()) to identify the actual TException and fix the underlying metastore connectivity or protocol issue.","Verify hive.metastore.uris is reachable (telnet/nc to the HMS host:port) and the metastore is running.","Retry the operation; TException from HMS is often transient.","Check thrift protocol/version compatibility between the iceberg-hive-metastore client and the HMS server version."],"exampleFix":"// before\ncatalog.setProperties(ns, props); // raw RuntimeException on TException\n// after\ntry {\n  catalog.setProperties(ns, props);\n} catch (RuntimeException e) {\n  if (e.getCause() instanceof TException) {\n    // retry or surface HMS connectivity problem\n  }\n  throw e;\n}","handlingStrategy":"try-catch","validationCode":"// verify HMS reachability before the call\ntry (Socket s = new Socket(hmsHost, hmsPort)) { /* reachable */ }","typeGuard":null,"tryCatchPattern":"try {\n  catalog.setProperties(ns, props);\n} catch (RuntimeException e) {\n  if (e.getCause() instanceof TException) { /* retry/backoff or alert on HMS health */ }\n  throw e;\n}","preventionTips":["Monitor HMS availability and connection pool health before bulk property updates","Keep thrift client protocol versions aligned with the HMS server","Retry transient TException failures with exponential backoff"],"tags":["hive-metastore","thrift","namespace","connectivity"],"backgroundTag":"api-request-failed","analyzedSha":"86d9c8fc543e7c56c9f624eb725f76c9baff9570","analyzedAt":"2026-09-12T00:46:39.097Z","contentChangedAt":"2026-09-12T00:46:39.097Z","schemaVersion":2},"datasetVersion":"2026-09-14T11:17:12.474Z"}