{"record":{"id":"012a3d85bb386be9","repo":"t8y2/dbx","slug":"not-json","errorCode":null,"errorMessage":"not JSON","messagePattern":"not JSON","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"agents/drivers/argo-go/discovery.go","lineNumber":249,"sourceCode":"\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)\n\t}\n\tport := 0\n\tswitch value := object[\"port\"].(type) {\n\tcase float64:\n\t\tport = int(value)\n\tcase string:","sourceCodeStart":231,"sourceCodeEnd":267,"githubUrl":"https://github.com/t8y2/dbx/blob/c0390bff16418b651f4728520d99adf8ce48829a/agents/drivers/argo-go/discovery.go#L231-L267","documentation":"Returned by endpointFromRegistrationJSON in the argo-go Hive driver when a HiveServer2 ZooKeeper registration payload cannot be unmarshalled as a JSON object. It is a low-level sentinel: the caller treats it as 'this child is not JSON' and falls back to other parsing strategies (published config, key=value, registered-endpoint format) before the outer 'unsupported registration' error is produced.","triggerScenarios":"A /hiveserver2 znode child whose data is not JSON — empty payload, legacy plaintext 'host:port' strings, binary/corrupt data, or a foreign znode created by another service — passed through parseHiveServerRegistration to endpointFromRegistrationJSON.","commonSituations":"Mixed clusters where some nodes publish legacy (non-JSON) registrations; stale znodes left by older Hive versions; an unrelated service sharing the namespace; truncated writes.","solutions":["Ensure all HiveServer2 instances publish JSON service records (dynamic discovery mode, Hive >= 0.14) and clean stale legacy znodes","Point discovery at the correct znode namespace so foreign nodes are excluded","If you need legacy support, register the endpoint as a plain host:port child rather than through the JSON parser"],"exampleFix":"// before (znode data)\n\"host1.example.com:10000\"\n// after (znode data)\n\"{\"serverUri\":\"host1.example.com:10000\"}\"","handlingStrategy":"validation","validationCode":"var probe map[string]any\nif json.Unmarshal([]byte(payload), &probe) != nil {\n\t// skip node: legacy or corrupt registration\n}","typeGuard":"func isJSONRegistration(data []byte) bool {\n\tvar v map[string]any\n\treturn json.Unmarshal(data, &v) == nil\n}","tryCatchPattern":"eps, err := parseHiveServerRegistration(child, data)\nif err != nil {\n\tlog.Printf(\"skipping znode %s: %v\", child, err) // non-fatal, try next\n\tcontinue\n}","preventionTips":["Clean legacy plaintext znodes out of /hiveserver2 after upgrading Hive","Restrict the discovery namespace to nodes HS2 actually owns","Log-and-skip unparseable nodes instead of failing the whole discovery"],"tags":["zookeeper","hive","json","service-discovery"],"backgroundTag":"invalid-json-payload","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"}