{"record":{"id":"3f12b5ae65c7ba57","repo":"JuliusBrussee/caveman","slug":"bedrock-endpoint-host-q-does-not-match-endpoint-k","errorCode":null,"errorMessage":"bedrock endpoint host %q does not match endpoint kind %q","messagePattern":"bedrock endpoint host %q does not match endpoint kind %q","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"proxy/providers/bedrock/routing.go","lineNumber":207,"sourceCode":"\t\t\treturn nil, fmt.Errorf(\"bedrock Mantle path %q is not allowed\", req.URL.Path)\n\t\t}\n\t\tbase, err = resolveMantleBase(base, region)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tbase.Path = strings.TrimRight(base.Path, \"/\") + strings.TrimPrefix(req.URL.Path, \"/bedrock\")\n\tdefault:\n\t\treturn nil, fmt.Errorf(\"bedrock request path %q is not allowed\", req.URL.Path)\n\t}\n\tbase.RawQuery = req.URL.RawQuery\n\n\tif env.IsProduction() {\n\t\tif err := ssrf.ValidateURL(ctx, base.String(), ssrf.ManagedConfig()); err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\thostKind, _, ok := bedrockHostKind(base.Hostname())\n\t\tif !ok || hostKind != kind {\n\t\t\treturn nil, fmt.Errorf(\"bedrock endpoint host %q does not match endpoint kind %q\", base.Hostname(), kind)\n\t\t}\n\t}\n\treturn base, nil\n}\n\nfunc endpointKindForPath(path string) string {\n\tswitch {\n\tcase strings.HasPrefix(path, \"/bedrock/model/\"):\n\t\treturn endpointRuntime\n\tcase strings.HasPrefix(path, \"/bedrock/anthropic/\"):\n\t\treturn endpointMantle\n\tdefault:\n\t\treturn \"\"\n\t}\n}\n\nfunc mantleActionAllowed(path string) bool {\n\tswitch path {","sourceCodeStart":189,"sourceCodeEnd":225,"githubUrl":"https://github.com/JuliusBrussee/caveman/blob/27d5a3981a347890211bb1bf2439e5c821a63bc9/proxy/providers/bedrock/routing.go#L189-L225","documentation":"Error \"bedrock endpoint host %q does not match endpoint kind %q\" thrown in JuliusBrussee/caveman.","triggerScenarios":"Thrown at proxy/providers/bedrock/routing.go:207 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Use an endpoint host matching the configured endpoint kind."],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"27d5a3981a347890211bb1bf2439e5c821a63bc9","analyzedAt":"2026-08-15T09:26:11.751Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}