t8y2/dbx · error

invalid Hive endpoint %q

Error message

invalid Hive endpoint %q

What it means

After all parsing branches, parseEndpoint validates the final host and port: the host must be non-blank and the port must be within 1-65535. Anything else yields this error. Unlike errors 754/755 it carries no wrapped cause because the failure is semantic (out-of-range or empty), not a parse failure.

Source

Thrown at agents/drivers/hive-go/config.go:414

		host = parsedHost
		parsed, parseErr := strconv.Atoi(parsedPort)
		if parseErr != nil {
			return endpoint{}, fmt.Errorf("invalid Hive endpoint %q: %w", value, parseErr)
		}
		port = parsed
	} else if strings.Count(value, ":") == 1 {
		parts := strings.SplitN(value, ":", 2)
		parsed, parseErr := strconv.Atoi(parts[1])
		if parseErr != nil {
			return endpoint{}, fmt.Errorf("invalid Hive endpoint %q: %w", value, parseErr)
		}
		host = parts[0]
		port = parsed
	} else if strings.HasPrefix(value, "[") && strings.HasSuffix(value, "]") {
		host = strings.Trim(value, "[]")
	}
	if strings.TrimSpace(host) == "" || port <= 0 || port > 65535 {
		return endpoint{}, fmt.Errorf("invalid Hive endpoint %q", value)
	}
	return endpoint{Host: host, Port: port}, nil
}

func parseHiveParameters(raw string) map[string]string {
	return parseHiveAssignments(raw, false)
}

func parseHiveAssignments(raw string, lowercaseKeys bool) map[string]string {
	result := map[string]string{}
	trimmed := strings.Trim(strings.TrimSpace(raw), "?#&;")
	for _, part := range strings.FieldsFunc(trimmed, func(char rune) bool { return char == ';' || char == '&' }) {
		part = strings.TrimSpace(part)
		if part == "" {
			continue
		}
		key, value, found := strings.Cut(part, "=")
		key = strings.TrimSpace(key)

View on GitHub (pinned to c0390bff16)

Solutions

  1. Provide a non-empty host and a port in 1-65535
  2. Remove blank/whitespace entries from the endpoint list
  3. Fix the numeric port if it is 0 or above 65535
  4. Split multi-endpoint values and check each one individually

Example fix

// before
config.Endpoints = []string{"host:0"}
// after
config.Endpoints = []string{"host:10000"}
Defensive patterns

Strategy: validation

Validate before calling

func checkEndpoint(host string, port int) error {
    if strings.TrimSpace(host) == "" { return errors.New("empty host") }
    if port <= 0 || port > 65535 { return fmt.Errorf("port %d out of range", port) }
    return nil
}

Try / catch

if _, err := parseEndpoint(v); err != nil && !strings.Contains(err.Error(), ": ") /* no wrapped cause */ {
    return fmt.Errorf("endpoint %q: host required, port must be 1-65535", v)
}

Prevention

When it happens

Trigger: Endpoints like 'host:0', 'host:70000', ':10000' (empty host), ' ' (whitespace-only), or '[::1]' variants that end up with an empty trimmed host or out-of-range port.

Common situations: Port 0 used to mean 'any' but is rejected here; truncated config leaving an empty host; computed ports overflowing 65535; env vars set to empty string producing blank endpoints.

Related errors


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