aws-sdk-cpp icon indicating copy to clipboard operation
aws-sdk-cpp copied to clipboard

Stream error is not returned

Open oleg-boulanov opened this issue 1 month ago • 2 comments

Describe the bug

See https://github.com/aws/aws-sdk-cpp/issues/3649

There is 403 returned by hhtp-decoder (because of invalid action, "InvokeModelWithBidirectionalStream") But there is no error message logged, no stream error callback invoked, and the message can be found only in full trace.

Unacceptable.

Regression Issue

  • [ ] Select this option if this issue appears to be a regression.

Expected Behavior

Request should fail (with 403), or stream error returned, or, at absolute minimum - 403 logged as ERROR, not as TRACE

Current Behavior

TRACE logged as: [TRACE] http-decoder [2784] id=038D8770 Decoded header field: ":status: 403"

Reproduction Steps

Run on Bedrock Sonic EC2 instance, with no bedrock-runtime:invokemodel permission

Possible Solution

No response

Additional Information/Context

No response

AWS CPP SDK version used

1.11.705

Compiler and Version used

Visual Studio 2022, C++

Operating System and version

Windows 11/2022

oleg-boulanov avatar Dec 12 '25 20:12 oleg-boulanov

@oleg-boulanov Thanks for reporting this issue. I attempted to reproduce the 403 error handling problem but I need some clarification on the specific scenario. In my test that uses invalid credentials to force a 403, the 403 error was properly logged at ERROR level and returned. Do you have a code example I can use to replicate your issue?

kai-ion avatar Dec 18 '25 18:12 kai-ion

@kai-ion Thanks for looking into it.

I my scenario, credentials are correct, but the EC2 instance profile security group policy did not include permission: "bedrock:InvokeModel" (I mistakenly wrote "bedrock:InvokeModelWithBidirectionalStream").

In that case, the request itself succeeded, but no stream was established, and no error/warning or even debug message was produced. Instead, there was one and only [TRACE] http-decoder [2784] id=038D8770 Decoded header field: ":status: 403" message.

I think it would be reasonable to see an ERROR message, if not request failure.

oleg-boulanov avatar Dec 18 '25 19:12 oleg-boulanov