t8y2/dbx · error

list ZooKeeper namespace %s: %w

Error message

list ZooKeeper namespace %s: %w

What it means

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.

Source

Thrown at agents/drivers/hive-go/discovery.go:129

	}
	if discovery.authScheme != "" || discovery.auth != "" {
		if discovery.authScheme == "" || discovery.auth == "" {
			return nil, errors.New("ZooKeeper auth scheme and credentials must be configured together")
		}
		if err := connection.AddAuth(discovery.authScheme, []byte(discovery.auth)); err != nil {
			return nil, fmt.Errorf("authenticate to ZooKeeper: %w", err)
		}
	}
	resolved := make([]endpoint, 0)
	var listedPath string
	var nodeFailures []string
	for _, path := range discovery.paths() {
		children, _, childrenErr := connection.Children(path)
		if errors.Is(childrenErr, zk.ErrNoNode) {
			continue
		}
		if childrenErr != nil {
			return nil, fmt.Errorf("list ZooKeeper namespace %s: %w", path, childrenErr)
		}
		listedPath = path
		for _, child := range children {
			data, _, dataErr := connection.Get(path + "/" + child)
			if dataErr != nil {
				if errors.Is(dataErr, zk.ErrNoNode) {
					continue
				}
				nodeFailures = append(nodeFailures, fmt.Sprintf("%s/%s: %v", path, child, dataErr))
				continue
			}
			value, parseErr := parseHiveServerRegistration(child, data)
			if parseErr == nil {
				resolved = append(resolved, value)
			} else {
				nodeFailures = append(nodeFailures, fmt.Sprintf("%s/%s: %v", path, child, parseErr))
			}
		}

View on GitHub (pinned to c0390bff16)

Solutions

  1. Check ACLs on the namespace znode and ensure the authenticated user has read access.
  2. Verify the configured ZooKeeper namespace path (e.g. /hiveserver2) is correct.
  3. Re-check ZooKeeper ensemble health and session stability.
  4. Retry the connection; if intermittent, investigate zk session timeouts/network drops.

Example fix

// before (path requires auth not configured)
dsn += "&zookeeper=zk1:2181/hiveserver2-secure"
// after
dsn += "&zookeeper=zk1:2181/hiveserver2-secure&zookeeperauth=digest&zookeeperauthdata=svcuser:svcsecret"
Defensive patterns

Strategy: try-catch

Validate before calling

// ensure auth is configured for ACL-protected namespaces before listing
if strings.Contains(zkNamespace, "secure") && params["zookeeperauth"] == "" {
    return errors.New("secure zookeeper namespace requires auth configuration")
}

Try / catch

endpoints, err := discovery.Endpoints(ctx)
if err != nil && strings.Contains(err.Error(), "list ZooKeeper namespace") {
    // path is embedded in the message; check ACLs/session, then retry
    return retryWithBackoff(ctx, 3, func() error { _, err := discovery.Endpoints(ctx); return err })
}

Prevention

When it happens

Trigger: 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.

Common situations: 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.

Related errors


AI-assisted analysis of t8y2/dbx@c0390bff16 (2026-09-05). Data as JSON: /api/errors/9b7d0c9bc7826549. Report an issue: GitHub.