grpc/grpc-go · error
max_ring_size value of %d is greater than max supported valu
Error message
max_ring_size value of %d is greater than max supported value %d for this field
What it means
Returned by ringhash.parseConfig (config.go:45-47) when MaxRingSize exceeds ringHashSizeUpperBound (8M). Same memory-cap rationale as MinRingSize. The %d values are the offending value and the 8M bound.
Source
Thrown at balancer/ringhash/config.go:46
iringhash "google.golang.org/grpc/internal/ringhash"
)
const (
defaultMinSize = 1024
defaultMaxSize = 4096
ringHashSizeUpperBound = 8 * 1024 * 1024 // 8M
)
func parseConfig(c json.RawMessage) (*iringhash.LBConfig, error) {
var cfg iringhash.LBConfig
if err := json.Unmarshal(c, &cfg); err != nil {
return nil, err
}
if cfg.MinRingSize > ringHashSizeUpperBound {
return nil, fmt.Errorf("min_ring_size value of %d is greater than max supported value %d for this field", cfg.MinRingSize, ringHashSizeUpperBound)
}
if cfg.MaxRingSize > ringHashSizeUpperBound {
return nil, fmt.Errorf("max_ring_size value of %d is greater than max supported value %d for this field", cfg.MaxRingSize, ringHashSizeUpperBound)
}
if cfg.MinRingSize == 0 {
cfg.MinRingSize = defaultMinSize
}
if cfg.MaxRingSize == 0 {
cfg.MaxRingSize = defaultMaxSize
}
if cfg.MinRingSize > cfg.MaxRingSize {
return nil, fmt.Errorf("min %v is greater than max %v", cfg.MinRingSize, cfg.MaxRingSize)
}
if cfg.MinRingSize > envconfig.RingHashCap {
cfg.MinRingSize = envconfig.RingHashCap
}
if cfg.MaxRingSize > envconfig.RingHashCap {
cfg.MaxRingSize = envconfig.RingHashCap
}
if !envconfig.RingHashSetRequestHashKey {
cfg.RequestHashHeader = ""View on GitHub (pinned to 03255a9237)
Solutions
- Set maxRingSize to at most 8388608; default is 4096 and rarely needs to be larger.
- Verify the xDS Cluster.ringHashLbConfig.maximumRingSize value in the control plane.
Example fix
// before
raw := `{"minRingSize": 1024, "maxRingSize": 100000000}` // > 8M -> error
// after
raw := `{"minRingSize": 1024, "maxRingSize": 4096}` Defensive patterns
Strategy: validation
Validate before calling
const ringHashUpperBound = 8 * 1024 * 1024
func validateMaxRingSize(raw []byte) error {
var c struct{ MaxRingSize uint64 `json:"maxRingSize"` }
_ = json.Unmarshal(raw, &c)
if c.MaxRingSize > ringHashUpperBound {
return fmt.Errorf("maxRingSize %d > %d", c.MaxRingSize, ringHashUpperBound)
}
return nil
} Prevention
- Same as minRingSize: small thousands are plenty.
- Lint the config in CI to reject values above the 8M cap.
When it happens
Trigger: The ring_hash config sets maxRingSize above 8388608.
Common situations: Unit confusion (treating the field as bytes), xDS control-plane misconfiguration, or attempting to maximize distribution without realizing the hard cap.
Related errors
- min_ring_size value of %d is greater than max supported valu
- min %v is greater than max %v
- invalid requestHashHeader %q: %v
- invalid requestHashHeader %q, key must not end with "-bin"
- randomsubsetting: json.Unmarshal failed for configuration: %
AI-assisted analysis of grpc/grpc-go@03255a9237 (2026-08-07).
Data as JSON: /api/errors/7bae25ac94fe7435.
Report an issue: GitHub.