{"record":{"id":"114c4198b45bd450","repo":"t8y2/dbx","slug":"published-hiveserver2-configuration-has-no-valid-h-114c41","errorCode":null,"errorMessage":"published HiveServer2 configuration has no valid host and port","messagePattern":"published HiveServer2 configuration has no valid host and port","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"agents/drivers/hive-go/discovery.go","lineNumber":339,"sourceCode":"\ttarget.HTTPPath = strings.TrimPrefix(value(\"hive.server2.thrift.http.path\"), \"/\")\n\ttarget.Auth = strings.ToUpper(value(\"hive.server2.authentication\"))\n\ttarget.Principal = value(\"hive.server2.authentication.kerberos.principal\")\n\ttarget.SSL = strings.EqualFold(value(\"hive.server2.use.ssl\"), \"true\")\n}\n\nfunc endpointFromPublishedHiveConfig(parameters map[string]string) (endpoint, error) {\n\thost := firstNonEmpty(\n\t\tparameter(parameters, \"hive.server2.thrift.bind.host\"),\n\t\tparameter(parameters, \"host\"),\n\t)\n\ttransportMode := strings.ToLower(parameter(parameters, \"hive.server2.transport.mode\"))\n\tportValue := parameter(parameters, \"hive.server2.thrift.port\")\n\tif transportMode == \"http\" {\n\t\tportValue = firstNonEmpty(parameter(parameters, \"hive.server2.thrift.http.port\"), portValue)\n\t}\n\tport, err := strconv.Atoi(portValue)\n\tif host == \"\" || err != nil || port <= 0 {\n\t\treturn endpoint{}, errors.New(\"published HiveServer2 configuration has no valid host and port\")\n\t}\n\treturn endpoint{\n\t\tHost:          host,\n\t\tPort:          port,\n\t\tTransportMode: transportMode,\n\t\tHTTPPath:      strings.TrimPrefix(parameter(parameters, \"hive.server2.thrift.http.path\"), \"/\"),\n\t\tAuth:          strings.ToUpper(parameter(parameters, \"hive.server2.authentication\")),\n\t\tPrincipal:     parameter(parameters, \"hive.server2.authentication.kerberos.principal\"),\n\t\tSSL:           parameterBool(parameters, \"hive.server2.use.ssl\"),\n\t}, nil\n}\n\nfunc parseRegisteredEndpoint(value string) (endpoint, error) {\n\tvalue = strings.TrimSpace(value)\n\tif parsed, err := url.Parse(value); err == nil && parsed.Hostname() != \"\" {\n\t\tport := defaultHivePort\n\t\tif parsed.Port() != \"\" {\n\t\t\tparsedPort, parseErr := strconv.Atoi(parsed.Port())","sourceCodeStart":321,"sourceCodeEnd":357,"githubUrl":"https://github.com/t8y2/dbx/blob/c0390bff16418b651f4728520d99adf8ce48829a/agents/drivers/hive-go/discovery.go#L321-L357","documentation":"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.","triggerScenarios":"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).","commonSituations":"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.","solutions":["Set hive.server2.thrift.bind.host and hive.server2.thrift.port explicitly in hive-site.xml and restart HiveServer2","If using http transport, configure hive.server2.thrift.http.port explicitly","Inspect the published parameters in the znode to see which keys are actually present","Patch the parser if your Hive release publishes keys under different names"],"exampleFix":"// before\n<property><name>hive.server2.thrift.port</name><value>0</value></property>\n// after\n<property><name>hive.server2.thrift.port</name><value>10000</value></property>","handlingStrategy":"validation","validationCode":"host := params[\"hive.server2.thrift.bind.host\"]\nportStr := params[\"hive.server2.thrift.port\"]\nport, err := strconv.Atoi(portStr)\nif host == \"\" || err != nil || port <= 0 {\n    return errors.New(\"published HiveServer2 config missing valid host/port; fix hive-site.xml\")\n}","typeGuard":null,"tryCatchPattern":"endpoint, err := parseHiveServerRegistration(child, data)\nif err != nil && strings.Contains(err.Error(), \"no valid host and port\") {\n    return fmt.Errorf(\"server %s published incomplete config: %w\", child, err)\n}","preventionTips":["Set hive.server2.thrift.bind.host and .port explicitly in hive-site.xml","Avoid port 0 in published configs; pin a static port","For http transport, also set hive.server2.thrift.http.port"],"tags":["hive","config","parsing","zookeeper"],"backgroundTag":"missing-config-value","analyzedSha":"c0390bff16418b651f4728520d99adf8ce48829a","analyzedAt":"2026-09-05T23:05:10.900Z","contentChangedAt":"2026-09-05T23:05:10.900Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}