{"id":"80b79cd211715240","repo":"go-redis/redis","slug":"redis-failed-to-set-command-value-v","errorCode":null,"errorMessage":"redis: failed to set command value: %v","messagePattern":"redis: failed to set command value: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"osscluster_router.go","lineNumber":1002,"sourceCode":"\tswitch cmd.(type) {\n\tcase *XAutoClaimCmd, *XAutoClaimJustIDCmd:\n\t\targs = append(args, reflect.ValueOf(\"\"))\n\tcase *ScanCmd:\n\t\targs = append(args, reflect.ValueOf(uint64(0)))\n\tcase *KeyValuesCmd, *ZSliceWithKeyCmd:\n\t\tif key, ok := value.(string); ok {\n\t\t\targs = []reflect.Value{reflect.ValueOf(key)}\n\t\t\tif _, ok := cmd.(*ZSliceWithKeyCmd); ok {\n\t\t\t\targs = append(args, reflect.ValueOf([]Z{}))\n\t\t\t} else {\n\t\t\t\targs = append(args, reflect.ValueOf([]string{}))\n\t\t\t}\n\t\t}\n\t}\n\n\tdefer func() {\n\t\tif r := recover(); r != nil {\n\t\t\tcmd.SetErr(fmt.Errorf(\"redis: failed to set command value: %v\", r))\n\t\t}\n\t}()\n\n\tsetValMethod.Call(args)\n\treturn nil\n}\n","sourceCodeStart":984,"sourceCodeEnd":1009,"githubUrl":"https://github.com/go-redis/redis/blob/36d97525cd8076aed67cddf54778e9ea84550929/osscluster_router.go#L984-L1009","documentation":"Error \"redis: failed to set command value: %v\" thrown in go-redis/redis.","triggerScenarios":"Thrown at osscluster_router.go:1002 when the library encounters an invalid state.","commonSituations":"Type-match aggregator outputs to the Cmder value type before SetVal.","solutions":["Inspect the error value; SetVal on the aggregated command failed","Ensure the aggregated result type matches the command's expected value type"],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"analyzedSha":"36d97525cd8076aed67cddf54778e9ea84550929","analyzedAt":"2026-08-06T01:08:27.376Z","schemaVersion":2}