t8y2/dbx · error

no available HiveServer2 nodes in ZooKeeper namespace %s

Error message

no available HiveServer2 nodes in ZooKeeper namespace %s

What it means

Endpoints() successfully listed a namespace (listedPath is set) and every child was read and parsed, yet zero unique endpoints remained after deduplication. This means the namespace contains registrations but none resolved to a reachable HiveServer2 endpoint record.

Source

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

			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"),
		}
	}
	return []string{zooKeeperPath(namespace)}
}

func zooKeeperPath(parts ...string) string {
	cleaned := make([]string, 0, len(parts))

View on GitHub (pinned to c0390bff16)

Solutions

  1. Inspect the znode data under the namespace (zkCli get) and confirm it contains a valid host:port serverUri.
  2. Ensure at least one healthy HiveServer2 is registered; start the server with dynamic service discovery enabled.
  3. Verify the parsed endpoint fields (host/port) are populated in the servers' published configuration.
  4. Re-check the namespace — a similarly named but wrong namespace may contain only non-serving registrations.
Defensive patterns

Strategy: retry

Validate before calling

// Check a child actually parses to host:port before discovery
data, _, _ := conn.Get("/hiveserver2/instances/node1")
fmt.Println("registration payload:", string(data)) // must contain serverUri or be host:port

Try / catch

endpoints, err := discovery.Endpoints(ctx, rejected)
if err != nil {
    if strings.Contains(err.Error(), "no available HiveServer2 nodes") {
        time.Sleep(retryInterval)
        endpoints, err = discovery.Endpoints(ctx, rejected)
    }
    if err != nil { return err }
}

Prevention

When it happens

Trigger: Calling Endpoints against a namespace whose children parse to endpoints that dedupe to nothing, or whose registrations resolve to empty/invalid endpoint values that are dropped; distinct children publishing identical data is the typical path — after uniqueEndpoints() the resolved set is empty only if nothing valid was collected, which here means all parsed entries were filtered out.

Common situations: A namespace populated with placeholder or test znodes whose data parses but yields no usable host:port; an empty cluster where nodes deregistered leaving metadata-only children; misconfigured published configs lacking host/port fields.

Related errors


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