{"record":{"id":"9b7d0c9bc7826549","repo":"t8y2/dbx","slug":"list-zookeeper-namespace-s-w-9b7d0c","errorCode":null,"errorMessage":"list ZooKeeper namespace %s: %w","messagePattern":"list ZooKeeper namespace (.+?): %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"agents/drivers/hive-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/hive-go/discovery.go#L111-L147","documentation":"This error wraps failures from connection.Children(path) while listing the HiveServer2 namespace znode in ZooKeeper (discovery.go:129). It fires when the listing call returns a non-nil error other than zk.ErrNoNode (which is tolerated and skipped). The path is interpolated into the message to identify which namespace failed.","triggerScenarios":"During discovery.Endpoints, connection.Children(path) returns an error that is not ErrNoNode: permission denied on the znode (ACLs), connection dropped mid-session, or session expired.","commonSituations":"HiveServer2 znodes protected by SASL/digest ACLs the client lacks; ZooKeeper session timing out under load; wrong chroot/namespace path in configuration pointing at a restricted znode; zk ensemble flapping.","solutions":["Check ACLs on the namespace znode and ensure the authenticated user has read access.","Verify the configured ZooKeeper namespace path (e.g. /hiveserver2) is correct.","Re-check ZooKeeper ensemble health and session stability.","Retry the connection; if intermittent, investigate zk session timeouts/network drops."],"exampleFix":"// before (path requires auth not configured)\ndsn += \"&zookeeper=zk1:2181/hiveserver2-secure\"\n// after\ndsn += \"&zookeeper=zk1:2181/hiveserver2-secure&zookeeperauth=digest&zookeeperauthdata=svcuser:svcsecret\"","handlingStrategy":"try-catch","validationCode":"// ensure auth is configured for ACL-protected namespaces before listing\nif strings.Contains(zkNamespace, \"secure\") && params[\"zookeeperauth\"] == \"\" {\n    return errors.New(\"secure zookeeper namespace requires auth configuration\")\n}\n","typeGuard":null,"tryCatchPattern":"endpoints, err := discovery.Endpoints(ctx)\nif err != nil && strings.Contains(err.Error(), \"list ZooKeeper namespace\") {\n    // path is embedded in the message; check ACLs/session, then retry\n    return retryWithBackoff(ctx, 3, func() error { _, err := discovery.Endpoints(ctx); return err })\n}\n","preventionTips":["Grant the discovery user read ACLs on the HiveServer2 namespace znode.","Verify the namespace/chroot path is correct before deploying.","Keep zk sessions alive with sane timeouts to avoid mid-list session expiry.","Log the failing namespace path from the error to speed up ACL debugging."],"tags":["zookeeper","acl","discovery","go"],"backgroundTag":"zookeeper-list-failed","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"}