{"record":{"id":"a31f12d1a0a68be3","repo":"t8y2/dbx","slug":"list-zookeeper-namespace-s-w","errorCode":null,"errorMessage":"list ZooKeeper namespace %s: %w","messagePattern":"list ZooKeeper namespace (.+?): %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"agents/drivers/argo-go/discovery.go","lineNumber":129,"sourceCode":"\t}\n\tif discovery.authScheme != \"\" || discovery.auth != \"\" {\n\t\tif discovery.authScheme == \"\" || discovery.auth == \"\" {\n\t\t\treturn nil, errors.New(\"ZooKeeper auth scheme and credentials must be configured together\")\n\t\t}\n\t\tif err := connection.AddAuth(discovery.authScheme, []byte(discovery.auth)); err != nil {\n\t\t\treturn nil, fmt.Errorf(\"authenticate to ZooKeeper: %w\", err)\n\t\t}\n\t}\n\tresolved := make([]endpoint, 0)\n\tvar listedPath string\n\tvar nodeFailures []string\n\tfor _, path := range discovery.paths() {\n\t\tchildren, _, childrenErr := connection.Children(path)\n\t\tif errors.Is(childrenErr, zk.ErrNoNode) {\n\t\t\tcontinue\n\t\t}\n\t\tif childrenErr != nil {\n\t\t\treturn nil, fmt.Errorf(\"list ZooKeeper namespace %s: %w\", path, childrenErr)\n\t\t}\n\t\tlistedPath = path\n\t\tfor _, child := range children {\n\t\t\tdata, _, dataErr := connection.Get(path + \"/\" + child)\n\t\t\tif dataErr != nil {\n\t\t\t\tif errors.Is(dataErr, zk.ErrNoNode) {\n\t\t\t\t\tcontinue\n\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}","sourceCodeStart":111,"sourceCodeEnd":147,"githubUrl":"https://github.com/t8y2/dbx/blob/c0390bff16418b651f4728520d99adf8ce48829a/agents/drivers/argo-go/discovery.go#L111-L147","documentation":"Endpoints() fails to list the children of a ZooKeeper path used for HiveServer2 service discovery. The Children() call on the zooKeeperClient returned a non-nil error that is not zk.ErrNoNode, so discovery aborts and wraps the underlying zk error with the offending path. This signals a problem with the ZooKeeper session, ACLs, or the ensemble rather than simply a missing namespace.","triggerScenarios":"connection.Children(path) returns a non-ErrNoNode error during Endpoints(): permission denied on the znode, connection lost mid-call, session expired, or an invalid path.","commonSituations":"ZooKeeper ACLs deny read access to the HiveServer2 namespace; the ZK ensemble was restarted and the session dropped; a network partition between client and ensemble; a Kerberos/SASL-authenticated ZK where the client lacks read rights on the node.","solutions":["Check the wrapped error: if it is permission/NoAuth, grant the connecting identity read access to the namespace znode (or configure zooKeeperAuthScheme/zooKeeperAuth).","If it is a connection-loss/expired-session error, verify ZooKeeper server addresses and network stability, then retry Endpoints().","Verify the namespace path spelling in the connection config; wrong ACL'd or deleted znodes surface here.","Enable TLS/Kerberos configuration correctly (zooKeeperTLSConfig, ZooKeeperKerberos) — auth mismatches often surface as ZK errors on Children."],"exampleFix":"// before\nchildren, _, err := conn.Children(\"/hiveserver2\")\n// after — retry transient zk errors before giving up\nchildren, _, err := conn.Children(\"/hiveserver2\")\nif err != nil && errors.Is(err, zk.ErrConnectionClosed) {\n    // reconnect and retry once before failing\n}","handlingStrategy":"retry","validationCode":"// preflight: verify the ZK namespace znode is readable\nconn, _, err := zk.Connect([]string{zkHost}, 5*time.Second)\nif err != nil { return err }\n_, _, err = conn.Children(\"/\"+namespace)\nconn.Close()\nreturn err","typeGuard":null,"tryCatchPattern":"var eps []endpoint\nerr := retry(3, time.Second, func() error {\n    var e error\n    eps, e = discovery.Endpoints(ctx, nil)\n    if e != nil && !strings.Contains(e.Error(), \"list ZooKeeper namespace\") {\n        return nil // non-transient\n    }\n    return e\n})\nif err != nil { return fmt.Errorf(\"discovery failed: %w\", err) }","preventionTips":["Grant the connecting identity read ACL on the namespace znode.","Match auth config (scheme+credentials, Kerberos, TLS) to the ensemble's setup before deploying.","Monitor ZK ensemble health; retry transient session-loss errors.","Validate namespace path spelling in config at startup."],"tags":["zookeeper","service-discovery","network","go"],"backgroundTag":"zookeeper-children-error","analyzedSha":"c0390bff16418b651f4728520d99adf8ce48829a","analyzedAt":"2026-09-05T23:05:10.900Z","contentChangedAt":"2026-09-05T23:05:10.900Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}