{"record":{"id":"207f36b82ce60fb6","repo":"t8y2/dbx","slug":"hive-discovery-returned-no-endpoints","errorCode":null,"errorMessage":"Hive discovery returned no endpoints","messagePattern":"Hive discovery returned no endpoints","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"critical","filePath":"agents/drivers/argo-go/connector.go","lineNumber":165,"sourceCode":"\t\t\t\t\treturn connection, nil\n\t\t\t\t}\n\t\t\t\trejected[target.address()] = true\n\t\t\t\tfailures = append(failures, fmt.Sprintf(\"attempt %d %s: %v\", attempt+1, target.address(), connectErr))\n\t\t\t}\n\t\t\tbreak\n\t\t}\n\t\tif attempt+1 < connector.retries && connector.retryInterval > 0 {\n\t\t\ttimer := time.NewTimer(connector.retryInterval)\n\t\t\tselect {\n\t\t\tcase <-ctx.Done():\n\t\t\t\ttimer.Stop()\n\t\t\t\treturn nil, ctx.Err()\n\t\t\tcase <-timer.C:\n\t\t\t}\n\t\t}\n\t}\n\tif len(failures) == 0 {\n\t\treturn nil, errors.New(\"Hive discovery returned no endpoints\")\n\t}\n\treturn nil, fmt.Errorf(\"all HiveServer2 endpoints failed: %s\", strings.Join(failures, \"; \"))\n}\n\nfunc (connector *discoveryConnector) Driver() driver.Driver {\n\treturn connector.driver\n}\n\nfunc openHiveDatabase(config connectionConfig) *sql.DB {\n\tdatabase := sql.OpenDB(newDiscoveryConnector(config))\n\tdatabase.SetMaxOpenConns(1)\n\tdatabase.SetMaxIdleConns(1)\n\treturn database\n}\n\nfunc normalizeHiveAuth(value string) string {\n\tnormalized := strings.ToUpper(strings.TrimSpace(value))\n\tswitch normalized {","sourceCodeStart":147,"sourceCodeEnd":183,"githubUrl":"https://github.com/t8y2/dbx/blob/c0390bff16418b651f4728520d99adf8ce48829a/agents/drivers/argo-go/connector.go#L147-L183","documentation":"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).","triggerScenarios":"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.","commonSituations":"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.","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"],"exampleFix":"// before\ndsn := \"hive://user@zk1:2181,zk2:2181/default?serviceDiscovery=zooKeeper\"\n// after\ndsn := \"hive://user@zk1:2181,zk2:2181/default?serviceDiscovery=zooKeeper&zookeeperNamespace=/hiveserver2\" // plus ensure HS2 is registered","handlingStrategy":"retry","validationCode":"conn, _, err := zk.Connect(hosts, timeout)\nif err != nil { return err }\nchildren, _, err := conn.Children(\"/hiveserver2\")\nif err != nil { return err }\nif len(children) == 0 { return errors.New(\"no HiveServer2 registered in ZooKeeper yet\") }","typeGuard":null,"tryCatchPattern":"endpoints, err := connector.Connect(ctx)\nif err != nil {\n\tif strings.Contains(err.Error(), \"no endpoints\") {\n\t\t// back off and retry discovery; likely HS2 not yet registered\n\t\ttime.Sleep(retryInterval)\n\t\tretry...\n\t}\n}","preventionTips":["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"],"tags":["hive","zookeeper","service-discovery","configuration"],"backgroundTag":"discovery-returned-no-endpoints","analyzedSha":"c0390bff16418b651f4728520d99adf8ce48829a","analyzedAt":"2026-09-05T23:05:10.900Z","contentChangedAt":"2026-09-05T23:05:10.900Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}