t8y2/dbx · warning

JSON registration has no endpoint

Error message

JSON registration has no endpoint

What it means

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.

Source

Thrown at agents/drivers/hive-go/discovery.go:273

	}
	if serviceRecordEndpoint, ok := endpointFromServiceRecord(object); ok {
		return serviceRecordEndpoint, nil
	}
	host, _ := object["host"].(string)
	if host == "" {
		host, _ = object["hostname"].(string)
	}
	port := 0
	switch value := object["port"].(type) {
	case float64:
		port = int(value)
	case string:
		port, _ = strconv.Atoi(value)
	}
	if host != "" && port > 0 {
		return endpoint{Host: host, Port: port}, nil
	}
	return endpoint{}, errors.New("JSON registration has no endpoint")
}

func endpointFromServiceRecord(object map[string]any) (endpoint, bool) {
	internal, _ := object["internal"].([]any)
	for _, rawEndpoint := range internal {
		published, _ := rawEndpoint.(map[string]any)
		if !strings.EqualFold(registrationStringValue(published["api"]), "activeEndpoint") {
			continue
		}
		addresses, _ := published["addresses"].([]any)
		for _, rawAddress := range addresses {
			address, _ := rawAddress.(map[string]any)
			host := registrationStringValue(address["host"])
			port, _ := strconv.Atoi(registrationStringValue(address["port"]))
			if host != "" && port > 0 {
				result := endpoint{Host: host, Port: port}
				applyPublishedHiveConfig(&result, object)
				return result, true

View on GitHub (pinned to c0390bff16)

Solutions

  1. Dump the offending znode and confirm it is a real HiveServer2 service record
  2. Upgrade/patch the parser if your Hive version uses a new registration schema
  3. Isolate the discovery path so only HiveServer2 writes there; delete foreign nodes
  4. Ensure the registration includes a valid host and positive port

Example fix

// before
[]byte(`{"status":"ok"}`)
// after
[]byte(`{"serverUri":"hs2-host:10000"}`)
Defensive patterns

Strategy: validation

Validate before calling

func hasEndpointKeys(obj map[string]any) bool {
    for _, k := range []string{"serverUri", "server_uri", "hiveServer2Uri", "uri"} {
        if s, ok := obj[k].(string); ok && strings.TrimSpace(s) != "" { return true }
    }
    return false
}

Try / catch

endpoint, err := parseHiveServerRegistration(child, data)
if err != nil && strings.Contains(err.Error(), "JSON registration has no endpoint") {
    log.Printf("registration %q lacks endpoint keys; skipping", child)
    return nil
}

Prevention

When it happens

Trigger: 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.

Common situations: 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.

Understand the failure class

Background: Schema validation failed / invalid input schema: payload rejected because its shape doesn't match the expected schema — this error's family across 28 libraries.

Related errors


AI-assisted analysis of t8y2/dbx@c0390bff16 (2026-09-05). Data as JSON: /api/errors/475f736fa8cd5e51. Report an issue: GitHub.