{"record":{"id":"665b98d57d998827","repo":"t8y2/dbx","slug":"invalid-hive-endpoint-q","errorCode":null,"errorMessage":"invalid Hive endpoint %q","messagePattern":"invalid Hive endpoint %q","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"agents/drivers/argo-go/config.go","lineNumber":411,"sourceCode":"\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\n\t} else if strings.HasPrefix(value, \"[\") && strings.HasSuffix(value, \"]\") {\n\t\thost = strings.Trim(value, \"[]\")\n\t}\n\tif strings.TrimSpace(host) == \"\" || port <= 0 || port > 65535 {\n\t\treturn endpoint{}, fmt.Errorf(\"invalid Hive endpoint %q\", value)\n\t}\n\treturn endpoint{Host: host, Port: port}, nil\n}\n\nfunc parseHiveParameters(raw string) map[string]string {\n\treturn parseHiveAssignments(raw, false)\n}\n\nfunc parseHiveAssignments(raw string, lowercaseKeys bool) map[string]string {\n\tresult := map[string]string{}\n\ttrimmed := strings.Trim(strings.TrimSpace(raw), \"?#&;\")\n\tfor _, part := range strings.FieldsFunc(trimmed, func(char rune) bool { return char == ';' || char == '&' }) {\n\t\tpart = strings.TrimSpace(part)\n\t\tif part == \"\" {\n\t\t\tcontinue\n\t\t}\n\t\tkey, value, found := strings.Cut(part, \"=\")\n\t\tkey = strings.TrimSpace(key)","sourceCodeStart":393,"sourceCodeEnd":429,"githubUrl":"https://github.com/t8y2/dbx/blob/c0390bff16418b651f4728520d99adf8ce48829a/agents/drivers/argo-go/config.go#L393-L429","documentation":"Final validation of parseHiveEndpoint: after all parsing branches, the host must be non-blank and the port must be in 1-65535. Unlike the other endpoint errors this one has no wrapped cause because it is a semantic validity check, not a parse failure.","triggerScenarios":"Endpoint value yields empty/whitespace host, a port of 0, a negative port, or a port above 65535 after parsing (e.g. 'host:0', 'host:-1', 'host:99999', or ':' alone).","commonSituations":"Blank entries in comma-separated endpoint lists (trailing commas), zero used as a placeholder, or computed ports from arithmetic gone wrong.","solutions":["Supply a real hostname and a port in 1-65535","Remove empty entries/commas from the endpoint list","Fix port ranges outside 1-65535 (drop 0 unless explicitly allowed elsewhere)","Add pre-validation in your config loader: host non-empty and 0 < port <= 65535"],"exampleFix":"// before\nendpoint: \"host:99999\"\n// after\nendpoint: \"host:10000\"","handlingStrategy":"validation","validationCode":"func checkEndpoint(v string) error {\n    h, p, err := net.SplitHostPort(v)\n    if err != nil { return err }\n    n, err := strconv.Atoi(p)\n    if err != nil { return err }\n    if strings.TrimSpace(h) == \"\" || n <= 0 || n > 65535 {\n        return fmt.Errorf(\"endpoint %q: host required, port 1-65535\", v)\n    }\n    return nil\n}","typeGuard":"func endpointInRange(v string) bool {\n    h, p, err := net.SplitHostPort(v)\n    if err != nil { return false }\n    n, err := strconv.Atoi(p)\n    return strings.TrimSpace(h) != \"\" && err == nil && n >= 1 && n <= 65535\n}","tryCatchPattern":"ep, err := parseHiveEndpoint(v)\nif err != nil && strings.HasSuffix(err.Error(), \"invalid Hive endpoint \"+strconv.Quote(v)) {\n    // semantic failure: blank host or out-of-range port; report to operator\n    return fmt.Errorf(\"fix host/port in %q: %w\", v, err)\n}","preventionTips":["Strip empty entries from comma-separated endpoint lists","Never use 0 or negative numbers as placeholder ports","Trim whitespace around hosts in config loading","Add a startup assertion that all endpoints pass 1-65535 range checks"],"tags":["hive","config","endpoint","validation"],"backgroundTag":"invalid-endpoint","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"}