{"record":{"id":"8616d0cb15cc3295","repo":"JuliusBrussee/caveman","slug":"bedrock-could-not-build-signing-request-w","errorCode":null,"errorMessage":"bedrock: could not build signing request: %w","messagePattern":"bedrock: could not build signing request: %w","errorType":"http","errorClass":null,"httpStatus":null,"severity":"error","filePath":"proxy/providers/bedrock/signing.go","lineNumber":85,"sourceCode":"\t// already-resolved upstream (which honors a per-project base URL); re-resolving\n\t// here with an empty route would sign the adapter's fallback host instead, so a\n\t// project with a custom Bedrock endpoint would get a SigV4 Host mismatch\n\t// (SignatureDoesNotMatch). Fall back to a self-resolve only if the caller passed\n\t// nil (no forward URL available).\n\tif upstream == nil {\n\t\tupstream, err = a.ResolveUpstreamURL(ctx, req, providers.RouteContext{})\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t}\n\n\t// Build a synthetic request carrying the upstream host/path/query and the\n\t// to-be-signed headers, sign it, then merge the signed headers into out. This\n\t// keeps the signing surface (host, path, query, x-amz-*) identical to what the\n\t// proxy actually sends upstream.\n\ttoSign, err := http.NewRequestWithContext(ctx, req.Method, upstream.String(), nil)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"bedrock: could not build signing request: %w\", err)\n\t}\n\ttoSign.Header = out.Clone()\n\n\tsigningService := runtimeService\n\tif mantle {\n\t\tsigningService = mantleService\n\t}\n\tpayloadHash, err := requestPayloadHash(ctx, req)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tsigner := awssig.Signer{Region: signingRegion(req, upstream), Service: signingService}\n\tif err := signer.Sign(toSign, creds, payloadHash, time.Now()); err != nil {\n\t\t// The error from Sign never contains the secret (see awssig docs); still,\n\t\t// return a generic mapping error rather than the raw text.\n\t\treturn nil, fmt.Errorf(\"bedrock: request signing failed\")\n\t}\n","sourceCodeStart":67,"sourceCodeEnd":103,"githubUrl":"https://github.com/JuliusBrussee/caveman/blob/27d5a3981a347890211bb1bf2439e5c821a63bc9/proxy/providers/bedrock/signing.go#L67-L103","documentation":"Error \"bedrock: could not build signing request: %w\" thrown in JuliusBrussee/caveman.","triggerScenarios":"Thrown at proxy/providers/bedrock/signing.go:85 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Fix the signing request construction error."],"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-15T22:17:37.221Z"}