{"id":"0aa21619b3d1867d","repo":"go-redis/redis","slug":"redis-client-tracking-bcast-cannot-be-combined-wi","errorCode":null,"errorMessage":"redis: CLIENT TRACKING BCAST cannot be combined with OPTIN or OPTOUT","messagePattern":"redis: CLIENT TRACKING BCAST cannot be combined with OPTIN or OPTOUT","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"commands.go","lineNumber":631,"sourceCode":"\tcmd := NewStatusCmd(ctx, args...)\n\t_ = c(ctx, cmd)\n\treturn cmd\n}\n\n// ClientTrackingOff disables tracking on the serving connection. See\n// ClientTracking for the pooled-client and built-in-CSC caveats.\nfunc (c cmdable) ClientTrackingOff(ctx context.Context) *StatusCmd {\n\tcmd := NewStatusCmd(ctx, \"client\", \"tracking\", \"off\")\n\t_ = c(ctx, cmd)\n\treturn cmd\n}\n\nfunc validateClientTrackingOptions(opt *ClientTrackingOptions) error {\n\tif opt.OptIn && opt.OptOut {\n\t\treturn errors.New(\"redis: CLIENT TRACKING OPTIN and OPTOUT are mutually exclusive\")\n\t}\n\tif opt.Bcast && (opt.OptIn || opt.OptOut) {\n\t\treturn errors.New(\"redis: CLIENT TRACKING BCAST cannot be combined with OPTIN or OPTOUT\")\n\t}\n\tif len(opt.Prefixes) > 0 && !opt.Bcast {\n\t\treturn errors.New(\"redis: CLIENT TRACKING PREFIX requires BCAST\")\n\t}\n\treturn nil\n}\n\nfunc appendClientTrackingOptions(args []interface{}, opt *ClientTrackingOptions) []interface{} {\n\tif opt.Redirect != 0 {\n\t\targs = append(args, \"redirect\", opt.Redirect)\n\t}\n\tif opt.Bcast {\n\t\targs = append(args, \"bcast\")\n\t}\n\tfor _, p := range opt.Prefixes {\n\t\targs = append(args, \"prefix\", p)\n\t}\n\tif opt.OptIn {","sourceCodeStart":613,"sourceCodeEnd":649,"githubUrl":"https://github.com/go-redis/redis/blob/36d97525cd8076aed67cddf54778e9ea84550929/commands.go#L613-L649","documentation":"Error \"redis: CLIENT TRACKING BCAST cannot be combined with OPTIN or OPTOUT\" thrown in go-redis/redis.","triggerScenarios":"Thrown at commands.go:631 when the library encounters an invalid state.","commonSituations":"Validate CLIENT TRACKING flag combinations against the Redis documentation matrix before sending.","solutions":["Use BCAST mode alone, or use OPTIN/OPTOUT without BCAST","Remove the conflicting flags from the CLIENT TRACKING arguments"],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"analyzedSha":"36d97525cd8076aed67cddf54778e9ea84550929","analyzedAt":"2026-08-06T01:08:27.376Z","schemaVersion":2}