{"record":{"id":"d814a5764753e9a3","repo":"t8y2/dbx","slug":"invalid-hive-endpoint-q-d814a5","errorCode":null,"errorMessage":"invalid Hive endpoint %q","messagePattern":"invalid Hive endpoint %q","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"agents/drivers/hive-go/config.go","lineNumber":414,"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":396,"sourceCodeEnd":432,"githubUrl":"https://github.com/t8y2/dbx/blob/c0390bff16418b651f4728520d99adf8ce48829a/agents/drivers/hive-go/config.go#L396-L432","documentation":"After all parsing branches, parseEndpoint validates the final host and port: the host must be non-blank and the port must be within 1-65535. Anything else yields this error. Unlike errors 754/755 it carries no wrapped cause because the failure is semantic (out-of-range or empty), not a parse failure.","triggerScenarios":"Endpoints like 'host:0', 'host:70000', ':10000' (empty host), '   ' (whitespace-only), or '[::1]' variants that end up with an empty trimmed host or out-of-range port.","commonSituations":"Port 0 used to mean 'any' but is rejected here; truncated config leaving an empty host; computed ports overflowing 65535; env vars set to empty string producing blank endpoints.","solutions":["Provide a non-empty host and a port in 1-65535","Remove blank/whitespace entries from the endpoint list","Fix the numeric port if it is 0 or above 65535","Split multi-endpoint values and check each one individually"],"exampleFix":"// before\nconfig.Endpoints = []string{\"host:0\"}\n// after\nconfig.Endpoints = []string{\"host:10000\"}","handlingStrategy":"validation","validationCode":"func checkEndpoint(host string, port int) error {\n    if strings.TrimSpace(host) == \"\" { return errors.New(\"empty host\") }\n    if port <= 0 || port > 65535 { return fmt.Errorf(\"port %d out of range\", port) }\n    return nil\n}","typeGuard":null,"tryCatchPattern":"if _, err := parseEndpoint(v); err != nil && !strings.Contains(err.Error(), \": \") /* no wrapped cause */ {\n    return fmt.Errorf(\"endpoint %q: host required, port must be 1-65535\", v)\n}","preventionTips":["Check for empty env vars before using them as hosts","Use ports in 1-65535; 0 is rejected","Trim whitespace from config values"],"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"}