t8y2/dbx · critical
Hive discovery returned no endpoints
Error message
Hive discovery returned no endpoints
What it means
Connect resolves HiveServer2 endpoints via service discovery (ZooKeeper). If the discovery process produced no recorded failures yet also yielded zero usable endpoints, the driver has nothing to connect to and returns this error. It distinguishes 'no endpoints at all' from 'all endpoints failed' (the latter produces the aggregated 'all HiveServer2 endpoints failed' error).
Source
Thrown at agents/drivers/argo-go/connector.go:165
return connection, nil
}
rejected[target.address()] = true
failures = append(failures, fmt.Sprintf("attempt %d %s: %v", attempt+1, target.address(), connectErr))
}
break
}
if attempt+1 < connector.retries && connector.retryInterval > 0 {
timer := time.NewTimer(connector.retryInterval)
select {
case <-ctx.Done():
timer.Stop()
return nil, ctx.Err()
case <-timer.C:
}
}
}
if len(failures) == 0 {
return nil, errors.New("Hive discovery returned no endpoints")
}
return nil, fmt.Errorf("all HiveServer2 endpoints failed: %s", strings.Join(failures, "; "))
}
func (connector *discoveryConnector) Driver() driver.Driver {
return connector.driver
}
func openHiveDatabase(config connectionConfig) *sql.DB {
database := sql.OpenDB(newDiscoveryConnector(config))
database.SetMaxOpenConns(1)
database.SetMaxIdleConns(1)
return database
}
func normalizeHiveAuth(value string) string {
normalized := strings.ToUpper(strings.TrimSpace(value))
switch normalized {View on GitHub (pinned to c0390bff16)
Solutions
- Verify the ZooKeeper quorum hosts/paths in the connection config point to the namespace where HiveServer2 publishes (e.g. /hiveserver2)
- Confirm HiveServer2 is running with dynamic service discovery enabled and registered in ZooKeeper (zkCli.sh ls /hiveserver2)
- Retry once ZooKeeper is reachable — transient discovery failures can yield an empty endpoint set
Example fix
// before dsn := "hive://user@zk1:2181,zk2:2181/default?serviceDiscovery=zooKeeper" // after dsn := "hive://user@zk1:2181,zk2:2181/default?serviceDiscovery=zooKeeper&zookeeperNamespace=/hiveserver2" // plus ensure HS2 is registered
Defensive patterns
Strategy: retry
Validate before calling
conn, _, err := zk.Connect(hosts, timeout)
if err != nil { return err }
children, _, err := conn.Children("/hiveserver2")
if err != nil { return err }
if len(children) == 0 { return errors.New("no HiveServer2 registered in ZooKeeper yet") } Try / catch
endpoints, err := connector.Connect(ctx)
if err != nil {
if strings.Contains(err.Error(), "no endpoints") {
// back off and retry discovery; likely HS2 not yet registered
time.Sleep(retryInterval)
retry...
}
} Prevention
- Confirm hiveserver2 dynamic service discovery is enabled and HS2 shows up under /hiveserver2 in zkCli
- Use the correct zookeeperNamespace matching your Hive deployment
- Add retry-with-backoff around discovery-based connects for startup races
When it happens
Trigger: Calling Connect (or TestDiscoveryConnectorFailsOver/TestDiscoveryConnectorRetriesAllEndpoints flows) where the ZooKeeper service discovery node list is empty, all registration children are unparseable/skipped without error, or the endpoint iterator exits immediately with no attempts recorded.
Common situations: HiveServer2 is not publishing to ZooKeeper (zookeeper quorum misconfigured or hiveserver2.active_discovery not enabled); the znode path is wrong; dynamic service discovery mode not enabled on the Hive side; network partition leaves an empty/stale znode tree.
Related errors
- not JSON
- JSON registration has no endpoint
- HiveServer2 ZooKeeper namespace not found; tried %s
- HiveServer2 ZooKeeper namespace not found; tried %s
- Hive host is required
AI-assisted analysis of t8y2/dbx@c0390bff16 (2026-09-05).
Data as JSON: /api/errors/207f36b82ce60fb6.
Report an issue: GitHub.