{"record":{"id":"771806c4722a3959","repo":"redis/go-redis","slug":"redis-multi-shard-command-s-has-no-key-arguments","errorCode":null,"errorMessage":"redis: multi-shard command %s has no key arguments","messagePattern":"redis: multi-shard command (.+?) has no key arguments","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"osscluster_router.go","lineNumber":122,"sourceCode":"\n\tif len(state.Masters) == 0 {\n\t\treturn errClusterNoNodes\n\t}\n\n\treturn c.executeParallel(ctx, cmd, state.Masters, policy)\n}\n\n// executeMultiShard handles commands that operate on multiple keys across shards\nfunc (c *ClusterClient) executeMultiShard(ctx context.Context, cmd Cmder, policy *routing.CommandPolicy) error {\n\targs := cmd.Args()\n\tfirstKeyPos := cmdFirstKeyPosWithInfo(cmd, c.cmdInfoPeek(cmd.Name()))\n\tstepCount := int(cmd.stepCount())\n\tif stepCount == 0 {\n\t\tstepCount = 1 // Default to 1 if not set\n\t}\n\n\tif firstKeyPos == 0 || firstKeyPos >= len(args) {\n\t\treturn fmt.Errorf(\"redis: multi-shard command %s has no key arguments\", cmd.Name())\n\t}\n\n\t// Group keys by slot\n\tslotMap := make(map[int][]string)\n\tkeyOrder := make([]string, 0)\n\n\tfor i := firstKeyPos; i < len(args); i += stepCount {\n\t\tkey, ok := args[i].(string)\n\t\tif !ok {\n\t\t\treturn fmt.Errorf(\"redis: non-string key at position %d: %v\", i, args[i])\n\t\t}\n\n\t\tslot := hashtag.Slot(key)\n\t\tslotMap[slot] = append(slotMap[slot], key)\n\t\tfor j := 1; j < stepCount; j++ {\n\t\t\tif i+j >= len(args) {\n\t\t\t\tbreak\n\t\t\t}","sourceCodeStart":104,"sourceCodeEnd":140,"githubUrl":"https://github.com/redis/go-redis/blob/c5cad058c72f58370553b48566302303cf8a2e89/osscluster_router.go#L104-L140","documentation":"Error \"redis: multi-shard command %s has no key arguments\" thrown in redis/go-redis.","triggerScenarios":"Thrown at osscluster_router.go:122 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"c5cad058c72f58370553b48566302303cf8a2e89","analyzedAt":"2026-09-01T06:50:53.388Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}