amplify-android: aws-datastore: Initial cloud sync failed.

I have set up full stack project for my Android app, generated model files, integrated in the app, and connected to cloud. I have enabled Cognito user pool for authorization, AppSync and S3 for storage. When running the app I am getting following exception:

2020-06-17 16:57:56.404 12695-12989/   W/amplify:aws-datastore: Failed to sync down cloud state for model type = data
    AmplifyException {message=Failure performing sync query to AppSync: [GraphQLResponse.Error{message='Validation error of type FieldUndefined: Field 'syncdatas' in type 'Query' is undefined @ 'syncdatas'', locations='[GraphQLLocation{line='2', column='3'}]', path='null', extensions='null'}], cause=null, recoverySuggestion=Sorry, we don't have a suggested fix for this error yet.}
        at com.amplifyframework.datastore.appsync.AppSyncClient.lambda$sync$0$AppSyncClient(AppSyncClient.java:3)
        at com.amplifyframework.datastore.appsync.-$$Lambda$AppSyncClient$DAlM2A4r8A_52MV-BaSjc1SYWao.accept(Unknown Source:10)
        at com.amplifyframework.api.aws.AppSyncGraphQLOperation$OkHttpCallback.onResponse(AppSyncGraphQLOperation.java:16)
        at okhttp3.internal.connection.RealCall$AsyncCall.run(RealCall.kt:504)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1162)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:636)
        at java.lang.Thread.run(Thread.java:764)
2020-06-17 16:57:56.418 12695-12989/   W/amplify:aws-datastore: Initial cloud sync failed.
    AmplifyException {message=Failure performing sync query to AppSync: [GraphQLResponse.Error{message='Validation error of type FieldUndefined: Field 'syncdatas' in type 'Query' is undefined @ 'syncdatas'', locations='[GraphQLLocation{line='2', column='3'}]', path='null', extensions='null'}], cause=null, recoverySuggestion=Sorry, we don't have a suggested fix for this error yet.}
        at com.amplifyframework.datastore.appsync.AppSyncClient.lambda$sync$0$AppSyncClient(AppSyncClient.java:3)
        at com.amplifyframework.datastore.appsync.-$$Lambda$AppSyncClient$DAlM2A4r8A_52MV-BaSjc1SYWao.accept(Unknown Source:10)
        at com.amplifyframework.api.aws.AppSyncGraphQLOperation$OkHttpCallback.onResponse(AppSyncGraphQLOperation.java:16)
        at okhttp3.internal.connection.RealCall$AsyncCall.run(RealCall.kt:504)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1162)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:636)
        at java.lang.Thread.run(Thread.java:764)

About this issue

  • Original URL
  • State: closed
  • Created 4 years ago
  • Comments: 19 (9 by maintainers)

Most upvoted comments

Ok - I’m going to email you to setup a quick call where I can go through your setup with you and see if we can figure out what’s going on. Depending on the findings will post back on this ticket for documentation.

@a-melnyk Thanks for that PR, just saw it! Looks good. Let me jut make sure it passes our integration test suite (which doesn’t run on pull requests, at the moment.)

hi @sunithapremjee, I believe that the problem is caused by a bug in AppSyncRequestFactory, as a workaround you could rename types in your schema.graphql to avoid nouns with “complicated” (where it’s not simply noun+"s") plural forms, e.g. use dataUnit instead of data

@jamesonwilliams, please take a look at the provided PR #628