-
Notifications
You must be signed in to change notification settings - Fork 864
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
DescribeTagsAsync
can take a sync path resulting in a PlatformNotSupportedException
exception on .NET Android
#3626
Comments
Looking into this further, I think the exception that I ran into could be avoided by having |
This is an attempt to fix aws#3626.
This is an attempt to fix aws#3626.
@ashishdhingra I didn't see that you were assigned before I took a stab at fixing this. Please let me know how I can help. |
Based on the stack trace, Amazon.Runtime.AssumeRoleAWSCredentials.GenerateNewCredentials() is invoking ICoreAmazonSTS.CredentialsFromAssumeRoleAuthentication. This is invoking AssumeRole(), which makes a sync call here (assuming NetStandard target). Needs review with the team. @mscottford Thanks for the PR contribution. I will discuss the PR with the team. Thanks, |
@mscottford Based on discussion with the team, this is a breaking change and most likely would be included in next major version |
Describe the bug
Calling
DescribeTagsAsync
on .NET 8 Android causes aPlatformNotSupportedException
, because the synchronousHttpClient.Send()
method is not supported on that platform.Digging through the stack trace, and comparing against the AWS SDK source code, it looks like
RefreshingAWSCredentials.GenerateNewCredentialsAsync
is sending the rest of the call tree down a synchronous call path. Prior to that, all***Async
methods are being used. I suspect that ifGenerateNewCredentialsAsync
did not invoke the synchronousGenerateNewCredentials
method then the call would use***Async
methods all the way down, and the exception would not be triggered.I haven't found a way to work around this issue at the moment.
Regression Issue
Expected Behavior
Calling
DescribeTagsAsync
would ultimately invokeHttpClient.SendAsync
to perform HTTP communication with the AWS API.Current Behavior
Calling
DescribeTagsAsync
ultimately invokesHttpClient.Send
to perform HTTP communication with the AWS API.Reproduction Steps
This is the bit that I'm unsure about. I don't know if the code path is being chosen because of how our credentials are set up. I'd appreciate some guidance on any additional information that's required to create a valid set of reproduction steps.
Possible Solution
Force descendants of
RefreshingAWSCredentials
to implement bothGenerateNewCredentialsAsync
andGenerateNewCredentials
. Currently, onlyGenerateNewCredentials
throws aNotImplementedException
. Having both the async and sync versions of the method throwNotImplementException
would make it clear that both methods need to be implemented. Alternatively, all descendants ofRefreshingAWSCredentials
could be audited to ensure thatGenerateNewCredentialsAsync
is overridden.Additional Information/Context
No response
AWS .NET SDK and/or Package version used
Here are all the AWSSDK packages that are being referenced by the project that is encountering this issue.
Targeted .NET Platform
.NET 8 Android
Operating System and version
Android
The text was updated successfully, but these errors were encountered: