JuliusBrussee/caveman · error
cachebench: replay request limit must be between 1 byte and…
Error message
cachebench: replay request limit must be between 1 byte and 256 MiB
What it means
NewHTTPReplayTransport validated the configured request-size ceiling and found it below 1 byte or above 256 MiB (0 defaults to 64 MiB first). The bound keeps replay memory predictable; out-of-range limits are rejected at construction before any transport is built.
Solutions
- Set MaxRequestBytes within 1 byte to 256 MiB, or leave 0 for the default
- Check for negative/garbage values in the cachebench config
Defensive patterns
Strategy: validation
When it happens
Trigger: Thrown at cacheengine/cachebench/replay_http.go:57 when the library encounters an invalid state.
Common situations: See trigger scenarios.
AI-assisted analysis of JuliusBrussee/caveman@766dce6b13 (2026-08-18).
Data as JSON: /api/errors/c041ec193dca7084.
Report an issue: GitHub.
Appendix: source
Thrown at cacheengine/cachebench/replay_http.go:57
}
// HTTPReplayTransport sends official non-streaming provider requests.
type HTTPReplayTransport struct {
client *http.Client
credentials HTTPReplayCredentials
baseURLs map[string]*url.URL
maxRequestBytes int64
maxResponseBytes int64
}
// NewHTTPReplayTransport validates endpoints, limits, TLS, and redirect policy.
func NewHTTPReplayTransport(config HTTPReplayConfig) (*HTTPReplayTransport, error) {
requestLimit := config.MaxRequestBytes
if requestLimit == 0 {
requestLimit = 64 << 20
}
if requestLimit < 1 || requestLimit > 256<<20 {
return nil, errors.New("cachebench: replay request limit must be between 1 byte and 256 MiB")
}
limit := config.MaxResponseBytes
if limit == 0 {
limit = defaultReplayResponseLimit
}
if limit < 1 || limit > 256<<20 {
return nil, errors.New("cachebench: replay response limit must be between 1 byte and 256 MiB")
}
requestTimeout := config.RequestTimeout
if requestTimeout == 0 {
requestTimeout = 2 * time.Minute
}
if requestTimeout < time.Second || requestTimeout > time.Hour {
return nil, errors.New("cachebench: replay request timeout must be between 1 second and 1 hour")
}
bases := map[string]string{
"openai": "https://api.openai.com",
"anthropic": "https://api.anthropic.com",View on GitHub (pinned to 766dce6b13)