Skip to content
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

com.amazonaws.AmazonClientException: Unable to execute HTTP request: Stream closed #3438

Closed
miketextnow opened this issue Oct 23, 2023 · 2 comments
Labels
bug Something isn't working cognito Issues with the AWS Android SDK for Cognito not-reproducible Not able to reproduce the issue pending-community-response Issue is pending response from the issue requestor s3 Issues with the AWS Android SDK for Simple Storage Service (S3).

Comments

@miketextnow
Copy link

miketextnow commented Oct 23, 2023

Describe the bug
When calling AmazonCognitoIdentityClient(AnonymousAWSCredentials()).getCredentialsForIdentity(request) we get an AmazonClientException thrown after updating project to jdk17 and Android Gradle Plugin 8.1.1 (previously using jdk11 and AGP version 7.1.0)

To Reproduce
A code sample or steps:

Make following request on Android project using jdk 17 and Android Gradle Plugin 8.1.1

        AmazonCognitoIdentityClient(AnonymousAWSCredentials())
                            .getCredentialsForIdentity(request)

Which AWS service(s) are affected?
aws-android-sdk-core

Expected behavior
Files able to be uploaded to s3

Screenshots
If applicable, add screenshots to help explain your problem.

Environment Information (please complete the following information):

  • AWS Android SDK Version: 2.73.0
  • Device: Affects all devices
  • Android Version: Affects all versions
  • Specific to simulators: No

Additional context
Add any other context about the problem here.

@tjleing tjleing added bug Something isn't working s3 Issues with the AWS Android SDK for Simple Storage Service (S3). cognito Issues with the AWS Android SDK for Cognito labels Oct 25, 2023
@ankpshah
Copy link
Contributor

ankpshah commented Nov 2, 2023

Hello @miketextnow,
I was not able to replicate the issue and it works as expected with JDK17 and AGP 8.1.1. Could you share more specific details about your setup? I am assuming you are using Unauthenticated Guest Access for the identity pool as you are using AnonymousAWSCredentials(). is that correct? If so have you activated Guest access as explained here

Also make sure you are setting region for the cognito identity client correctly: identityClient.setRegion(Region.getRegion(Regions.YOUR_REGION));

I suspect unstable network connection could be a potential issue here.
Furthermore, if above suggestions doesn't help, placing breakpoint in AmazonHttpClient.java L448 and inspecting the Exception can probably give more insights.

@ankpshah ankpshah added pending-community-response Issue is pending response from the issue requestor not-reproducible Not able to reproduce the issue labels Nov 2, 2023
@miketextnow
Copy link
Author

Thanks for your response! We actually were able to pin point the external library that was injecting code and preventing us from making this request with the sdk. So will close this out.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working cognito Issues with the AWS Android SDK for Cognito not-reproducible Not able to reproduce the issue pending-community-response Issue is pending response from the issue requestor s3 Issues with the AWS Android SDK for Simple Storage Service (S3).
Projects
None yet
Development

No branches or pull requests

3 participants