{"record":{"id":"5ee4a6f652edfb82","repo":"t8y2/dbx","slug":"published-hiveserver2-configuration-has-no-valid-h","errorCode":null,"errorMessage":"published HiveServer2 configuration has no valid host and port","messagePattern":"published HiveServer2 configuration has no valid host and port","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"agents/drivers/argo-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/argo-go/discovery.go#L321-L357","documentation":"This error is returned by endpointFromPublishedHiveConfig when a HiveServer2 service entry published in a discovery/registry store does not carry a usable host and TCP port. The driver reads the published configuration parameters (hive.server2.thrift.port, or hive.server2.thrift.http.port for HTTP transport), parses the port with strconv.Atoi, and rejects the endpoint if the host is empty, the port is unparseable, or the port is <= 0. It exists so the driver never attempts a connection to a malformed or incomplete registration.","triggerScenarios":"Calling parseHiveServerRegistration against a published config where the host key is missing/empty, the port parameter is absent or non-numeric (e.g. empty string, 'none'), or the parsed port is zero or negative.","commonSituations":"HiveServer2 was registered with a partial/incomplete config map; a custom publication script omitted the thrift port keys; port values stored with whitespace or units ('10000/tcp'); services registered before HiveServer2 finished binding so defaults were never filled in.","solutions":["Inspect the published service parameters and ensure hive.server2.thrift.host (or equivalent host key) and hive.server2.thrift.port are present and numeric","For HTTP transport mode, set hive.server2.thrift.http.port explicitly (it takes precedence over the thrift port)","Fix the publishing side so registration only happens with complete host/port values, then re-register the service","Verify the port value is a plain integer string without whitespace, units, or quotes"],"exampleFix":"// before (published config incomplete)\n{\"hive.server2.thrift.host\": \"\", \"hive.server2.thrift.port\": \"\"}\n// after\n{\"hive.server2.thrift.host\": \"hive.example.com\", \"hive.server2.thrift.port\": \"10000\"}","handlingStrategy":"validation","validationCode":"func validPublishedHiveConfig(params map[string]string) bool {\n    host := params[\"hive.server2.thrift.host\"]\n    portStr := params[\"hive.server2.thrift.port\"]\n    if portStr == \"\" { portStr = params[\"hive.server2.thrift.http.port\"] }\n    port, err := strconv.Atoi(strings.TrimSpace(portStr))\n    return host != \"\" && err == nil && port > 0\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Publish complete host and port parameters at registration time","Validate published configs before writing them to the discovery store","Use plain integer port strings without whitespace or units","Prefer HTTP transport port key when transport mode is http"],"tags":["discovery","configuration","hiveserver2"],"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-14T00:17:10.932Z"}