{"record":{"id":"98798291cba81c2b","repo":"JuliusBrussee/caveman","slug":"cachebench-s-replay-base-url-w","errorCode":null,"errorMessage":"cachebench: %s replay base URL: %w","messagePattern":"cachebench: (.+?) replay base URL: %w","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"cacheengine/cachebench/replay_http.go","lineNumber":89,"sourceCode":"\t\treturn nil, errors.New(\"cachebench: replay request timeout must be between 1 second and 1 hour\")\n\t}\n\tbases := map[string]string{\n\t\t\"openai\":    \"https://api.openai.com\",\n\t\t\"anthropic\": \"https://api.anthropic.com\",\n\t\t\"gemini\":    \"https://generativelanguage.googleapis.com\",\n\t}\n\tfor provider, value := range config.BaseURLs {\n\t\tprovider = strings.ToLower(strings.TrimSpace(provider))\n\t\tif provider != \"openai\" && provider != \"anthropic\" && provider != \"gemini\" && provider != \"bedrock\" {\n\t\t\treturn nil, fmt.Errorf(\"cachebench: unsupported replay base URL provider %q\", provider)\n\t\t}\n\t\tbases[provider] = value\n\t}\n\tparsed := make(map[string]*url.URL, len(bases))\n\tfor provider, value := range bases {\n\t\tbase, err := validateReplayBaseURL(value, config.AllowInsecureLoopback)\n\t\tif err != nil {\n\t\t\treturn nil, fmt.Errorf(\"cachebench: %s replay base URL: %w\", provider, err)\n\t\t}\n\t\tparsed[provider] = base\n\t}\n\tclient := config.Client\n\tif client == nil {\n\t\tclient = &http.Client{\n\t\t\tTimeout: requestTimeout,\n\t\t\tTransport: &http.Transport{\n\t\t\t\tProxy:                 nil,\n\t\t\t\tDialContext:           (&net.Dialer{Timeout: 10 * time.Second, KeepAlive: 30 * time.Second}).DialContext,\n\t\t\t\tForceAttemptHTTP2:     true,\n\t\t\t\tTLSClientConfig:       &tls.Config{MinVersion: tls.VersionTLS12},\n\t\t\t\tTLSHandshakeTimeout:   10 * time.Second,\n\t\t\t\tResponseHeaderTimeout: 90 * time.Second,\n\t\t\t\tIdleConnTimeout:       90 * time.Second,\n\t\t\t},\n\t\t}\n\t} else {","sourceCodeStart":71,"sourceCodeEnd":107,"githubUrl":"https://github.com/JuliusBrussee/caveman/blob/766dce6b1394ebb56a3090748d5a0240a5aefb36/cacheengine/cachebench/replay_http.go#L71-L107","documentation":"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.","triggerScenarios":"Thrown at cacheengine/cachebench/replay_http.go:89 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","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"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"766dce6b1394ebb56a3090748d5a0240a5aefb36","analyzedAt":"2026-08-18T03:14:35.516Z","contentChangedAt":"2026-08-18T03:14:35.516Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}