{"record":{"id":"d99768a43e3b7ed8","repo":"t8y2/dbx","slug":"unsupported-hiveserver2-zookeeper-registration-q","errorCode":null,"errorMessage":"unsupported HiveServer2 ZooKeeper registration %q","messagePattern":"unsupported HiveServer2 ZooKeeper registration %q","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"agents/drivers/argo-go/discovery.go","lineNumber":243,"sourceCode":"\t\t\treturn value, nil\n\t\t}\n\t\tparameters := parseHiveParameters(candidate)\n\t\tfor _, key := range []string{\"serveruri\", \"hiveserver2uri\", \"server_uri\"} {\n\t\t\tif raw := parameter(parameters, key); raw != \"\" {\n\t\t\t\treturn parseRegisteredEndpoint(raw)\n\t\t\t}\n\t\t}\n\t\tif value, err := endpointFromPublishedHiveConfig(parameters); err == nil {\n\t\t\treturn value, nil\n\t\t}\n\t\tif strings.Contains(candidate, \"=\") {\n\t\t\tcontinue\n\t\t}\n\t\tif value, err := parseRegisteredEndpoint(candidate); err == nil {\n\t\t\treturn value, nil\n\t\t}\n\t}\n\treturn endpoint{}, fmt.Errorf(\"unsupported HiveServer2 ZooKeeper registration %q\", child)\n}\n\nfunc endpointFromRegistrationJSON(value string) (endpoint, error) {\n\tvar object map[string]any\n\tif json.Unmarshal([]byte(value), &object) != nil {\n\t\treturn endpoint{}, errors.New(\"not JSON\")\n\t}\n\tfor _, key := range []string{\"serverUri\", \"server_uri\", \"hiveServer2Uri\", \"uri\"} {\n\t\tif raw, ok := object[key].(string); ok && strings.TrimSpace(raw) != \"\" {\n\t\t\treturn parseRegisteredEndpoint(raw)\n\t\t}\n\t}\n\tif serviceRecordEndpoint, ok := endpointFromServiceRecord(object); ok {\n\t\treturn serviceRecordEndpoint, nil\n\t}\n\thost, _ := object[\"host\"].(string)\n\tif host == \"\" {\n\t\thost, _ = object[\"hostname\"].(string)","sourceCodeStart":225,"sourceCodeEnd":261,"githubUrl":"https://github.com/t8y2/dbx/blob/c0390bff16418b651f4728520d99adf8ce48829a/agents/drivers/argo-go/discovery.go#L225-L261","documentation":"parseHiveServerRegistration could not extract an endpoint from a HiveServer2 registration znode: neither the node data nor the child name was in any supported format (JSON with known keys, service record, key=value params with serveruri/hiveserver2uri/server_uri, or plain host:port). The child name is quoted in the error so the offending payload can be inspected.","triggerScenarios":"A child znode under the discovery namespace whose data and name both fail endpointFromRegistrationJSON, parameter-key lookup, endpointFromPublishedHiveConfig, and parseRegisteredEndpoint. Surfaced through Endpoints as part of nodeFailures.","commonSituations":"Custom or third-party services (non-HiveServer2) registered in the same namespace; unusual Hive versions publishing a proprietary config format; binary or base64-encoded payloads; child names that are not host:port (e.g. GUIDs).","solutions":["Inspect the znode: zkCli get /<ns>/<child> — compare against supported formats (JSON serverUri/host keys, service record, host:port, serveruri=...).","Exclude non-HiveServer2 services from the discovery namespace or point the namespace config at the path HiveServer2 actually publishes to.","If HiveServer2 publishes an unrecognized format, upgrade the driver or pre-normalize registrations to a supported JSON schema.","Note this error is non-fatal per node — if other children parse fine, discovery succeeds; only worry when ALL nodes fail (error 572)."],"exampleFix":"// znode data: 10.0.0.5;10002  (unsupported)\n// fix: publish supported JSON\n{\"serverUri\":\"10.0.0.5:10002\"}","handlingStrategy":"type-guard","validationCode":"// preflight: check whether a znode payload is parseable before relying on discovery\nfunc looksLikeRegistration(data []byte) bool {\n    s := strings.TrimSpace(string(data))\n    if s == \"\" { return false }\n    if json.Valid([]byte(s)) { return true }\n    if strings.Contains(s, \"=\") { return true }\n    _, _, err := net.SplitHostPort(s)\n    return err == nil\n}","typeGuard":"func isWellFormedRegistration(child string, data []byte) bool {\n    for _, c := range []string{strings.TrimSpace(string(data)), strings.TrimSpace(child)} {\n        if c == \"\" { continue }\n        if json.Valid([]byte(c)) { return true }\n        if strings.Contains(c, \"=\") { return true }\n        if _, _, err := net.SplitHostPort(c); err == nil { return true }\n    }\n    return false\n}","tryCatchPattern":"eps, err := discovery.Endpoints(ctx, nil)\nif err != nil && strings.Contains(err.Error(), \"unsupported HiveServer2 ZooKeeper registration\") {\n    log.Warnw(\"unrecognized registration payload; inspect znode\", \"hint\", err)\n    return fallbackEndpoints, nil\n}","preventionTips":["Inspect znode payloads (zkCli get) when provisioning the namespace.","Restrict the namespace to services publishing supported formats.","Upgrade Hive/driver versions together so registration schemas stay compatible.","Treat single-node parse failures as noise; only intervene when all nodes fail."],"tags":["zookeeper","parsing","service-discovery","go"],"backgroundTag":"hiveserver2-registration-unparseable","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"}