JuliusBrussee/caveman · error
cachebench: replay request timeout must be between 1 second…
Error message
cachebench: replay request timeout must be between 1 second and 1 hour
What it means
NewHTTPReplayTransport validated the per-request timeout and found it under 1 second or over 1 hour (0 defaults to 2 minutes). The window prevents both uselessly short timeouts and hung replays; out-of-range values are rejected at construction.
Solutions
- Set RequestTimeout between 1 second and 1 hour, or leave 0 for the default
- Fix the config supplying the timeout
Defensive patterns
Strategy: validation
When it happens
Trigger: Thrown at cacheengine/cachebench/replay_http.go:71 when the library encounters an invalid state.
Common situations: See trigger scenarios.
Understand the failure class
- Timeouts: ETIMEDOUT, deadlines, and hung requests — what actually expires when a request times out.
AI-assisted analysis of JuliusBrussee/caveman@766dce6b13 (2026-08-18).
Data as JSON: /api/errors/242994fe0cfa4b48.
Report an issue: GitHub.
Appendix: source
Thrown at cacheengine/cachebench/replay_http.go:71
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",
"gemini": "https://generativelanguage.googleapis.com",
}
for provider, value := range config.BaseURLs {
provider = strings.ToLower(strings.TrimSpace(provider))
if provider != "openai" && provider != "anthropic" && provider != "gemini" && provider != "bedrock" {
return nil, fmt.Errorf("cachebench: unsupported replay base URL provider %q", provider)
}
bases[provider] = value
}
parsed := make(map[string]*url.URL, len(bases))
for provider, value := range bases {
base, err := validateReplayBaseURL(value, config.AllowInsecureLoopback)
if err != nil {
return nil, fmt.Errorf("cachebench: %s replay base URL: %w", provider, err)View on GitHub (pinned to 766dce6b13)