{"record":{"id":"21518cfc89e209e3","repo":"t8y2/dbx","slug":"invalid-keepalive-option-w","errorCode":null,"errorMessage":"invalid keepalive option: %w","messagePattern":"invalid keepalive option: %w","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"agents/drivers/cassandra-go/config.go","lineNumber":236,"sourceCode":"\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)\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","sourceCodeStart":218,"sourceCodeEnd":254,"githubUrl":"https://github.com/t8y2/dbx/blob/c0390bff16418b651f4728520d99adf8ce48829a/agents/drivers/cassandra-go/config.go#L218-L254","documentation":"The 'keepalive' URL parameter must parse as a boolean via strconv.ParseBool. Invalid values are rejected with this wrapped error during DSN parsing, before a session is created. keepalive enables TCP keep-alive probes on connections.","triggerScenarios":"keepalive=yes, keepalive=enabled, keepalive= (empty value from an unset env var), or keepalive=true\n (trailing newline) in a cassandra:// URL.","commonSituations":"Inconsistent boolean conventions across config files (some use yes/no, some true/false), CI secrets with trailing whitespace, or documentation examples copied verbatim with unsupported literals.","solutions":["Use keepalive=true or keepalive=false (also accepted: 1/0, t/f, TRUE/FALSE in any ParseBool-accepted casing).","Trim whitespace/newlines from values before building the URL.","Remove the parameter to keep the driver's default keep-alive behavior.","Standardize boolean serialization (true/false) across all services generating Cassandra URLs."],"exampleFix":"// before\ncassandra://host:9042?keepalive=yes\n// after\ncassandra://host:9042?keepalive=true","handlingStrategy":"validation","validationCode":"v := strings.TrimSpace(keepalive)\nif _, err := strconv.ParseBool(v); err != nil {\n\treturn fmt.Errorf(\"keepalive must be true/false/1/0, got %q\", keepalive)\n}","typeGuard":"func isParseBoolValue(v string) bool {\n\t_, err := strconv.ParseBool(v)\n\treturn err == nil\n}","tryCatchPattern":"cfg, err := parseCassandraConfig(dsn)\nif err != nil {\n\tif strings.Contains(err.Error(), \"invalid keepalive option\") {\n\t\treturn fmt.Errorf(\"keepalive accepts only ParseBool values: %w\", err)\n\t}\n\treturn err\n}","preventionTips":["Trim trailing newlines from CI/secret-provided values","Use true/false everywhere instead of yes/no/off/enabled","Omit keepalive unless you specifically need to change the default"],"tags":["cassandra","config","tcp","keepalive","boolean-parse"],"backgroundTag":"invalid-boolean-value","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"}