go-redis/redis · error

routing: unknown request_policy %q

Error message

routing: unknown request_policy %q

What it means

Error "routing: unknown request_policy %q" thrown in go-redis/redis.

Source

Thrown at internal/routing/policy.go:56

	default:
		return fmt.Sprintf("unknown_request_policy(%d)", p)
	}
}

func ParseRequestPolicy(raw string) (RequestPolicy, error) {
	switch strings.ToLower(raw) {
	case "", "default", "none":
		return ReqDefault, nil
	case "all_nodes":
		return ReqAllNodes, nil
	case "all_shards":
		return ReqAllShards, nil
	case "multi_shard":
		return ReqMultiShard, nil
	case "special":
		return ReqSpecial, nil
	default:
		return ReqDefault, fmt.Errorf("routing: unknown request_policy %q", raw)
	}
}

type ResponsePolicy uint8

const (
	RespDefaultKeyless ResponsePolicy = iota
	RespDefaultHashSlot
	RespAllSucceeded
	RespOneSucceeded
	RespAggSum
	RespAggMin
	RespAggMax
	RespAggLogicalAnd
	RespAggLogicalOr
	RespSpecial
)

View on GitHub (pinned to 36d97525cd)

Solutions

  1. Use a registered request policy name (see internal/routing/policy.go registrations)
  2. Fix the policy string in the routing configuration

When it happens

Trigger: Thrown at internal/routing/policy.go:56 when the library encounters an invalid state.

Common situations: Reference policies by exported constants rather than raw strings.


AI-assisted analysis of go-redis/redis@36d97525cd (2026-08-06). Data as JSON: /data/errors/1c6bb736312a932d.json. Report an issue: GitHub.