{"record":{"id":"f63417fcedad9024","repo":"t8y2/dbx","slug":"unsupported-hiveserver2-zookeeper-registration-q-f63417","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/hive-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/hive-go/discovery.go#L225-L261","documentation":"parseHiveServerRegistration tries several encodings for a HiveServer2 znode — JSON payload, Hive parameters containing serverUri/hiveserver2Uri/server_uri, published config maps, and a bare host:port — for both the node data and the child name. If none yields a valid endpoint, it reports the child name as an unsupported registration format.","triggerScenarios":"Endpoints iterates children of the namespace and one child's data and name match no known registration shape: empty/whitespace-only data with a non-endpoint child name, an unknown JSON schema, or a child name that is not host:port / host:port:protocol.","commonSituations":"Foreign or administrative znodes sitting inside the namespace; a HiveServer2 version publishing a new service-record format; manual test znodes created with zkCli; older/newer Hive protocol markers the driver doesn't recognize.","solutions":["Inspect the failing child (its name is in the message) via zkCli get and confirm what published it.","Remove unrelated znodes from the discovery namespace or move HiveServer2 registrations to a dedicated namespace.","Upgrade the driver to a version supporting your HiveServer2's registration format, or reconfigure the server to publish a supported key (serverUri / hiveserver2Uri / server_uri).","Note this is non-fatal per node: the error is recorded into nodeFailures and other nodes can still be used; fix it only if it makes the namespace unusable."],"exampleFix":"// before (manual znode with free-form text)\nzkCli create /hiveserver2/extra \"some text\"\n// after (parseable registration)\nzkCli create /hiveserver2/extra \"serverUri=10.0.0.5:10000;version=3.1\"","handlingStrategy":"validation","validationCode":"// Validate a registration payload resembles a known format before relying on it\npayload := strings.TrimSpace(string(data))\nvalid := strings.Contains(payload, \"serverUri\") || strings.Contains(payload, \"server_uri\") ||\n    regexp.MustCompile(`^[\\w.:-]+:\\d+`).MatchString(payload)\nif !valid { log.Printf(\"skipping non-standard registration %q\", child) }","typeGuard":"func looksLikeEndpoint(s string) bool {\n    host, port, err := net.SplitHostPort(strings.TrimSpace(s))\n    return err == nil && host != \"\" && port != \"\"\n}","tryCatchPattern":"endpoints, err := discovery.Endpoints(ctx, rejected)\nif err != nil && strings.Contains(err.Error(), \"unsupported HiveServer2 ZooKeeper registration\") {\n    // tolerate unknown children; proceed with whatever else was resolved or fall back\n    endpoints = staticFallback\n}","preventionTips":["Keep foreign znodes out of the discovery namespace","Upgrade driver and server in lockstep","Use the documented published-config keys (serverUri/hiveserver2Uri/server_uri)","Audit namespaces for manually created test znodes"],"tags":["zookeeper","service-discovery","parsing","hiveserver2"],"backgroundTag":"unsupported-service-registration","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"}