{"record":{"id":"a995e65829167742","repo":"t8y2/dbx","slug":"json-registration-has-no-endpoint","errorCode":null,"errorMessage":"JSON registration has no endpoint","messagePattern":"JSON registration has no endpoint","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"agents/drivers/argo-go/discovery.go","lineNumber":273,"sourceCode":"\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:\n\t\tport, _ = strconv.Atoi(value)\n\t}\n\tif host != \"\" && port > 0 {\n\t\treturn endpoint{Host: host, Port: port}, nil\n\t}\n\treturn endpoint{}, errors.New(\"JSON registration has no endpoint\")\n}\n\nfunc endpointFromServiceRecord(object map[string]any) (endpoint, bool) {\n\tinternal, _ := object[\"internal\"].([]any)\n\tfor _, rawEndpoint := range internal {\n\t\tpublished, _ := rawEndpoint.(map[string]any)\n\t\tif !strings.EqualFold(registrationStringValue(published[\"api\"]), \"activeEndpoint\") {\n\t\t\tcontinue\n\t\t}\n\t\taddresses, _ := published[\"addresses\"].([]any)\n\t\tfor _, rawAddress := range addresses {\n\t\t\taddress, _ := rawAddress.(map[string]any)\n\t\t\thost := registrationStringValue(address[\"host\"])\n\t\t\tport, _ := strconv.Atoi(registrationStringValue(address[\"port\"]))\n\t\t\tif host != \"\" && port > 0 {\n\t\t\t\tresult := endpoint{Host: host, Port: port}\n\t\t\t\tapplyPublishedHiveConfig(&result, object)\n\t\t\t\treturn result, true","sourceCodeStart":255,"sourceCodeEnd":291,"githubUrl":"https://github.com/t8y2/dbx/blob/c0390bff16418b651f4728520d99adf8ce48829a/agents/drivers/argo-go/discovery.go#L255-L291","documentation":"The ZooKeeper node payload parsed as JSON but none of the recognized endpoint fields (serverUri, server_uri, hiveServer2Uri, uri, or host/port structures) yielded a usable host and positive port, so no endpoint can be constructed. This filters out JSON nodes that are not valid HiveServer2 registrations.","triggerScenarios":"endpointFromRegistrationJSON receives valid JSON that either lacks the known URI keys, has an empty/whitespace URI, or a host/port structure where host is empty or port <= 0 (e.g. port 0 or non-numeric).","commonSituations":"Custom or third-party services writing unrelated JSON into the discovery namespace; Hive service records with missing/misconfigured ports; partially initialized registrations written before the port is known.","solutions":["Fix the HiveServer2 registration so it includes a valid serverUri (host:port) or host/port fields with port > 0","Remove unrelated JSON nodes from the discovery znode path or point discovery at the proper namespace","Confirm hive.server2 port configuration (default 10000) so registrations publish a usable port"],"exampleFix":"// before (znode data)\n\"{\"serviceId\":\"hs2\"}\"\n// after (znode data)\n\"{\"serverUri\":\"host1.example.com:10000\"}\"","handlingStrategy":"type-guard","validationCode":"var rec map[string]any\nif json.Unmarshal([]byte(payload), &rec) == nil {\n\tif uri, ok := rec[\"serverUri\"].(string); !ok || strings.TrimSpace(uri) == \"\" {\n\t\t// skip: JSON but no endpoint\n\t}\n}","typeGuard":"func hasEndpointField(object map[string]any) bool {\n\tfor _, k := range []string{\"serverUri\", \"server_uri\", \"hiveServer2Uri\", \"uri\"} {\n\t\tif s, ok := object[k].(string); ok && strings.TrimSpace(s) != \"\" {\n\t\t\treturn true\n\t\t}\n\t}\n\treturn false\n}","tryCatchPattern":"ep, err := parseHiveServerRegistration(child, data)\nif err != nil {\n\tlog.Printf(\"skipping registration %s: %v\", child, err) // non-fatal\n\tcontinue\n}","preventionTips":["Ensure hive.server2 port is configured (non-zero) so registrations are complete","Keep unrelated JSON writers out of the discovery znode path","Treat registrations without endpoints as skippable noise, not fatal errors"],"tags":["zookeeper","hive","json","configuration"],"backgroundTag":"missing-endpoint-in-registration","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"}