{"record":{"id":"4839ba5937f3508c","repo":"t8y2/dbx","slug":"invalid-hive-port-w-4839ba","errorCode":null,"errorMessage":"invalid Hive port: %w","messagePattern":"invalid Hive port: %w","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"agents/drivers/hive-go/config.go","lineNumber":319,"sourceCode":"\t\treturn newParsedHiveConnection(), nil\n\t}\n\tif strings.HasPrefix(strings.ToLower(value), \"jdbc:hive2://\") {\n\t\tvalue = value[len(\"jdbc:hive2://\"):]\n\t} else if strings.HasPrefix(strings.ToLower(value), \"hive://\") {\n\t\tparsedURL, err := url.Parse(value)\n\t\tif err != nil {\n\t\t\treturn parsedHiveConnection{}, fmt.Errorf(\"invalid Hive connection string: %w\", err)\n\t\t}\n\t\tresult := newParsedHiveConnection()\n\t\tif parsedURL.User != nil {\n\t\t\tresult.username = parsedURL.User.Username()\n\t\t\tresult.password, _ = parsedURL.User.Password()\n\t\t}\n\t\tport := defaultHivePort\n\t\tif parsedURL.Port() != \"\" {\n\t\t\tparsedPort, err := strconv.Atoi(parsedURL.Port())\n\t\t\tif err != nil {\n\t\t\t\treturn parsedHiveConnection{}, fmt.Errorf(\"invalid Hive port: %w\", err)\n\t\t\t}\n\t\t\tport = parsedPort\n\t\t}\n\t\tresult.endpoints = []endpoint{{Host: parsedURL.Hostname(), Port: port}}\n\t\tresult.database = strings.Trim(parsedURL.Path, \"/\")\n\t\tfor key, entries := range parsedURL.Query() {\n\t\t\tif len(entries) > 0 {\n\t\t\t\tsetCaseInsensitive(result.parameters, key, entries[len(entries)-1])\n\t\t\t}\n\t\t}\n\t\treturn result, nil\n\t} else {\n\t\treturn parsedHiveConnection{}, errors.New(\"Hive connection string must start with jdbc:hive2:// or hive://\")\n\t}\n\n\tresult := newParsedHiveConnection()\n\tif fragment := strings.IndexByte(value, '#'); fragment >= 0 {\n\t\tresult.hiveVars = parseHiveAssignments(value[fragment+1:], false)","sourceCodeStart":301,"sourceCodeEnd":337,"githubUrl":"https://github.com/t8y2/dbx/blob/c0390bff16418b651f4728520d99adf8ce48829a/agents/drivers/hive-go/config.go#L301-L337","documentation":"When parsing a hive:// URL, the port segment is converted with strconv.Atoi; if it is not a valid integer, the driver rejects the whole connection string with this wrapped error. This guards against ports like 'host:abc' before any dial is attempted.","triggerScenarios":"A hive:// URL whose explicit port is non-numeric, e.g. hive://host:notaport or hive://host: (empty handled separately but ':' trailing digits missing), or a port with stray characters like '10000x'.","commonSituations":"Typo in port; placeholder text left in a template (host:PORT); copying 'host:10000/default' fragments where the slash/DB bled into the port token (though url.Parse would normally isolate that).","solutions":["Correct the port in the hive:// URL to a decimal integer 1-65535","Omit the port entirely to use defaultHivePort","Use host:port list syntax instead of hive:// URL syntax","Inspect the wrapped strconv error to identify the offending token"],"exampleFix":"// before\nurl := \"hive://coordinator:10OOO/default\" // letter O instead of zero\n// after\nurl := \"hive://coordinator:10000/default\"","handlingStrategy":"validation","validationCode":"if u, err := url.Parse(dsn); err == nil && u.Port() != \"\" {\n    if p, err := strconv.Atoi(u.Port()); err != nil || p < 1 || p > 65535 {\n        return fmt.Errorf(\"bad hive port %q\", u.Port())\n    }\n}","typeGuard":null,"tryCatchPattern":"conn, err := ParseHiveConnection(dsn)\nif err != nil {\n    if strings.Contains(err.Error(), \"invalid Hive port\") {\n        return fmt.Errorf(\"port in DSN must be numeric: %w\", err)\n    }\n    return err\n}","preventionTips":["Always specify ports as decimal digits 1-65535","Omit the port to use defaultHivePort","Check templated DSNs for unreplaced placeholders"],"tags":["hive","config","port","url-parsing"],"backgroundTag":"invalid-port","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"}