{"record":{"id":"739fab427e461d5b","repo":"t8y2/dbx","slug":"invalid-hive-fetchsize-q-expected-a-positive-int","errorCode":null,"errorMessage":"invalid Hive fetchSize %q: expected a positive integer","messagePattern":"invalid Hive fetchSize %q: expected a positive integer","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"agents/drivers/argo-go/config.go","lineNumber":585,"sourceCode":"\t\t\treturn fmt.Errorf(\"invalid Hive browserResponsePort %q: expected 0-65535\", value)\n\t\t}\n\t\tconfig.BrowserResponsePort = parsed\n\t}\n\tif value := parameter(values, \"browserresponsetimeout\"); value != \"\" {\n\t\tparsed, err := strconv.ParseInt(value, 10, 64)\n\t\tif err != nil || parsed <= 0 {\n\t\t\treturn fmt.Errorf(\"invalid Hive browserResponseTimeout %q: expected positive seconds\", value)\n\t\t}\n\t\tconfig.BrowserResponseTimeout = time.Duration(parsed) * time.Second\n\t}\n\tconfig.BrowserDisableSSLCheck = parameterBool(values, \"browserdisablesslcheck\")\n\tif strings.EqualFold(config.Auth, \"JWT\") && config.JWT == \"\" {\n\t\treturn errors.New(\"Hive JWT authentication requires jwt or the JWT environment variable\")\n\t}\n\tif value := parameter(values, \"fetchsize\"); value != \"\" {\n\t\tparsed, err := strconv.Atoi(value)\n\t\tif err != nil || parsed <= 0 {\n\t\t\treturn fmt.Errorf(\"invalid Hive fetchSize %q: expected a positive integer\", value)\n\t\t}\n\t\tconfig.FetchSize = parsed\n\t}\n\tif value := parameter(values, \"sockettimeout\"); value != \"\" {\n\t\tparsed, err := strconv.ParseInt(value, 10, 64)\n\t\tif err != nil {\n\t\t\treturn fmt.Errorf(\"invalid Hive socketTimeout %q: expected seconds\", value)\n\t\t}\n\t\tif parsed > 0 {\n\t\t\tconfig.SocketTimeout = time.Duration(parsed) * time.Second\n\t\t}\n\t}\n\tif value := parameter(values, \"thrift.client.max.message.size\"); value != \"\" {\n\t\tparsed, err := strconv.ParseInt(value, 10, 32)\n\t\tif err != nil {\n\t\t\treturn fmt.Errorf(\"invalid Hive thrift.client.max.message.size %q: expected bytes\", value)\n\t\t}\n\t\tif parsed > 0 {","sourceCodeStart":567,"sourceCodeEnd":603,"githubUrl":"https://github.com/t8y2/dbx/blob/c0390bff16418b651f4728520d99adf8ce48829a/agents/drivers/argo-go/config.go#L567-L603","documentation":"This error is returned while parsing a Hive connection string when the `fetchsize` parameter is present but cannot be parsed as a positive integer with strconv.Atoi. The library validates driver configuration at DSN-parse time so bad values fail fast instead of at query execution. It means the fetchSize value is either non-numeric or <= 0.","triggerScenarios":"Opening a Hive connection with a DSN/parameter map containing fetchsize set to a non-integer string (e.g. \"abc\", \"10.5\", \"1e3\") or a non-positive integer (e.g. \"0\", \"-5\").","commonSituations":"Copy-pasting a connection string with a placeholder fetchsize; mistyping units (fetchsize=10k); setting fetchsize=0 expecting the driver default; templated config files rendering empty or quoted values into the DSN.","solutions":["Set fetchsize to a positive integer string, e.g. fetchsize=1000","Remove the fetchsize parameter entirely to use the driver default","Check for typos, stray units, or empty templated values in the DSN","Verify environment/config templates do not inject quotes or commas into the value"],"exampleFix":"// before\ndsn := \"hive://user:pass@host:10000/db?fetchsize=0\"\n// after\ndsn := \"hive://user:pass@host:10000/db?fetchsize=1000\"","handlingStrategy":"validation","validationCode":"func validateFetchSize(dsn string) error {\n\tvals, _ := url.ParseQuery(dsn)\n\tv := vals.Get(\"fetchsize\")\n\tif v == \"\" { return nil }\n\tn, err := strconv.Atoi(v)\n\tif err != nil || n <= 0 {\n\t\treturn fmt.Errorf(\"fetchsize must be a positive integer, got %q\", v)\n\t}\n\treturn nil\n}","typeGuard":null,"tryCatchPattern":"cfg, err := drivers.ParseConfig(dsn)\nif err != nil {\n\tvar valErr *strconv.NumError\n\tif errors.As(err, &valErr) || strings.Contains(err.Error(), \"fetchSize\") {\n\t\treturn fmt.Errorf(\"fix fetchsize in DSN: %w\", err)\n\t}\n\treturn err\n}","preventionTips":["Always emit fetchsize as a plain integer from config templates","Never set fetchsize=0; omit the parameter for defaults","Add unit tests that render every DSN parameter from your config layer","Strip quotes/whitespace from DSN values before passing them to the driver"],"tags":["hive","config","validation","connection-string"],"backgroundTag":"invalid-connection-string-parameter","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"}