go-redis/redis · error
redis: CLIENT TRACKING BCAST cannot be combined with OPTIN o
Error message
redis: CLIENT TRACKING BCAST cannot be combined with OPTIN or OPTOUT
What it means
Error "redis: CLIENT TRACKING BCAST cannot be combined with OPTIN or OPTOUT" thrown in go-redis/redis.
Source
Thrown at commands.go:631
cmd := NewStatusCmd(ctx, args...)
_ = c(ctx, cmd)
return cmd
}
// ClientTrackingOff disables tracking on the serving connection. See
// ClientTracking for the pooled-client and built-in-CSC caveats.
func (c cmdable) ClientTrackingOff(ctx context.Context) *StatusCmd {
cmd := NewStatusCmd(ctx, "client", "tracking", "off")
_ = c(ctx, cmd)
return cmd
}
func validateClientTrackingOptions(opt *ClientTrackingOptions) error {
if opt.OptIn && opt.OptOut {
return errors.New("redis: CLIENT TRACKING OPTIN and OPTOUT are mutually exclusive")
}
if opt.Bcast && (opt.OptIn || opt.OptOut) {
return errors.New("redis: CLIENT TRACKING BCAST cannot be combined with OPTIN or OPTOUT")
}
if len(opt.Prefixes) > 0 && !opt.Bcast {
return errors.New("redis: CLIENT TRACKING PREFIX requires BCAST")
}
return nil
}
func appendClientTrackingOptions(args []interface{}, opt *ClientTrackingOptions) []interface{} {
if opt.Redirect != 0 {
args = append(args, "redirect", opt.Redirect)
}
if opt.Bcast {
args = append(args, "bcast")
}
for _, p := range opt.Prefixes {
args = append(args, "prefix", p)
}
if opt.OptIn {View on GitHub (pinned to 36d97525cd)
Solutions
- Use BCAST mode alone, or use OPTIN/OPTOUT without BCAST
- Remove the conflicting flags from the CLIENT TRACKING arguments
When it happens
Trigger: Thrown at commands.go:631 when the library encounters an invalid state.
Common situations: Validate CLIENT TRACKING flag combinations against the Redis documentation matrix before sending.
AI-assisted analysis of go-redis/redis@36d97525cd (2026-08-06).
Data as JSON: /data/errors/0aa21619b3d1867d.json.
Report an issue: GitHub.