{"record":{"id":"ac67e2aefc82cba9","repo":"t8y2/dbx","slug":"invalid-debug-option-w","errorCode":null,"errorMessage":"invalid debug option: %w","messagePattern":"invalid debug option: %w","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"agents/drivers/cassandra-go/config.go","lineNumber":246,"sourceCode":"\t\t\tenabled, err := strconv.ParseBool(value)\n\t\t\tif err != nil {\n\t\t\t\treturn fmt.Errorf(\"invalid tcpnodelay option: %w\", err)\n\t\t\t}\n\t\t\tconfig.tcpNoDelay = enabled\n\t\tcase \"keepalive\":\n\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","sourceCodeStart":228,"sourceCodeEnd":264,"githubUrl":"https://github.com/t8y2/dbx/blob/c0390bff16418b651f4728520d99adf8ce48829a/agents/drivers/cassandra-go/config.go#L228-L264","documentation":"This error is returned when the 'debug' URL parameter in a Cassandra connection URL cannot be parsed as a boolean by strconv.ParseBool. The library validates every URL parameter value before storing it in cassandraConfig, so a malformed boolean value aborts config parsing. The underlying strconv error is wrapped so the developer sees the original parse failure.","triggerScenarios":"Calling parseCassandraConfig with a DSN containing debug=<not-a-bool>, e.g. cassandra://host/db?debug=yes%20please or debug=on1. strconv.ParseBool only accepts 1,t,T,TRUE,true,True,0,f,F,FALSE,false,False.","commonSituations":"Hand-editing connection URLs and using words like 'enabled', 'yes', or 'on'; copy-pasting JDBC-style boolean values that are not Go-parseable booleans; templating that renders an empty or malformed debug value.","solutions":["Set the debug parameter to one of strconv.ParseBool's accepted values: 1, t, T, true, TRUE, True, 0, f, F, false, FALSE, False","Remove the debug parameter entirely if the default is acceptable","Log or print the wrapped %w error to see exactly what strconv choked on and correct that token in the URL"],"exampleFix":"// before\ncassandra://127.0.0.1/myks?debug=yes\n// after\ncassandra://127.0.0.1/myks?debug=true","handlingStrategy":"validation","validationCode":"func validBoolParam(v string) bool {\n\t_, err := strconv.ParseBool(v)\n\treturn err == nil\n}\n// if q.Get(\"debug\") != \"\" && !validBoolParam(q.Get(\"debug\")) { fix URL }","typeGuard":null,"tryCatchPattern":"if err := parseCassandraConfig(dsn); err != nil {\n\tvar pe *strconv.NumError\n\tif errors.As(err, &pe) {\n\t\treturn fmt.Errorf(\"fix boolean param %q in DSN: %w\", pe.Num, err)\n\t}\n\treturn err\n}","preventionTips":["Use only true/false or 1/0 for boolean URL params","Validate DSNs at startup before storing them in config","Trim whitespace before interpolating values into connection strings"],"tags":["config","url-params","boolean-parsing","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"}