{"record":{"id":"d1a7e64074845f87","repo":"t8y2/dbx","slug":"no-usable-hiveserver2-nodes-in-zookeeper-namespace","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/argo-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/argo-go/discovery.go#L140-L176","documentation":"Endpoints() successfully listed a ZooKeeper namespace (listedPath is set) but every child entry failed to yield a usable endpoint: each Get or registration parse failure was recorded in nodeFailures. The message includes the path and a semicolon-joined list of per-node failure reasons (data fetch errors or parse errors like unsupported registration format).","triggerScenarios":"Children(path) succeeded, but for every child either connection.Get(path+\"/\"+child) failed (non-ErrNoNode) or parseHiveServerRegistration(child, data) returned an error, leaving resolved empty.","commonSituations":"HiveServer2 publishes data in a format the parser does not recognize (custom JSON schema, no serverUri/host keys, no host:port child names); transient ZK errors fetching child data; Hive instances deregistering/crashing mid-discovery; ACLs allowing Children but not Get on child znodes.","solutions":["Inspect the nodeFailures detail in the message: fix per-node causes (usually unparseable registration payloads).","Compare the znode payload (zkCli get /ns/child) against supported formats: JSON with serverUri/server_uri/hiveServer2Uri/uri, service-record JSON, key=value params with serveruri/hiveserver2uri/server_uri, or plain host:port.","Ensure the connecting identity has read ACL on the child znodes, not just the parent.","Restart/re-register stale HiveServer2 instances that publish malformed or empty data."],"exampleFix":"// child data is key=value with an unsupported key\n// znode: port=10002\n// fix: publish a recognized key\nhive.server2.zookeeper.publish.configs=true  // publishes serverUri in configs","handlingStrategy":"try-catch","validationCode":"// preflight: read one child and check it parses as host:port\nconn, _, _ := zk.Connect(zkHosts, 5*time.Second)\nchildren, _, err := conn.Children(\"/\"+ns)\nif err == nil && len(children) > 0 {\n    data, _, _ := conn.Get(\"/\" + ns + \"/\" + children[0])\n    fmt.Printf(\"sample registration: %s=%q\\n\", children[0], data)\n}\nconn.Close()","typeGuard":null,"tryCatchPattern":"eps, err := discovery.Endpoints(ctx, nil)\nif err != nil {\n    var nodeErr error\n    if strings.Contains(err.Error(), \"no usable HiveServer2 nodes\") {\n        nodeErr = err // per-node failures listed; log details for each znode\n    }\n    return fmt.Errorf(\"ZK discovery unusable: %w\", err)\n}","preventionTips":["Keep only HiveServer2 registrations in the discovery namespace.","Verify znode payload format against the driver's supported schemas (JSON serverUri, service record, key=value serveruri, host:port).","Ensure child znodes are readable by the discovery identity, not just the parent.","Pin/normalize HiveServer2's published config format across the cluster."],"tags":["zookeeper","service-discovery","parsing","go"],"backgroundTag":"hiveserver2-registration-unparseable","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"}