{"record":{"id":"cd9f6e6436de1c8f","repo":"t8y2/dbx","slug":"retries-must-be-between-0-and-1000","errorCode":null,"errorMessage":"retries must be between 0 and 1000","messagePattern":"retries must be between 0 and 1000","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"agents/drivers/cassandra-go/config.go","lineNumber":252,"sourceCode":"\t\t\tenabled, err := strconv.ParseBool(value)\n\t\t\tif err != nil {\n\t\t\t\treturn fmt.Errorf(\"invalid keepalive option: %w\", err)\n\t\t\t}\n\t\t\tconfig.keepAlive = enabled\n\t\tcase \"user\":\n\t\t\tconfig.username = value\n\t\tcase \"password\":\n\t\t\tconfig.password = value\n\t\tcase \"debug\":\n\t\t\tenabled, err := strconv.ParseBool(value)\n\t\t\tif err != nil {\n\t\t\t\treturn fmt.Errorf(\"invalid debug option: %w\", err)\n\t\t\t}\n\t\t\tconfig.debug = enabled\n\t\tcase \"retries\":\n\t\t\tcount, err := strconv.Atoi(value)\n\t\t\tif err != nil || count < 0 || count > 1000 {\n\t\t\t\treturn fmt.Errorf(\"retries must be between 0 and 1000\")\n\t\t\t}\n\t\t\tconfig.retryCount = count\n\t\tcase \"retry\":\n\t\t\tpolicy, err := normalizeRetryPolicy(value)\n\t\t\tif err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t\tconfig.retryPolicy = policy\n\t\tcase \"reconnection\":\n\t\t\tpolicy, baseDelay, maxDelay, err := parseReconnectionPolicy(value)\n\t\t\tif err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t\tconfig.reconnectionPolicy = policy\n\t\t\tconfig.reconnectionBaseDelay = baseDelay\n\t\t\tconfig.reconnectionMaxDelay = maxDelay\n\t\tcase \"disableinitialhostlookup\":\n\t\t\tdisabled, err := strconv.ParseBool(value)","sourceCodeStart":234,"sourceCodeEnd":270,"githubUrl":"https://github.com/t8y2/dbx/blob/c0390bff16418b651f4728520d99adf8ce48829a/agents/drivers/cassandra-go/config.go#L234-L270","documentation":"The 'retries' URL parameter must be an integer between 0 and 1000 inclusive. This error is returned when strconv.Atoi fails or the parsed count is negative or greater than 1000, guarding against absurd retry counts that would hammer the cluster.","triggerScenarios":"DSN contains retries=<value> where value is non-numeric (strconv.Atoi error), negative, or >1000, e.g. retries=-1 or retries=99999.","commonSituations":"Typos in the URL (retries=1O instead of 10); using sentinel values like 'unlimited'; migrating from configs that allowed larger retry counts; automated tools injecting duration-like strings (retries=30s).","solutions":["Set retries to a plain integer from 0 to 1000, e.g. retries=5","Remove the retries parameter to use the library default","If a higher retry count is truly needed, chain retries at the application level instead of exceeding the URL limit"],"exampleFix":"// before\ncassandra://127.0.0.1/myks?retries=unlimited\n// after\ncassandra://127.0.0.1/myks?retries=10","handlingStrategy":"validation","validationCode":"n, err := strconv.Atoi(q.Get(\"retries\"))\nif err != nil || n < 0 || n > 1000 {\n\treturn errors.New(\"retries must be an integer 0..1000\")\n}","typeGuard":null,"tryCatchPattern":"if err := parseCassandraConfig(dsn); err != nil {\n\tif strings.Contains(err.Error(), \"retries must be between\") {\n\t\treturn rewriteDSNParam(dsn, \"retries\", \"3\")\n\t}\n\treturn err\n}","preventionTips":["Always emit retries as a plain decimal integer","Clamp user-supplied retry counts to 0..1000 before building the DSN","Never put duration strings (30s) or 'unlimited' in retries"],"tags":["config","url-params","validation","retries","cassandra"],"backgroundTag":"invalid-url-parameter","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"}