JuliusBrussee/caveman · error

cacheengine: max request bytes must be within 0..%d

Error message

cacheengine: max request bytes must be within 0..%d

What it means

Error "cacheengine: max request bytes must be within 0..%d" thrown in JuliusBrussee/caveman.

Source

Thrown at cacheengine/engine.go:63

			resolveProfile: defaultProfile, drivers: map[string]Driver{}, configErr: err,
		}
	}
	return engine
}

// NewChecked validates configuration at construction time. New preserves its
// original one-result API but stores the same configuration error and makes all
// operations fail closed.
func NewChecked(config Config) (*Engine, error) {
	return newEngine(config)
}

func newEngine(config Config) (*Engine, error) {
	if config.MaxKeyShards < 0 || config.MaxKeyShards > maxConfiguredKeyShards {
		return nil, fmt.Errorf("cacheengine: max key shards must be within 0..%d", maxConfiguredKeyShards)
	}
	if config.MaxRequestBytes < 0 || config.MaxRequestBytes > maxConfiguredByteLimit {
		return nil, fmt.Errorf("cacheengine: max request bytes must be within 0..%d", maxConfiguredByteLimit)
	}
	if config.MaxStablePrefixBytes < 0 || config.MaxStablePrefixBytes > maxConfiguredByteLimit {
		return nil, fmt.Errorf("cacheengine: max stable prefix bytes must be within 0..%d", maxConfiguredByteLimit)
	}
	maxShards := config.MaxKeyShards
	if maxShards == 0 {
		maxShards = 64
	}
	maxRequestBytes := config.MaxRequestBytes
	if maxRequestBytes == 0 {
		maxRequestBytes = defaultInputByteLimit
	}
	maxStablePrefixBytes := config.MaxStablePrefixBytes
	if maxStablePrefixBytes == 0 {
		maxStablePrefixBytes = defaultInputByteLimit
	}
	resolver := config.ResolveProfile
	if resolver == nil {

View on GitHub (pinned to 27d5a3981a)

Solutions

  1. Set max request bytes within the allowed range.

When it happens

Trigger: Thrown at cacheengine/engine.go:63 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of JuliusBrussee/caveman@27d5a3981a (2026-08-15). Data as JSON: /api/errors/443ac754f1eb4b3a. Report an issue: GitHub.