{"record":{"id":"475f736fa8cd5e51","repo":"t8y2/dbx","slug":"json-registration-has-no-endpoint-475f73","errorCode":null,"errorMessage":"JSON registration has no endpoint","messagePattern":"JSON registration has no endpoint","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"agents/drivers/hive-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/hive-go/discovery.go#L255-L291","documentation":"The registration node parsed as JSON but contained no recognizable endpoint: none of the known URI keys (serverUri, server_uri, hiveServer2Uri, uri) held a usable string and no host/port fields yielded a valid port. The object is structurally valid JSON but semantically not a HiveServer2 registration.","triggerScenarios":"endpointFromRegistrationJSON received a JSON object without endpoint keys — e.g. a foreign service record, an empty object {}, or host/port values that are wrong types or non-positive.","commonSituations":"Another service sharing the discovery znode path, HiveServer2 registered via a newer schema with different keys, port set to 0 or omitted, host stored under an unexpected key.","solutions":["Dump the offending znode and confirm it is a real HiveServer2 service record","Upgrade/patch the parser if your Hive version uses a new registration schema","Isolate the discovery path so only HiveServer2 writes there; delete foreign nodes","Ensure the registration includes a valid host and positive port"],"exampleFix":"// before\n[]byte(`{\"status\":\"ok\"}`)\n// after\n[]byte(`{\"serverUri\":\"hs2-host:10000\"}`)","handlingStrategy":"validation","validationCode":"func hasEndpointKeys(obj map[string]any) bool {\n    for _, k := range []string{\"serverUri\", \"server_uri\", \"hiveServer2Uri\", \"uri\"} {\n        if s, ok := obj[k].(string); ok && strings.TrimSpace(s) != \"\" { return true }\n    }\n    return false\n}","typeGuard":null,"tryCatchPattern":"endpoint, err := parseHiveServerRegistration(child, data)\nif err != nil && strings.Contains(err.Error(), \"JSON registration has no endpoint\") {\n    log.Printf(\"registration %q lacks endpoint keys; skipping\", child)\n    return nil\n}","preventionTips":["Verify your Hive version's registration schema and parser key coverage","Confirm registrations contain a non-empty host and positive port","Isolate the discovery path from non-HiveServer2 service records"],"tags":["zookeeper","json","schema","hive"],"backgroundTag":"schema-validation-failed","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"}