{"record":{"id":"49632e81134fd1fd","repo":"redis/go-redis","slug":"redis-non-string-key-at-position-d-v","errorCode":null,"errorMessage":"redis: non-string key at position %d: %v","messagePattern":"redis: non-string key at position (.+?): (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"osscluster_router.go","lineNumber":132,"sourceCode":"\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}\n\t\t\tslotMap[slot] = append(slotMap[slot], args[i+j].(string))\n\t\t}\n\t\tkeyOrder = append(keyOrder, key)\n\t}\n\n\treturn c.executeMultiSlot(ctx, cmd, slotMap, keyOrder, policy, firstKeyPos)\n}\n\n// executeMultiSlot executes commands across multiple slots concurrently\nfunc (c *ClusterClient) executeMultiSlot(ctx context.Context, cmd Cmder, slotMap map[int][]string, keyOrder []string, policy *routing.CommandPolicy, firstKeyPos int) error {","sourceCodeStart":114,"sourceCodeEnd":150,"githubUrl":"https://github.com/redis/go-redis/blob/c5cad058c72f58370553b48566302303cf8a2e89/osscluster_router.go#L114-L150","documentation":"Error \"redis: non-string key at position %d: %v\" thrown in redis/go-redis.","triggerScenarios":"Thrown at osscluster_router.go:132 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"}