{"record":{"id":"dc28a27ab428826a","repo":"t8y2/dbx","slug":"numconns-must-be-between-1-and-32","errorCode":null,"errorMessage":"numconns must be between 1 and 32","messagePattern":"numconns must be between 1 and 32","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"agents/drivers/cassandra-go/config.go","lineNumber":204,"sourceCode":"\t\t\tconfig.protocolVersion = version\n\t\tcase \"consistency\":\n\t\t\tif _, err := gocql.ParseConsistencyWrapper(value); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t\tconfig.consistency = value\n\t\tcase \"serialconsistency\":\n\t\t\tconsistency, err := gocql.ParseConsistencyWrapper(value)\n\t\t\tif err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t\tif consistency != gocql.Serial && consistency != gocql.LocalSerial {\n\t\t\t\treturn fmt.Errorf(\"serialconsistency must be SERIAL or LOCAL_SERIAL\")\n\t\t\t}\n\t\t\tconfig.serialConsistency = value\n\t\tcase \"numconns\", \"connectionsperhost\":\n\t\t\tcount, err := strconv.Atoi(value)\n\t\t\tif err != nil || count < 1 || count > 32 {\n\t\t\t\treturn fmt.Errorf(\"numconns must be between 1 and 32\")\n\t\t\t}\n\t\t\tconfig.numConnections = count\n\t\tcase \"pagesize\", \"fetchsize\":\n\t\t\tsize, err := strconv.Atoi(value)\n\t\t\tif err != nil || size < 1 {\n\t\t\t\treturn fmt.Errorf(\"pagesize must be positive\")\n\t\t\t}\n\t\t\tconfig.pageSize = size\n\t\tcase \"cqlversion\":\n\t\t\tconfig.cqlVersion = value\n\t\tcase \"ssl\", \"enablessl\":\n\t\t\tenabled, err := strconv.ParseBool(value)\n\t\t\tif err != nil {\n\t\t\t\treturn fmt.Errorf(\"invalid ssl option: %w\", err)\n\t\t\t}\n\t\t\tconfig.ssl = enabled\n\t\tcase \"hostverification\", \"verifyhostname\", \"sslhostnameverification\", \"hostnameverification\":\n\t\t\tenabled, err := strconv.ParseBool(value)","sourceCodeStart":186,"sourceCodeEnd":222,"githubUrl":"https://github.com/t8y2/dbx/blob/c0390bff16418b651f4728520d99adf8ce48829a/agents/drivers/cassandra-go/config.go#L186-L222","documentation":"The 'numconns' (alias 'connectionsperhost') URL parameter must parse as an integer between 1 and 32. Non-numeric values or counts outside that range are rejected with this error, since gocql requires at least one connection per host and the driver caps the pool at 32.","triggerScenarios":"numconns=0, numconns=50, connectionsperhost=abc, or numconns=2.5 in a cassandra:// URL.","commonSituations":"Tuning connection pools aggressively for high-throughput workloads and exceeding the cap, setting 0 expecting 'auto', or non-integer values from templated config.","solutions":["Set numconns to an integer between 1 and 32.","Remove the parameter to use the driver's default connection-per-host count.","If you need more concurrency than the cap allows, scale via hosts or a separate session instead of raising numconns.","Quote/escape the value if it comes from a URL query built programmatically (e.g. stray '2.5' from a float)."],"exampleFix":"// before\ncassandra://host:9042?numconns=64\n// after\ncassandra://host:9042?numconns=8","handlingStrategy":"validation","validationCode":"n, err := strconv.Atoi(numConns)\nif err != nil || n < 1 || n > 32 {\n\treturn fmt.Errorf(\"numconns must be an integer 1-32, got %q\", numConns)\n}","typeGuard":null,"tryCatchPattern":"cfg, err := parseCassandraConfig(dsn)\nif err != nil {\n\tif strings.Contains(err.Error(), \"numconns must be between 1 and 32\") {\n\t\treturn fmt.Errorf(\"clamp numconns to 1-32: %w\", err)\n\t}\n\treturn err\n}","preventionTips":["Clamp pool-size config values to [1,32] before URL assembly","Treat 0/'auto' as 'remove the parameter', not as a literal value","Keep integers as integers end-to-end; avoid float formatting in templates"],"tags":["cassandra","config","connection-pool","validation"],"backgroundTag":"config-value-out-of-range","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"}