t8y2/dbx · warning

not JSON

Error message

not JSON

What it means

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.

Source

Thrown at agents/drivers/argo-go/discovery.go:249

			}
		}
		if value, err := endpointFromPublishedHiveConfig(parameters); err == nil {
			return value, nil
		}
		if strings.Contains(candidate, "=") {
			continue
		}
		if value, err := parseRegisteredEndpoint(candidate); err == nil {
			return value, nil
		}
	}
	return endpoint{}, fmt.Errorf("unsupported HiveServer2 ZooKeeper registration %q", child)
}

func endpointFromRegistrationJSON(value string) (endpoint, error) {
	var object map[string]any
	if json.Unmarshal([]byte(value), &object) != nil {
		return endpoint{}, errors.New("not JSON")
	}
	for _, key := range []string{"serverUri", "server_uri", "hiveServer2Uri", "uri"} {
		if raw, ok := object[key].(string); ok && strings.TrimSpace(raw) != "" {
			return parseRegisteredEndpoint(raw)
		}
	}
	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:

View on GitHub (pinned to c0390bff16)

Solutions

  1. Ensure all HiveServer2 instances publish JSON service records (dynamic discovery mode, Hive >= 0.14) and clean stale legacy znodes
  2. Point discovery at the correct znode namespace so foreign nodes are excluded
  3. If you need legacy support, register the endpoint as a plain host:port child rather than through the JSON parser

Example fix

// before (znode data)
"host1.example.com:10000"
// after (znode data)
"{"serverUri":"host1.example.com:10000"}"
Defensive patterns

Strategy: validation

Validate before calling

var probe map[string]any
if json.Unmarshal([]byte(payload), &probe) != nil {
	// skip node: legacy or corrupt registration
}

Type guard

func isJSONRegistration(data []byte) bool {
	var v map[string]any
	return json.Unmarshal(data, &v) == nil
}

Try / catch

eps, err := parseHiveServerRegistration(child, data)
if err != nil {
	log.Printf("skipping znode %s: %v", child, err) // non-fatal, try next
	continue
}

Prevention

When it happens

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

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

Related errors


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