t8y2/dbx · error

HiveServer2 ZooKeeper namespace not found; tried %s

Error message

HiveServer2 ZooKeeper namespace not found; tried %s

What it means

Endpoints() walked every candidate ZooKeeper namespace path and none of them exist (all returned zk.ErrNoNode), so no HiveServer2 instances could be discovered. It is thrown when listedPath remains empty after the path loop. The message enumerates the exact paths tried to help diagnose namespace misconfiguration.

Source

Thrown at agents/drivers/argo-go/discovery.go:155

				}
				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))
			}
		}
		if len(resolved) > 0 {
			break
		}
	}
	resolved = shuffledEndpoints(uniqueEndpoints(resolved), rejected)
	if len(resolved) == 0 {
		if listedPath == "" {
			return nil, fmt.Errorf("HiveServer2 ZooKeeper namespace not found; tried %s", strings.Join(discovery.paths(), ", "))
		}
		if len(nodeFailures) > 0 {
			return nil, fmt.Errorf("no usable HiveServer2 nodes in ZooKeeper namespace %s: %s", listedPath, strings.Join(nodeFailures, "; "))
		}
		return nil, fmt.Errorf("no available HiveServer2 nodes in ZooKeeper namespace %s", listedPath)
	}
	return resolved, nil
}

func (discovery *zooKeeperDiscovery) paths() []string {
	namespace := strings.Trim(discovery.namespace, "/")
	if strings.EqualFold(discovery.discoveryMode, "zookeeperha") {
		return []string{
			zooKeeperPath(namespace, "instances"),
			zooKeeperPath(namespace+"-unsecure", "instances"),
			zooKeeperPath(namespace+"-sasl", "instances"),
		}
	}

View on GitHub (pinned to c0390bff16)

Solutions

  1. Check the namespace znode with zkCli: ls /<namespace> and confirm HiveServer2 children exist; correct the zooKeeperNamespace config value.
  2. If using zookeeperha mode, confirm the znode layout is <ns>/instances; if Hive publishes directly under the namespace, use plain zookeeper mode.
  3. Verify serviceDiscoveryMode=zookeeper and that HiveServer2 has dynamic service discovery enabled and is registered to the same ensemble.
  4. Verify zooKeeper server list points at the ensemble HiveServer2 actually publishes to.

Example fix

// before
serviceDiscoveryMode=zookeeperha, zooKeeperNamespace=hs2   // expects /hs2/instances
// after — znode layout is flat
serviceDiscoveryMode=zookeeper, zooKeeperNamespace=hs2
Defensive patterns

Strategy: validation

Validate before calling

// preflight: confirm at least one candidate path exists
conn, _, _ := zk.Connect(zkHosts, 5*time.Second)
for _, p := range []string{"/"+ns, "/"+ns+"/instances"} {
    if _, _, err := conn.Children(p); err == nil {
        conn.Close(); return nil
    }
}
conn.Close()
return fmt.Errorf("no ZooKeeper namespace found for %s", ns)

Try / catch

eps, err := discovery.Endpoints(ctx, nil)
if err != nil && strings.Contains(err.Error(), "namespace not found") {
    // configuration problem: surface config values for the operator
    return fmt.Errorf("check serviceDiscoveryMode/zooKeeperNamespace (mode=%s ns=%s): %w", mode, ns, err)
}

Prevention

When it happens

Trigger: connection.Children(path) returned zk.ErrNoNode for every path in discovery.paths() — in zookeeperha mode that is <ns>/instances, <ns>-unsecure/instances, <ns>-sasl/instances; in plain zookeeper mode just /<ns>.

Common situations: Wrong zooKeeperNamespace in the connection config; HiveServer2 not configured to publish to ZooKeeper (hive.server2.support.dynamic.service.discovery=false); namespace exists but without the /instances suffix expected in zookeeperha mode; different ZK cluster than the one Hive publishes to.

Related errors


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