{"record":{"id":"79f9151ffb7cc43f","repo":"t8y2/dbx","slug":"pagesize-must-be-positive","errorCode":null,"errorMessage":"pagesize must be positive","messagePattern":"pagesize must be positive","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"agents/drivers/cassandra-go/config.go","lineNumber":210,"sourceCode":"\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)\n\t\t\tif err != nil {\n\t\t\t\treturn fmt.Errorf(\"invalid host verification option: %w\", err)\n\t\t\t}\n\t\t\tconfig.hostVerification = enabled\n\t\tcase \"tcpnodelay\":\n\t\t\tenabled, err := strconv.ParseBool(value)","sourceCodeStart":192,"sourceCodeEnd":228,"githubUrl":"https://github.com/t8y2/dbx/blob/c0390bff16418b651f4728520d99adf8ce48829a/agents/drivers/cassandra-go/config.go#L192-L228","documentation":"The 'pagesize' (alias 'fetchsize') URL parameter must parse as a positive integer (>= 1). Zero, negative numbers, or non-integer values are rejected with this error because paging with a non-positive page size is invalid in CQL.","triggerScenarios":"pagesize=0, fetchsize=-100, pagesize=auto, or pagesize=2.5 in a cassandra:// URL.","commonSituations":"Setting 0 expecting 'unlimited' pages (use a very large number instead), copying fetch sizes from JDBC drivers that use different units, or float values leaking from templating.","solutions":["Set pagesize to a positive integer (e.g. 5000).","Remove pagesize to use the driver's default page size.","For very large result sets, use a large value like 10000 rather than 0.","Cast/round numeric values to int before embedding in the URL."],"exampleFix":"// before\ncassandra://host:9042?pagesize=0\n// after\ncassandra://host:9042?pagesize=5000","handlingStrategy":"validation","validationCode":"n, err := strconv.Atoi(pageSize)\nif err != nil || n < 1 {\n\treturn fmt.Errorf(\"pagesize must be a positive integer, got %q\", pageSize)\n}","typeGuard":null,"tryCatchPattern":"cfg, err := parseCassandraConfig(dsn)\nif err != nil {\n\tif strings.Contains(err.Error(), \"pagesize must be positive\") {\n\t\treturn fmt.Errorf(\"set pagesize to >= 1 (e.g. 5000); 0 does not mean unlimited: %w\", err)\n\t}\n\treturn err\n}","preventionTips":["Remember 0/negative are invalid; use a large value for effectively unlimited pages","Round/cast numeric config to int before serializing into the URL","Validate pagesize wherever the DSN is generated, not at connection time"],"tags":["cassandra","config","paging","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"}