t8y2/dbx · error

published HiveServer2 configuration has no valid host and po

Error message

published HiveServer2 configuration has no valid host and port

What it means

endpointFromPublishedHiveConfig reconstructs the endpoint from the published HiveServer2 configuration map but found no usable host and port: the host was empty, the thrift port failed strconv.Atoi, or the port was <= 0. For HTTP transport it falls back from hive.server2.thrift.http.port to the default thrift port before validating.

Source

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

	target.HTTPPath = strings.TrimPrefix(value("hive.server2.thrift.http.path"), "/")
	target.Auth = strings.ToUpper(value("hive.server2.authentication"))
	target.Principal = value("hive.server2.authentication.kerberos.principal")
	target.SSL = strings.EqualFold(value("hive.server2.use.ssl"), "true")
}

func endpointFromPublishedHiveConfig(parameters map[string]string) (endpoint, error) {
	host := firstNonEmpty(
		parameter(parameters, "hive.server2.thrift.bind.host"),
		parameter(parameters, "host"),
	)
	transportMode := strings.ToLower(parameter(parameters, "hive.server2.transport.mode"))
	portValue := parameter(parameters, "hive.server2.thrift.port")
	if transportMode == "http" {
		portValue = firstNonEmpty(parameter(parameters, "hive.server2.thrift.http.port"), portValue)
	}
	port, err := strconv.Atoi(portValue)
	if host == "" || err != nil || port <= 0 {
		return endpoint{}, errors.New("published HiveServer2 configuration has no valid host and port")
	}
	return endpoint{
		Host:          host,
		Port:          port,
		TransportMode: transportMode,
		HTTPPath:      strings.TrimPrefix(parameter(parameters, "hive.server2.thrift.http.path"), "/"),
		Auth:          strings.ToUpper(parameter(parameters, "hive.server2.authentication")),
		Principal:     parameter(parameters, "hive.server2.authentication.kerberos.principal"),
		SSL:           parameterBool(parameters, "hive.server2.use.ssl"),
	}, nil
}

func parseRegisteredEndpoint(value string) (endpoint, error) {
	value = strings.TrimSpace(value)
	if parsed, err := url.Parse(value); err == nil && parsed.Hostname() != "" {
		port := defaultHivePort
		if parsed.Port() != "" {
			parsedPort, parseErr := strconv.Atoi(parsed.Port())

View on GitHub (pinned to c0390bff16)

Solutions

  1. Set hive.server2.thrift.bind.host and hive.server2.thrift.port explicitly in hive-site.xml and restart HiveServer2
  2. If using http transport, configure hive.server2.thrift.http.port explicitly
  3. Inspect the published parameters in the znode to see which keys are actually present
  4. Patch the parser if your Hive release publishes keys under different names

Example fix

// before
<property><name>hive.server2.thrift.port</name><value>0</value></property>
// after
<property><name>hive.server2.thrift.port</name><value>10000</value></property>
Defensive patterns

Strategy: validation

Validate before calling

host := params["hive.server2.thrift.bind.host"]
portStr := params["hive.server2.thrift.port"]
port, err := strconv.Atoi(portStr)
if host == "" || err != nil || port <= 0 {
    return errors.New("published HiveServer2 config missing valid host/port; fix hive-site.xml")
}

Try / catch

endpoint, err := parseHiveServerRegistration(child, data)
if err != nil && strings.Contains(err.Error(), "no valid host and port") {
    return fmt.Errorf("server %s published incomplete config: %w", child, err)
}

Prevention

When it happens

Trigger: parseHiveServerRegistration matched a published-config style registration whose parameter map lacks hive.server2.thrift.bind.host or has a missing/non-numeric/zero thrift port (with no valid http.port override for http transport).

Common situations: HiveServer2 published with default bind address empty, port configured as 0 (dynamic port), custom keys in hive-site.xml not published into the registration, or HTTP transport without an http.port parameter.

Understand the failure class

Background: "missing required config value" errors: why libraries refuse to start when a configuration key is empty, unset, or blank — this error's family across 48 libraries.

Related errors


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