{"record":{"id":"766604f07b99323d","repo":"t8y2/dbx","slug":"hive-endpoint-is-empty","errorCode":null,"errorMessage":"Hive endpoint is empty","messagePattern":"Hive endpoint is empty","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"agents/drivers/argo-go/config.go","lineNumber":388,"sourceCode":"\t}\n\treturn result, nil\n}\n\nfunc splitEndpoints(value string) []string {\n\tparts := strings.Split(value, \",\")\n\tresult := make([]string, 0, len(parts))\n\tfor _, part := range parts {\n\t\tif trimmed := strings.TrimSpace(part); trimmed != \"\" {\n\t\t\tresult = append(result, trimmed)\n\t\t}\n\t}\n\treturn result\n}\n\nfunc parseEndpoint(value string, defaultPort int) (endpoint, error) {\n\tvalue = strings.TrimSpace(value)\n\tif value == \"\" {\n\t\treturn endpoint{}, errors.New(\"Hive endpoint is empty\")\n\t}\n\thost := value\n\tport := defaultPort\n\tif parsedHost, parsedPort, err := net.SplitHostPort(value); err == nil {\n\t\thost = parsedHost\n\t\tparsed, parseErr := strconv.Atoi(parsedPort)\n\t\tif parseErr != nil {\n\t\t\treturn endpoint{}, fmt.Errorf(\"invalid Hive endpoint %q: %w\", value, parseErr)\n\t\t}\n\t\tport = parsed\n\t} else if strings.Count(value, \":\") == 1 {\n\t\tparts := strings.SplitN(value, \":\", 2)\n\t\tparsed, parseErr := strconv.Atoi(parts[1])\n\t\tif parseErr != nil {\n\t\t\treturn endpoint{}, fmt.Errorf(\"invalid Hive endpoint %q: %w\", value, parseErr)\n\t\t}\n\t\thost = parts[0]\n\t\tport = parsed","sourceCodeStart":370,"sourceCodeEnd":406,"githubUrl":"https://github.com/t8y2/dbx/blob/c0390bff16418b651f4728520d99adf8ce48829a/agents/drivers/argo-go/config.go#L370-L406","documentation":"parseEndpoint validates each endpoint string: after trimming whitespace it must be non-empty. An empty value cannot be split into host/port, so the driver returns this error immediately. It usually surfaces when an endpoint list contains blank entries.","triggerScenarios":"Passing \"\" or a whitespace-only string to parseEndpoint (directly or via a hosts/endpoints parameter that contains empty items, e.g. 'host1:10000,,host2' or a trailing comma).","commonSituations":"Environment variable with a trailing/leading comma producing an empty split item; config file with an empty hosts field; splitting a host list on the wrong delimiter.","solutions":["Remove empty entries from the endpoints/hosts list before parsing","Set the host value in the parameter or environment variable that feeds parseEndpoint","Filter/split host lists carefully (e.g. strings.Fields or a filtering split on ',')"],"exampleFix":"// before\nhosts := strings.Split(env_hosts, \",\") // may contain \"\"\n// after\nvar hosts []string\nfor _, h := range strings.Split(env_hosts, \",\") {\n    if strings.TrimSpace(h) != \"\" { hosts = append(hosts, h) }\n}","handlingStrategy":"validation","validationCode":"if strings.TrimSpace(endpoint) == \"\" {\n    return errors.New(\"refusing to parse empty endpoint\")\n}","typeGuard":null,"tryCatchPattern":"ep, err := parseEndpoint(value, defaultPort)\nif err != nil {\n    return fmt.Errorf(\"endpoint %q invalid: %w\", value, err)\n}","preventionTips":["Filter empty strings after splitting host lists on commas","Trim host env vars before use","Never build endpoint lists via naive string concatenation"],"tags":["go","hive","configuration","empty-value"],"backgroundTag":"missing-required-config","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"}