JuliusBrussee/caveman · error
cachebench: replay base URL
Error message
cachebench: %s replay base URL: %w
What it means
A configured per-provider replay base URL failed validation (parse failure or unsafe scheme/host) while NewHTTPReplayTransport was overriding the default endpoint; the wrapped error names the provider and cause.
Solutions
- Use an https URL with a host that passes the SSRF/safety checks
- Point test runs at a local httptest server via its https URL or adjust validation
Defensive patterns
Strategy: validation
When it happens
Trigger: Thrown at cacheengine/cachebench/replay_http.go:89 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/98798291cba81c2b.
Report an issue: GitHub.
Appendix: source
Thrown at cacheengine/cachebench/replay_http.go:89
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)
}
parsed[provider] = base
}
client := config.Client
if client == nil {
client = &http.Client{
Timeout: requestTimeout,
Transport: &http.Transport{
Proxy: nil,
DialContext: (&net.Dialer{Timeout: 10 * time.Second, KeepAlive: 30 * time.Second}).DialContext,
ForceAttemptHTTP2: true,
TLSClientConfig: &tls.Config{MinVersion: tls.VersionTLS12},
TLSHandshakeTimeout: 10 * time.Second,
ResponseHeaderTimeout: 90 * time.Second,
IdleConnTimeout: 90 * time.Second,
},
}
} else {View on GitHub (pinned to 766dce6b13)