{"record":{"id":"fa41308725a83888","repo":"JuliusBrussee/caveman","slug":"cachebench-unsupported-bedrock-replay-endpoint-or","errorCode":null,"errorMessage":"cachebench: unsupported Bedrock replay endpoint or region","messagePattern":"cachebench: unsupported Bedrock replay endpoint or region","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"cacheengine/cachebench/replay_http.go","lineNumber":199,"sourceCode":"\tswitch provider {\n\tcase \"openai\":\n\t\tif outbound.Endpoint != \"/v1/chat/completions\" && outbound.Endpoint != \"/v1/responses\" {\n\t\t\treturn nil, errors.New(\"cachebench: unsupported OpenAI replay endpoint\")\n\t\t}\n\t\tpath = outbound.Endpoint\n\tcase \"anthropic\":\n\t\tif outbound.Endpoint != \"/v1/messages\" {\n\t\t\treturn nil, errors.New(\"cachebench: unsupported Anthropic replay endpoint\")\n\t\t}\n\t\tpath = outbound.Endpoint\n\tcase \"gemini\":\n\t\tif outbound.Endpoint != \"generateContent\" {\n\t\t\treturn nil, errors.New(\"cachebench: unsupported Gemini replay endpoint\")\n\t\t}\n\t\trawPath = \"/v1beta/models/\" + url.PathEscape(outbound.Model) + \":generateContent\"\n\tcase \"bedrock\":\n\t\tif outbound.Endpoint != \"converse\" || !validAWSRegion(outbound.Region) {\n\t\t\treturn nil, errors.New(\"cachebench: unsupported Bedrock replay endpoint or region\")\n\t\t}\n\t\trawPath = \"/model/\" + url.PathEscape(outbound.Model) + \"/converse\"\n\tdefault:\n\t\treturn nil, fmt.Errorf(\"cachebench: unsupported replay provider %q\", provider)\n\t}\n\tresolved := *base\n\tif rawPath == \"\" {\n\t\tresolved.Path = strings.TrimRight(base.Path, \"/\") + path\n\t\tresolved.RawPath = \"\"\n\t} else {\n\t\tresolved.RawPath = strings.TrimRight(base.EscapedPath(), \"/\") + rawPath\n\t\tresolved.Path, _ = url.PathUnescape(resolved.RawPath)\n\t}\n\tresolved.RawQuery = \"\"\n\tresolved.Fragment = \"\"\n\treturn &resolved, nil\n}\n","sourceCodeStart":181,"sourceCodeEnd":217,"githubUrl":"https://github.com/JuliusBrussee/caveman/blob/766dce6b1394ebb56a3090748d5a0240a5aefb36/cacheengine/cachebench/replay_http.go#L181-L217","documentation":"endpoint's bedrock case validates the requested invoke path and region combination and rejects anything outside the supported Bedrock invoke surface (or a region that fails validation for URL building). It fires when outbound.Endpoint is not a recognized Bedrock model-invocation path or the region cannot safely form the bedrock-runtime host.","triggerScenarios":"Thrown at cacheengine/cachebench/replay_http.go:199 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Use a supported Bedrock invoke endpoint and valid region","Configure an explicit Bedrock base URL for non-standard endpoints"],"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"}