{"record":{"id":"16965ba34a97d51c","repo":"t8y2/dbx","slug":"invalid-tcpnodelay-option-w","errorCode":null,"errorMessage":"invalid tcpnodelay option: %w","messagePattern":"invalid tcpnodelay option: %w","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"agents/drivers/cassandra-go/config.go","lineNumber":230,"sourceCode":"\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)\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","sourceCodeStart":212,"sourceCodeEnd":248,"githubUrl":"https://github.com/t8y2/dbx/blob/c0390bff16418b651f4728520d99adf8ce48829a/agents/drivers/cassandra-go/config.go#L212-L248","documentation":"The 'tcpnodelay' URL parameter must parse as a boolean via strconv.ParseBool. Invalid values are rejected with this wrapped error before any connection is attempted. tcpnodelay controls TCP_NODELAY on the driver's sockets.","triggerScenarios":"tcpnodelay=yes, tcpnodelay=off, tcpnodelay= (empty), or tcpnodelay=0x1 in a cassandra:// URL.","commonSituations":"Reusing 'on/off' style flags from other tooling, empty values from unset environment variables, or shell scripts appending flags unquoted.","solutions":["Use tcpnodelay=true or tcpnodelay=false (or 1/0).","Ensure the parameter isn't empty (unset env vars produce 'tcpnodelay=').","Drop the parameter if you want the driver default.","Validate the generated URL query with url.ParseQuery before handing it to the driver."],"exampleFix":"// before\ncassandra://host:9042?tcpnodelay=off\n// after\ncassandra://host:9042?tcpnodelay=false","handlingStrategy":"validation","validationCode":"if v := os.Getenv(\"CASSANDRA_TCP_NODELAY\"); v != \"\" {\n\tif _, err := strconv.ParseBool(strings.TrimSpace(v)); err != nil {\n\t\treturn fmt.Errorf(\"CASSANDRA_TCP_NODELAY must be true/false, got %q\", v)\n\t}\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 tcpnodelay option\") {\n\t\treturn fmt.Errorf(\"tcpnodelay accepts only ParseBool values (true/false/1/0): %w\", err)\n\t}\n\treturn err\n}","preventionTips":["Guard env-sourced flags against empty values ('tcpnodelay=')","Adopt one boolean convention (true/false) repo-wide","Quote shell interpolations to avoid splitting/whitespace in DSNs"],"tags":["cassandra","config","tcp","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-14T00:17:10.932Z"}