{"record":{"id":"bef4e72ef362f776","repo":"t8y2/dbx","slug":"no-usable-hiveserver2-nodes-in-zookeeper-namespace-bef4e7","errorCode":null,"errorMessage":"no usable HiveServer2 nodes in ZooKeeper namespace %s: %s","messagePattern":"no usable HiveServer2 nodes in ZooKeeper namespace (.+?): (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"agents/drivers/hive-go/discovery.go","lineNumber":158,"sourceCode":"\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}\n\treturn []string{zooKeeperPath(namespace)}\n}\n","sourceCodeStart":140,"sourceCodeEnd":176,"githubUrl":"https://github.com/t8y2/dbx/blob/c0390bff16418b651f4728520d99adf8ce48829a/agents/drivers/hive-go/discovery.go#L140-L176","documentation":"Endpoints() found the namespace znode and could list children, but every candidate registration either failed to read (Get error) or failed to parse (unsupported registration format); nodeFailures collected those per-node reasons and this error surfaces them joined with '; '. The namespace exists but contains no usable HiveServer2 endpoint.","triggerScenarios":"Calling Endpoints when the namespace path lists children but each child read from path+'/'+child failed (e.g. ephemeral nodes deleted mid-read, ACLs denying Get) or each child's payload could not be parsed as a known HiveServer2 registration (bad JSON, missing serverUri keys, unparsable host:port).","commonSituations":"HiveServer2 nodes are crashing so their ephemeral znodes vanish during discovery; SASL-protected znodes unreadable by an unauthenticated client; a non-Hive service (or old Hive version) publishing znodes in the same namespace in an unexpected format.","solutions":["Read the nodeFailures list in the message; fix the per-node cause (ACL/auth, deleted node, malformed payload).","Enable ZooKeeper auth (authScheme + auth) if the znodes are access-controlled.","Verify each registered server is healthy; stale ephemeral nodes mean servers died — restart HiveServer2 instances.","Check the payload format published by your HiveServer2 version; upgrade the driver or reconfigure the server's published config keys (serverUri/hiveserver2Uri/server_uri)."],"exampleFix":null,"handlingStrategy":"retry","validationCode":"// Probe a registration child before relying on discovery\nconn, _, _ := zk.Connect([]string{\"zk1:2181\"}, 5*time.Second)\nif auth != \"\" { conn.AddAuth(\"digest\", []byte(auth)) }\nchildren, _, err := conn.Children(\"/hiveserver2/instances\")\nif err != nil || len(children) == 0 {\n    fmt.Println(\"namespace unusable:\", err)\n}\nconn.Close()","typeGuard":null,"tryCatchPattern":"endpoints, err := discovery.Endpoints(ctx, rejected)\nif err != nil {\n    if strings.Contains(err.Error(), \"no usable HiveServer2 nodes\") {\n        // nodeFailures are embedded; retry after servers re-register\n        time.Sleep(2 * time.Second)\n        endpoints, err = discovery.Endpoints(ctx, rejected)\n    }\n    if err != nil { return err }\n}","preventionTips":["Configure ZooKeeper auth when znodes are ACL-protected","Monitor HiveServer2 liveness so ephemeral nodes don't vanish mid-discovery","Keep non-Hive znodes out of the discovery namespace","Pin driver and HiveServer2 versions whose registration formats agree"],"tags":["zookeeper","service-discovery","hiveserver2","node-parsing"],"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"}