{"id":"d3726da80b3d560c","repo":"go-redis/redis","slug":"redis-client-tracking-prefix-requires-bcast","errorCode":null,"errorMessage":"redis: CLIENT TRACKING PREFIX requires BCAST","messagePattern":"redis: CLIENT TRACKING PREFIX requires BCAST","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"commands.go","lineNumber":634,"sourceCode":"}\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 {\n\t\targs = append(args, \"optin\")\n\t}\n\tif opt.OptOut {","sourceCodeStart":616,"sourceCodeEnd":652,"githubUrl":"https://github.com/go-redis/redis/blob/36d97525cd8076aed67cddf54778e9ea84550929/commands.go#L616-L652","documentation":"Error \"redis: CLIENT TRACKING PREFIX requires BCAST\" thrown in go-redis/redis.","triggerScenarios":"Thrown at commands.go:634 when the library encounters an invalid state.","commonSituations":"Pair PREFIX options with BCAST in a single constructor so the dependency cannot be broken.","solutions":["Enable BCAST when supplying PREFIX prefixes for CLIENT TRACKING","Drop the PREFIX arguments if BCAST mode is not desired"],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"analyzedSha":"36d97525cd8076aed67cddf54778e9ea84550929","analyzedAt":"2026-08-06T01:08:27.376Z","schemaVersion":2}