{"record":{"id":"fe62b23a54175d46","repo":"t8y2/dbx","slug":"no-available-hiveserver2-nodes-in-zookeeper-namesp-fe62b2","errorCode":null,"errorMessage":"no available HiveServer2 nodes in ZooKeeper namespace %s","messagePattern":"no available HiveServer2 nodes in ZooKeeper namespace (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"agents/drivers/hive-go/discovery.go","lineNumber":160,"sourceCode":"\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}\n\treturn []string{zooKeeperPath(namespace)}\n}\n\nfunc zooKeeperPath(parts ...string) string {\n\tcleaned := make([]string, 0, len(parts))","sourceCodeStart":142,"sourceCodeEnd":178,"githubUrl":"https://github.com/t8y2/dbx/blob/c0390bff16418b651f4728520d99adf8ce48829a/agents/drivers/hive-go/discovery.go#L142-L178","documentation":"Endpoints() successfully listed a namespace (listedPath is set) and every child was read and parsed, yet zero unique endpoints remained after deduplication. This means the namespace contains registrations but none resolved to a reachable HiveServer2 endpoint record.","triggerScenarios":"Calling Endpoints against a namespace whose children parse to endpoints that dedupe to nothing, or whose registrations resolve to empty/invalid endpoint values that are dropped; distinct children publishing identical data is the typical path — after uniqueEndpoints() the resolved set is empty only if nothing valid was collected, which here means all parsed entries were filtered out.","commonSituations":"A namespace populated with placeholder or test znodes whose data parses but yields no usable host:port; an empty cluster where nodes deregistered leaving metadata-only children; misconfigured published configs lacking host/port fields.","solutions":["Inspect the znode data under the namespace (zkCli get) and confirm it contains a valid host:port serverUri.","Ensure at least one healthy HiveServer2 is registered; start the server with dynamic service discovery enabled.","Verify the parsed endpoint fields (host/port) are populated in the servers' published configuration.","Re-check the namespace — a similarly named but wrong namespace may contain only non-serving registrations."],"exampleFix":null,"handlingStrategy":"retry","validationCode":"// Check a child actually parses to host:port before discovery\ndata, _, _ := conn.Get(\"/hiveserver2/instances/node1\")\nfmt.Println(\"registration payload:\", string(data)) // must contain serverUri or be host:port","typeGuard":null,"tryCatchPattern":"endpoints, err := discovery.Endpoints(ctx, rejected)\nif err != nil {\n    if strings.Contains(err.Error(), \"no available HiveServer2 nodes\") {\n        time.Sleep(retryInterval)\n        endpoints, err = discovery.Endpoints(ctx, rejected)\n    }\n    if err != nil { return err }\n}","preventionTips":["Ensure at least one healthy HiveServer2 is registered before client start","Inspect znode payloads to confirm host/port are published","Remove placeholder/test znodes from production namespaces","Alert on empty discovery namespaces"],"tags":["zookeeper","service-discovery","hiveserver2","empty-cluster"],"backgroundTag":"no-usable-service-nodes","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"}