{"record":{"id":"6060fec4a95af175","repo":"t8y2/dbx","slug":"hive-discovery-returned-no-endpoints-6060fe","errorCode":null,"errorMessage":"Hive discovery returned no endpoints","messagePattern":"Hive discovery returned no endpoints","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"agents/drivers/hive-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/hive-go/connector.go#L147-L183","documentation":"This error is returned by discoveryConnector.Connect when its Hive ZooKeeper discovery loop produced zero endpoint failures but also zero usable endpoints. It means the discovery process finished without ever attempting or failing a candidate, so no endpoint could be dialed and there is nothing to fail over to.","triggerScenarios":"Calling Connect on a discoveryConnector whose ZooKeeper discovery returned an empty endpoint list with no recorded dial failures — e.g. Endpoints() resolved zero registration nodes before the retry loop started.","commonSituations":"Empty or wrong ZooKeeper znode path (hive.server2.support.dynamic.service.discovery=false so servers never register), zkQuorum pointing at a cluster that has no HiveServer2 registrations, or ACLs silently filtering all children.","solutions":["Verify hive.server2.support.dynamic.service.discovery=true and zookeeper znode (default /hiveserver2) on the servers","Confirm the zkQuorum string is correct and reachable, and that the configured discovery path contains children","Log the candidate list from Endpoints() before Connect; if empty, fix discovery config rather than Connect","Enable ZooKeeper auth so hidden/ACL-protected nodes are visible"],"exampleFix":"// before\nconnector, _ := NewDiscoveryConnector(\"zk-bad-host:2181\", \"\", driver)\nconnector.Connect(ctx)\n// after\nconnector, _ := NewDiscoveryConnector(\"zk1:2181,zk2:2181\", \"/hiveserver2\", driver)\n// ensure servers registered before connecting","handlingStrategy":"retry","validationCode":"// before connecting, check discovery yields candidates\nendpoints, err := discovery.Endpoints(ctx)\nif err != nil { return err }\nif len(endpoints) == 0 {\n    return fmt.Errorf(\"no HiveServer2 registrations under %s; verify discovery config\", discoveryPath)\n}","typeGuard":null,"tryCatchPattern":"if err := connector.Connect(ctx); err != nil {\n    if err.Error() == \"Hive discovery returned no endpoints\" {\n        // re-check znode path / registrations, then retry with backoff\n        return retryWithBackoff(ctx, connector.Connect)\n    }\n    return err\n}","preventionTips":["Confirm hive.server2.support.dynamic.service.discovery=true on all servers","Verify the discovery znode path contains registrations before connecting","Smoke-test ZooKeeper connectivity and child listing with zkCli first"],"tags":["hive","zookeeper","discovery","connection"],"backgroundTag":"no-endpoints-discovered","analyzedSha":"c0390bff16418b651f4728520d99adf8ce48829a","analyzedAt":"2026-09-05T23:05:10.900Z","contentChangedAt":"2026-09-05T23:05:10.900Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}