{"id":"1c6bb736312a932d","repo":"go-redis/redis","slug":"routing-unknown-request-policy-q","errorCode":null,"errorMessage":"routing: unknown request_policy %q","messagePattern":"routing: unknown request_policy %q","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/routing/policy.go","lineNumber":56,"sourceCode":"\tdefault:\n\t\treturn fmt.Sprintf(\"unknown_request_policy(%d)\", p)\n\t}\n}\n\nfunc ParseRequestPolicy(raw string) (RequestPolicy, error) {\n\tswitch strings.ToLower(raw) {\n\tcase \"\", \"default\", \"none\":\n\t\treturn ReqDefault, nil\n\tcase \"all_nodes\":\n\t\treturn ReqAllNodes, nil\n\tcase \"all_shards\":\n\t\treturn ReqAllShards, nil\n\tcase \"multi_shard\":\n\t\treturn ReqMultiShard, nil\n\tcase \"special\":\n\t\treturn ReqSpecial, nil\n\tdefault:\n\t\treturn ReqDefault, fmt.Errorf(\"routing: unknown request_policy %q\", raw)\n\t}\n}\n\ntype ResponsePolicy uint8\n\nconst (\n\tRespDefaultKeyless ResponsePolicy = iota\n\tRespDefaultHashSlot\n\tRespAllSucceeded\n\tRespOneSucceeded\n\tRespAggSum\n\tRespAggMin\n\tRespAggMax\n\tRespAggLogicalAnd\n\tRespAggLogicalOr\n\tRespSpecial\n)\n","sourceCodeStart":38,"sourceCodeEnd":74,"githubUrl":"https://github.com/go-redis/redis/blob/36d97525cd8076aed67cddf54778e9ea84550929/internal/routing/policy.go#L38-L74","documentation":"Error \"routing: unknown request_policy %q\" thrown in go-redis/redis.","triggerScenarios":"Thrown at internal/routing/policy.go:56 when the library encounters an invalid state.","commonSituations":"Reference policies by exported constants rather than raw strings.","solutions":["Use a registered request policy name (see internal/routing/policy.go registrations)","Fix the policy string in the routing configuration"],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"analyzedSha":"36d97525cd8076aed67cddf54778e9ea84550929","analyzedAt":"2026-08-06T01:08:27.376Z","schemaVersion":2}