{"id":"30e810a3b2cf9d7e","repo":"go-redis/redis","slug":"redis-cannot-aggregate-command-s-unsupported-co","errorCode":null,"errorMessage":"redis: cannot aggregate command %s: unsupported command type %d","messagePattern":"redis: cannot aggregate command (.+?): unsupported command type (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"osscluster_router.go","lineNumber":532,"sourceCode":"\nfunc (c *ClusterClient) readOnlyEnabled() bool {\n\treturn c.opt.ReadOnly\n}\n\n// setCommandValue sets the aggregated value on a command using the enum-based approach\nfunc (c *ClusterClient) setCommandValue(cmd Cmder, value interface{}) error {\n\t// If value is nil, it might mean ExtractCommandValue couldn't extract the value\n\t// but the command might have executed successfully. In this case, don't set an error.\n\tif value == nil {\n\t\t// ExtractCommandValue returned nil - this means the command type is not supported\n\t\t// in the aggregation flow. This is a programming error, not a runtime error.\n\t\tif cmd.Err() != nil {\n\t\t\t// Command already has an error, preserve it\n\t\t\treturn cmd.Err()\n\t\t}\n\t\t// Command executed successfully but we can't extract/set the aggregated value\n\t\t// This indicates the command type needs to be added to ExtractCommandValue\n\t\treturn fmt.Errorf(\"redis: cannot aggregate command %s: unsupported command type %d\",\n\t\t\tcmd.Name(), cmd.GetCmdType())\n\t}\n\n\tswitch cmd.GetCmdType() {\n\tcase CmdTypeGeneric:\n\t\tif c, ok := cmd.(*Cmd); ok {\n\t\t\tc.SetVal(value)\n\t\t}\n\tcase CmdTypeString:\n\t\tif c, ok := cmd.(*StringCmd); ok {\n\t\t\tif v, ok := value.(string); ok {\n\t\t\t\tc.SetVal(v)\n\t\t\t}\n\t\t}\n\tcase CmdTypeInt:\n\t\tif c, ok := cmd.(*IntCmd); ok {\n\t\t\tif v, ok := value.(int64); ok {\n\t\t\t\tc.SetVal(v)","sourceCodeStart":514,"sourceCodeEnd":550,"githubUrl":"https://github.com/go-redis/redis/blob/36d97525cd8076aed67cddf54778e9ea84550929/osscluster_router.go#L514-L550","documentation":"Error \"redis: cannot aggregate command %s: unsupported command type %d\" thrown in go-redis/redis.","triggerScenarios":"Thrown at osscluster_router.go:532 when the library encounters an invalid state.","commonSituations":"Consult the routing table before issuing multi-shard variants of a command.","solutions":["Do not fan out this command type across shards; run it per-shard or on a single node","Use a supported aggregator for the command"],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"analyzedSha":"36d97525cd8076aed67cddf54778e9ea84550929","analyzedAt":"2026-08-06T01:08:27.376Z","schemaVersion":2}