{"record":{"id":"e8468c527c1328d9","repo":"t8y2/dbx","slug":"hiveserver2-zookeeper-namespace-not-found-tried-e8468c","errorCode":null,"errorMessage":"HiveServer2 ZooKeeper namespace not found; tried %s","messagePattern":"HiveServer2 ZooKeeper namespace not found; tried (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"agents/drivers/hive-go/discovery.go","lineNumber":155,"sourceCode":"\t\t\t\t}\n\t\t\t\tnodeFailures = append(nodeFailures, fmt.Sprintf(\"%s/%s: %v\", path, child, dataErr))\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tvalue, parseErr := parseHiveServerRegistration(child, data)\n\t\t\tif parseErr == nil {\n\t\t\t\tresolved = append(resolved, value)\n\t\t\t} else {\n\t\t\t\tnodeFailures = append(nodeFailures, fmt.Sprintf(\"%s/%s: %v\", path, child, parseErr))\n\t\t\t}\n\t\t}\n\t\tif len(resolved) > 0 {\n\t\t\tbreak\n\t\t}\n\t}\n\tresolved = shuffledEndpoints(uniqueEndpoints(resolved), rejected)\n\tif len(resolved) == 0 {\n\t\tif listedPath == \"\" {\n\t\t\treturn nil, fmt.Errorf(\"HiveServer2 ZooKeeper namespace not found; tried %s\", strings.Join(discovery.paths(), \", \"))\n\t\t}\n\t\tif len(nodeFailures) > 0 {\n\t\t\treturn nil, fmt.Errorf(\"no usable HiveServer2 nodes in ZooKeeper namespace %s: %s\", listedPath, strings.Join(nodeFailures, \"; \"))\n\t\t}\n\t\treturn nil, fmt.Errorf(\"no available HiveServer2 nodes in ZooKeeper namespace %s\", listedPath)\n\t}\n\treturn resolved, nil\n}\n\nfunc (discovery *zooKeeperDiscovery) paths() []string {\n\tnamespace := strings.Trim(discovery.namespace, \"/\")\n\tif strings.EqualFold(discovery.discoveryMode, \"zookeeperha\") {\n\t\treturn []string{\n\t\t\tzooKeeperPath(namespace, \"instances\"),\n\t\t\tzooKeeperPath(namespace+\"-unsecure\", \"instances\"),\n\t\t\tzooKeeperPath(namespace+\"-sasl\", \"instances\"),\n\t\t}\n\t}","sourceCodeStart":137,"sourceCodeEnd":173,"githubUrl":"https://github.com/t8y2/dbx/blob/c0390bff16418b651f4728520d99adf8ce48829a/agents/drivers/hive-go/discovery.go#L137-L173","documentation":"Endpoints() in the ZooKeeper service-discovery layer probes each configured HiveServer2 namespace path in ZooKeeper. If none of the candidate znode paths exists (every Children() call returned ErrNoNode), it cannot resolve any HiveServer2 instance and throws this error listing all the paths it attempted. It means the configured namespace does not match anything registered in the ensemble.","triggerScenarios":"Calling Endpoints (via the Hive driver's discovery path) when every candidate path under the configured namespace is missing in ZooKeeper: wrong namespace in the connection config, HiveServer2 never registered (not started, or service discovery disabled on the servers), or zookeeperHA mode where none of /<ns>/instances, /<ns>-unsecure/instances, /<ns>-sasl/instances exist.","commonSituations":"Typos or trailing-slash confusion in the ZooKeeper namespace; pointing at the wrong ensemble (dev vs prod); HiveServer2 configured with hive.server2.support.dynamic.service.discovery=false so nothing is published; HA mode expecting -unsecure/-sasl suffixed paths that the server version does not create.","solutions":["Verify the namespace matches the value HiveServer2 publishes (hive.zookeeper.namespace / zookeeper namespace in server config) and correct the client config.","Log into ZooKeeper (zkCli) and run ls on the candidate paths to confirm where HiveServer2 znodes actually live.","Confirm HiveServer2 is running with dynamic service discovery enabled so it registers znodes under the namespace.","Check whether the servers use a HA discovery mode; adjust discoveryMode so the -unsecure/-sasl candidate paths match your deployment."],"exampleFix":"// before\ndiscovery.namespace = \"hiveserver2-dev\"\n// after (match hive.zookeeper.namespace on the servers)\ndiscovery.namespace = \"hiveserver2\"","handlingStrategy":"fallback","validationCode":"// Before connecting, verify the namespace exists\nconn, _, _ := zk.Connect([]string{\"zk1:2181\"}, 5*time.Second)\npaths := []string{\"/hiveserver2\", \"/hiveserver2/instances\"}\nfor _, p := range paths {\n    if _, _, err := conn.Children(p); err == nil {\n        fmt.Println(\"namespace present:\", p)\n        break\n    }\n}\nconn.Close()","typeGuard":null,"tryCatchPattern":"endpoints, err := discovery.Endpoints(ctx, rejected)\nif err != nil {\n    if strings.Contains(err.Error(), \"namespace not found\") {\n        // fall back to a statically configured HiveServer2 host list\n        endpoints = staticEndpoints\n    } else {\n        return err\n    }\n}","preventionTips":["Match the client namespace to hive.zookeeper.namespace on the servers","Confirm HiveServer2 dynamic service discovery is enabled","Verify paths with zkCli ls before deploying","Document the expected discoveryMode so -unsecure/-sasl HA paths line up"],"tags":["zookeeper","service-discovery","hiveserver2","configuration"],"backgroundTag":"zookeeper-namespace-not-found","analyzedSha":"c0390bff16418b651f4728520d99adf8ce48829a","analyzedAt":"2026-09-05T23:05:10.900Z","contentChangedAt":"2026-09-05T23:05:10.900Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}