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

Exception at AppSyncSigV4SignerInterceptor #16

Closed
yong0726 opened this issue Jun 7, 2018 · 5 comments
Closed

Exception at AppSyncSigV4SignerInterceptor #16

yong0726 opened this issue Jun 7, 2018 · 5 comments
Labels
investigating This issue is being investigated

Comments

@yong0726
Copy link

yong0726 commented Jun 7, 2018

In our production app, the below crash has been detected many times via Firebase Crashlytics. please help me.

Fatal Exception: com.amazonaws.AmazonClientException
Unable to execute HTTP request: Unable to resolve host "cognito-identity.us-east-1.amazonaws.com": No address associated with hostname
com.amazonaws.http.AmazonHttpClient.executeHelper (AmazonHttpClient.java:441)
com.amazonaws.http.AmazonHttpClient.execute (AmazonHttpClient.java:212)
com.amazonaws.services.cognitoidentity.AmazonCognitoIdentityClient.invoke (AmazonCognitoIdentityClient.java:559)
com.amazonaws.services.cognitoidentity.AmazonCognitoIdentityClient.getCredentialsForIdentity (AmazonCognitoIdentityClient.java:389)
com.amazonaws.auth.CognitoCredentialsProvider.populateCredentialsWithCognito (CognitoCredentialsProvider.java:748)
com.amazonaws.auth.CognitoCredentialsProvider.startSession (CognitoCredentialsProvider.java:674)
com.amazonaws.auth.CognitoCredentialsProvider.getCredentials (CognitoCredentialsProvider.java:445)
com.amazonaws.auth.CognitoCachingCredentialsProvider.getCredentials (CognitoCachingCredentialsProvider.java:485)
com.amazonaws.auth.CognitoCachingCredentialsProvider.getCredentials (CognitoCachingCredentialsProvider.java:77)
com.amazonaws.mobileconnectors.appsync.sigv4.AppSyncSigV4SignerInterceptor.intercept (AppSyncSigV4SignerInterceptor.java:123)
okhttp3.internal.http.RealInterceptorChain.proceed (RealInterceptorChain.java:92)
okhttp3.internal.http.RealInterceptorChain.proceed (RealInterceptorChain.java:67)
okhttp3.RealCall.getResponseWithInterceptorChain (RealCall.java:185)
okhttp3.RealCall$AsyncCall.execute (RealCall.java:135)
okhttp3.internal.NamedRunnable.run (NamedRunnable.java:32)
java.util.concurrent.ThreadPoolExecutor.runWorker (ThreadPoolExecutor.java:1133)
java.util.concurrent.ThreadPoolExecutor$Worker.run (ThreadPoolExecutor.java:607)
java.lang.Thread.run (Thread.java:761)

The below is our initialized code.

private AppSyncClient(Context context) {
        mContext = context.getApplicationContext();

        mCredentialsProvider = new CognitoCachingCredentialsProvider(
            context,
            Constants.COGNITO_IDENTITY,
            Constants.COGNITO_REGION
        );

        mAppSyncClient = AWSAppSyncClient.builder()
            .context(context)
            .credentialsProvider(mCredentialsProvider)
            .region(Constants.APPSYNC_REGION)
            .serverUrl(Constants.getAppSyncUrl())
            .build();

        mS3 = new AmazonS3Client(mCredentialsProvider);
        mS3.setRegion(Region.getRegion(Constants.S3_REGION));
    }

the SDK version is 2.6.17

@rohandubal
Copy link
Contributor

Hi, This might be a transient error due to network not being available. One improvement which we can do on this is to catch the error in the SDK and surface it in onError callback, so that the request can be retried if desired and also not cause a crash. Would this work for you @yong0726 ?

Thanks,
Rohan

@yong0726
Copy link
Author

yong0726 commented Jun 7, 2018

@rohandubal I think it would be better if the SDK can retry automatically by itself when the network comes back to normal. because automatic management of network connection is one of the main feature of AppSync.

Regards,
Yongjae

@minbi
Copy link
Contributor

minbi commented Jun 8, 2018

Hi @yong0726 ,

In our experience, this error does not resolve until the app is restarted or in some cases re-installed. Retrying the request would not help.

We will investigate the issue and reply here when we have more information.

@minbi minbi added the investigating This issue is being investigated label Jun 8, 2018
@minbi
Copy link
Contributor

minbi commented Jun 13, 2018

We have a fix that will prevent crashing, but the error will be surfaced in the onError callback.

@minbi
Copy link
Contributor

minbi commented Jun 14, 2018

This issue should be resolve with release 2.6.20. Re-open if necessary

@minbi minbi closed this as completed Jun 14, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
investigating This issue is being investigated
Projects
None yet
Development

No branches or pull requests

3 participants