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

Created on 17 Jun 2020  路  18Comments  路  Source: aws-amplify/amplify-android

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)
Bug DataStore

Most helpful comment

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.

All 18 comments

There are a couple different scenarios where I've seen this error before:

  1. If you made updates to your GraphQL schema locally that haven't been pushed to the cloud yet.
  2. If for whatever reason, your amplifyconfiguration.json config file is pointing to the incorrect environment.

Let me know if that helps.

I have deleted the configuration using command聽amplify delete and created new one.
I am sure my GraphQL schema was pushed to the cloud after changing locally. I am not sure if my config was pointing to incorrect environment as you said. Thanks for your reply.

I did amplify delete for the above project and created a new project. Configured amplify for new Android App. My android app could successfully create a new user in AWS Cognito user pool and I added data which successfully uploaded to AWS AppSync Dynamo DB and image got stored in AWS S3 bucket. Then I deleted data through my android app ( which called Amplify.DataStore.delete ). Again added a new item through app. But deleted items are still there in Dynamo DB, new item didn't get added to AWS cloud. Also following exceptions happens which says recoverySuggestion=This is likely a bug. please report to AWS.

 amplify:aws-datastore: Failed to sync down cloud state for model type = Kospetdata
    AmplifyException {message=Failure performing sync query to AppSync: [GraphQLResponse.Error{message='Validation error of type FieldUndefined: Field 'syncKospetdatas' in type 'Query' is undefined @ 'syncKospetdatas'', 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:1167)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
        at java.lang.Thread.run(Thread.java:919)
2020-06-25 20:49:14.018 16748-16949/com.prodigy.kospet 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 'syncKospetdatas' in type 'Query' is undefined @ 'syncKospetdatas'', 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:1167)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
        at java.lang.Thread.run(Thread.java:919)
2020-06-25 20:49:14.019 16748-16899/com.prodigy.kospet I/amplify:aws-datastore: Starting processing subscription data buffer.
2020-06-25 20:49:14.020 16748-16931/com.prodigy.kospet I/amplify:aws-datastore: Started processing the mutation outbox. Pending mutations will be published to the cloud.
2020-06-25 20:49:14.024 16748-16899/com.prodigy.kospet W/amplify:aws-datastore: Failed to publish a local change = PendingMutation{mutatedItem=Kospetdata {id=ac1c0a70-89a5-4bdf-abd9-8d8382a32621, title=kospetaudio, description=kospetaudio, audiopath=https://kospet511a0d8b7dee438a8bf514658de1f899162435-amplify.s3.amazonaws.com/public/kospetaudio, sensitivity=NORMAL, timer=fifteen}, classOfMutatedItem=class com.amplifyframework.datastore.generated.model.Kospetdata, mutationType=DELETE, mutationId=5c72bb5c-b724-11ea-bc89-9d5b66290272, predicate=null}
    AmplifyException {message=Wanted 1 metadata for item with id = ac1c0a70-89a5-4bdf-abd9-8d8382a32621, but had 0., cause=null, recoverySuggestion=This is likely a bug. please report to AWS.}
        at com.amplifyframework.datastore.syncengine.VersionRepository.extractVersion(VersionRepository.java:25)
        at com.amplifyframework.datastore.syncengine.VersionRepository.lambda$null$0$VersionRepository(VersionRepository.java:1)
        at com.amplifyframework.datastore.syncengine.-$$Lambda$VersionRepository$R5kiVnQCzDy1jTk4Odil1m_dDtM.accept(Unknown Source:8)
        at com.amplifyframework.datastore.storage.sqlite.SQLiteStorageAdapter.lambda$query$4$SQLiteStorageAdapter(SQLiteStorageAdapter.java:42)
        at com.amplifyframework.datastore.storage.sqlite.-$$Lambda$SQLiteStorageAdapter$rGner20-W7t2tJu4yCrrZwlquWE.run(Unknown Source:10)
        at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:462)
        at java.util.concurrent.FutureTask.run(FutureTask.java:266)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
        at java.lang.Thread.run(Thread.java:919)
2020-06-25 20:49:14.026 16748-16931/com.prodigy.kospet W/amplify:aws-datastore: Error ended observation of mutation outbox: 
    java.lang.RuntimeException: AmplifyException {message=Wanted 1 metadata for item with id = ac1c0a70-89a5-4bdf-abd9-8d8382a32621, but had 0., cause=null, recoverySuggestion=This is likely a bug. please report to AWS.}
        at io.reactivex.internal.util.ExceptionHelper.wrapOrThrow(ExceptionHelper.java:46)
        at io.reactivex.internal.observers.BlockingMultiObserver.blockingAwait(BlockingMultiObserver.java:185)
        at io.reactivex.Completable.blockingAwait(Completable.java:1256)
        at com.amplifyframework.datastore.syncengine.MutationProcessor.lambda$startDrainingMutationOutbox$1$MutationProcessor(MutationProcessor.java:6)
        at com.amplifyframework.datastore.syncengine.-$$Lambda$MutationProcessor$iu5hAaGgWV8-jjRjPW1wTtFQOwM.apply(Unknown Source:4)
        at io.reactivex.internal.operators.observable.ObservableFlatMapCompletableCompletable$FlatMapCompletableMainObserver.onNext(ObservableFlatMapCompletableCompletable.java:97)
        at io.reactivex.internal.operators.observable.ObservableObserveOn$ObserveOnObserver.drainNormal(ObservableObserveOn.java:201)
        at io.reactivex.internal.operators.observable.ObservableObserveOn$ObserveOnObserver.run(ObservableObserveOn.java:255)
        at io.reactivex.internal.schedulers.ScheduledRunnable.run(ScheduledRunnable.java:66)
        at io.reactivex.internal.schedulers.ScheduledRunnable.call(ScheduledRunnable.java:57)
        at java.util.concurrent.FutureTask.run(FutureTask.java:266)
        at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:301)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
        at java.lang.Thread.run(Thread.java:919)
     Caused by: AmplifyException {message=Wanted 1 metadata for item with id = ac1c0a70-89a5-4bdf-abd9-8d8382a32621, but had 0., cause=null, recoverySuggestion=This is likely a bug. please report to AWS.}
        at com.amplifyframework.datastore.syncengine.VersionRepository.extractVersion(VersionRepository.java:25)
        at com.amplifyframework.datastore.syncengine.VersionRepository.lambda$null$0$VersionRepository(VersionRepository.java:1)
        at com.amplifyframework.datastore.syncengine.-$$Lambda$VersionRepository$R5kiVnQCzDy1jTk4Odil1m_dDtM.accept(Unknown Source:8)
        at com.amplifyframework.datastore.storage.sqlite.SQLiteStorageAdapter.lambda$query$4$SQLiteStorageAdapter(SQLiteStorageAdapter.java:42)
        at com.amplifyframework.datastore.storage.sqlite.-$$Lambda$SQLiteStorageAdapter$rGner20-W7t2tJu4yCrrZwlquWE.run(Unknown Source:10)
        at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:462)
        at java.util.concurrent.FutureTask.run(FutureTask.java:266)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)聽
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)聽
        at java.lang.Thread.run(Thread.java:919)聽

I'm having the same issue. Everything was working, I deleted some items manually in dynamodb via aws ui.
Now I keep getting these errors :

2020-06-30 23:17:27.941 31956-31990/be.milants.todo W/amplify:aws-datastore: Failed to sync down cloud state for model type = ScannedData
    AmplifyException {message=Failure performing sync query to AppSync: [GraphQLResponse.Error{message='Validation error of type FieldUndefined: Field 'syncScannedDatas' in type 'Query' is undefined @ 'syncScannedDatas'', 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(lambda)
        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:1133)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:607)
        at java.lang.Thread.run(Thread.java:761)
2020-06-30 23:17:27.942 31956-31990/be.milants.todo 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 'syncScannedDatas' in type 'Query' is undefined @ 'syncScannedDatas'', 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(lambda)
        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:1133)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:607)
        at java.lang.Thread.run(Thread.java:761)
2020-06-30 23:17:28.109 31956-31990/be.milants.todo W/amplify:aws-datastore: Failed to sync down cloud state for model type = ScannedData
    AmplifyException {message=Failure performing sync query to AppSync: [GraphQLResponse.Error{message='Validation error of type FieldUndefined: Field 'syncScannedDatas' in type 'Query' is undefined @ 'syncScannedDatas'', 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(lambda)
        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:1133)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:607)
        at java.lang.Thread.run(Thread.java:761)
2020-06-30 23:17:28.110 31956-31990/be.milants.todo 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 'syncScannedDatas' in type 'Query' is undefined @ 'syncScannedDatas'', 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(lambda)
        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:1133)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:607)
        at java.lang.Thread.run(Thread.java:761)

@sunithapremjee @woutermilants These messages indicate that the AppSync endpoints that your apps are talking to do not know about ScannedDatas or Kospetdatas.

AmplifyException {message=Failure performing sync query to AppSync: [GraphQLResponse.Error{message='Validation error of type FieldUndefined: Field 'syncScannedDatas' in type 'Query' is undefined @ 'syncScannedDatas'', 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.}

AmplifyException {message=Failure performing sync query to AppSync: [GraphQLResponse.Error{message='Validation error of type FieldUndefined: Field 'syncKospetdatas' in type 'Query' is undefined @ 'syncKospetdatas'', 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.}

Can you verify through the AppSync console that:

  1. The ScannedDatas/ Kospetdatas model is defined on the endpoint?
  2. That the sync*** operation is defined for this model?

@sunithapremjee @woutermilants These messages indicate that the AppSync endpoints that your apps are talking to do not know about ScannedDatas or Kospetdatas.

AmplifyException {message=Failure performing sync query to AppSync: [GraphQLResponse.Error{message='Validation error of type FieldUndefined: Field 'syncScannedDatas' in type 'Query' is undefined @ 'syncScannedDatas'', 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.}

AmplifyException {message=Failure performing sync query to AppSync: [GraphQLResponse.Error{message='Validation error of type FieldUndefined: Field 'syncKospetdatas' in type 'Query' is undefined @ 'syncKospetdatas'', 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.}

Can you verify through the AppSync console that:

  1. The ScannedDatas/ Kospetdatas model is defined on the endpoint?
  2. That the sync*** operation is defined for this model?

I'm not sure if this is correct but these are the only occurences I can find :

image

image

I guess ScannedDatas does not exist, I assume this was generated by the modelGen as I only created a model called ScannedData.

Thanks for your help

@woutermilants Ah interesting. I see you do have a Query defined in the AppSync console, called syncScannedData. But the client is generating syncScannedDatas (with an s at the end.) Hmm.

@woutermilants Ah interesting. I see you do have a Query defined in the AppSync console, called syncScannedData. But the client is generating syncScannedDatas (with an s at the end.) Hmm.

The strange thing is that this error suddenly started appearing without me changing any model related code. Anything I can do to fix this ?

Can anybody please direct me how can I solve this Cloud syncing issues on my android app.Any updates?

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

@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.)

I created a new project and configured amplify the 5th time.
The following tests are performed.

1) Android 10 device - App installed on Android 10 - Successfully Signed up a new user , Added new data through app UI, and data syncs successfully to S3 bucket and Appsync dynamo dB.

2) Android 8 device - App installed on Android 8 device. Successfully Signed in with existing user-created above on Android 10 device. But app crashes due to timeout exception.

3) Android 7.1.1 device- when app is in signed-out state, while authorization is going on, following exceptions are thrown.

com.prodigy.smartkospet W/amplify:aws-datastore: An error occurred on the remote WatchdataUnit subscription for model ON_UPDATE.
    AmplifyException {message=Error during subscription., cause=AmplifyException {message=Failed to create websocket for subscription, cause=AmplifyException {message=getTokens does not support retrieving tokens while signed-out, cause=null, recoverySuggestion=Sorry, we don't have a suggested fix for this error yet.}, recoverySuggestion=Sorry, we don't have a suggested fix for this error yet.}, recoverySuggestion=Evaluate details.}
        at com.amplifyframework.datastore.appsync.AppSyncClient.lambda$subscription$3(AppSyncClient.java:1)
        at com.amplifyframework.datastore.appsync.-$$Lambda$AppSyncClient$8gXTT9bgLZGP51blif6hkh7EwIc.accept(lambda)
        at com.amplifyframework.api.aws.SubscriptionEndpoint.requestSubscription(SubscriptionEndpoint.java:34)
        at com.amplifyframework.api.aws.SubscriptionOperation.lambda$start$0$SubscriptionOperation(SubscriptionOperation.java:4)
        at com.amplifyframework.api.aws.-$$Lambda$SubscriptionOperation$FXgdmzMG9ubNhC1f2NTwXyG53uo.run(lambda)
        at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:428)
        at java.util.concurrent.FutureTask.run(FutureTask.java:237)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1133)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:607)
        at java.lang.Thread.run(Thread.java:761)
     Caused by: AmplifyException {message=Failed to create websocket for subscription, cause=AmplifyException {message=getTokens does not support retrieving tokens while signed-out, cause=null, recoverySuggestion=Sorry, we don't have a suggested fix for this error yet.}, recoverySuggestion=Sorry, we don't have a suggested fix for this error yet.}
        at com.amplifyframework.api.aws.SubscriptionEndpoint.requestSubscription(SubscriptionEndpoint.java:34)聽
        at com.amplifyframework.api.aws.SubscriptionOperation.lambda$start$0$SubscriptionOperation(SubscriptionOperation.java:4)聽
        at com.amplifyframework.api.aws.-$$Lambda$SubscriptionOperation$FXgdmzMG9ubNhC1f2NTwXyG53uo.run(lambda)聽
        at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:428)聽
        at java.util.concurrent.FutureTask.run(FutureTask.java:237)聽
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1133)聽
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:607)聽
        at java.lang.Thread.run(Thread.java:761)聽
     Caused by: AmplifyException {message=getTokens does not support retrieving tokens while signed-out, cause=null, recoverySuggestion=Sorry, we don't have a suggested fix for this error yet.}
        at com.amplifyframework.api.aws.sigv4.DefaultCognitoUserPoolsAuthProvider.fetchToken(DefaultCognitoUserPoolsAuthProvider.java:28)
        at com.amplifyframework.api.aws.sigv4.DefaultCognitoUserPoolsAuthProvider.getLatestAuthToken(DefaultCognitoUserPoolsAuthProvider.java:1)
        at com.amplifyframework.api.aws.SubscriptionAuthorizer.createHeaders(SubscriptionAuthorizer.java:49)
        at com.amplifyframework.api.aws.SubscriptionAuthorizer.createHeadersForConnection(SubscriptionAuthorizer.java:1)
        at com.amplifyframework.api.aws.SubscriptionEndpoint.createWebSocket(SubscriptionEndpoint.java:2)
        at com.amplifyframework.api.aws.SubscriptionEndpoint.requestSubscription(SubscriptionEndpoint.java:10)
        at com.amplifyframework.api.aws.SubscriptionOperation.lambda$start$0$SubscriptionOperation(SubscriptionOperation.java:4)聽
        at com.amplifyframework.api.aws.-$$Lambda$SubscriptionOperation$FXgdmzMG9ubNhC1f2NTwXyG53uo.run(lambda)聽
        at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:428)聽
        at java.util.concurrent.FutureTask.run(FutureTask.java:237)聽
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1133)聽
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:607)聽
        at java.lang.Thread.run(Thread.java:761)聽

com.prodigy.smartkospet W/amplify:aws-datastore: Failed to sync down cloud state for model type = WatchdataUnit
    AmplifyException {message=Failure performing sync query to AppSync., cause=AmplifyException {message=Could not retrieve the response body from the returned JSON, cause=java.io.IOException: Failed to retrieve Cognito User Pools token., recoverySuggestion=Sorry, we don't have a suggested fix for this error yet.}, recoverySuggestion=Sorry, we don't have a suggested fix for this error yet.}
        at com.amplifyframework.datastore.appsync.AppSyncClient.lambda$sync$1(AppSyncClient.java:1)
        at com.amplifyframework.datastore.appsync.-$$Lambda$AppSyncClient$suvEma05s-p8v-66iE4cswLKYac.accept(lambda)
        at com.amplifyframework.api.aws.AppSyncGraphQLOperation$OkHttpCallback.onFailure(AppSyncGraphQLOperation.java:1)
        at okhttp3.internal.connection.RealCall$AsyncCall.run(RealCall.kt:510)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1133)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:607)
        at java.lang.Thread.run(Thread.java:761)
     Caused by: AmplifyException {message=Could not retrieve the response body from the returned JSON, cause=java.io.IOException: Failed to retrieve Cognito User Pools token., recoverySuggestion=Sorry, we don't have a suggested fix for this error yet.}
        at com.amplifyframework.api.aws.AppSyncGraphQLOperation$OkHttpCallback.onFailure(AppSyncGraphQLOperation.java:1)聽
        at okhttp3.internal.connection.RealCall$AsyncCall.run(RealCall.kt:510)聽
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1133)聽
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:607)聽
        at java.lang.Thread.run(Thread.java:761)聽
     Caused by: java.io.IOException: Failed to retrieve Cognito User Pools token.
        at com.amplifyframework.api.aws.sigv4.AppSyncSigV4SignerInterceptor.intercept(AppSyncSigV4SignerInterceptor.java:71)
        at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.kt:100)
        at okhttp3.internal.connection.RealCall.getResponseWithInterceptorChain$okhttp(RealCall.kt:197)
        at okhttp3.internal.connection.RealCall$AsyncCall.run(RealCall.kt:502)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1133)聽
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:607)聽
        at java.lang.Thread.run(Thread.java:761)聽
     Caused by: AmplifyException {message=getTokens does not support retrieving tokens while signed-out, cause=null, recoverySuggestion=Sorry, we don't have a suggested fix for this error yet.}
        at com.amplifyframework.api.aws.sigv4.DefaultCognitoUserPoolsAuthProvider.fetchToken(DefaultCognitoUserPoolsAuthProvider.java:28)
        at com.amplifyframework.api.aws.sigv4.DefaultCognitoUserPoolsAuthProvider.getLatestAuthToken(DefaultCognitoUserPoolsAuthProvider.java:1)
        at com.amplifyframework.api.aws.sigv4.AppSyncSigV4SignerInterceptor.intercept(AppSyncSigV4SignerInterceptor.java:69)
        at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.kt:100)聽
        at okhttp3.internal.connection.RealCall.getResponseWithInterceptorChain$okhttp(RealCall.kt:197)聽
        at okhttp3.internal.connection.RealCall$AsyncCall.run(RealCall.kt:502)聽
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1133)聽
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:607)聽
        at java.lang.Thread.run(Thread.java:761)聽
2020-07-13 13:39:40.300 4316-4405/com.prodigy.smartkospet W/amplify:aws-datastore: Initial cloud sync failed.
    AmplifyException {message=Failure performing sync query to AppSync., cause=AmplifyException {message=Could not retrieve the response body from the returned JSON, cause=java.io.IOException: Failed to retrieve Cognito User Pools token., recoverySuggestion=Sorry, we don't have a suggested fix for this error yet.}, recoverySuggestion=Sorry, we don't have a suggested fix for this error yet.}
        at com.amplifyframework.datastore.appsync.AppSyncClient.lambda$sync$1(AppSyncClient.java:1)
        at com.amplifyframework.datastore.appsync.-$$Lambda$AppSyncClient$suvEma05s-p8v-66iE4cswLKYac.accept(lambda)
        at com.amplifyframework.api.aws.AppSyncGraphQLOperation$OkHttpCallback.onFailure(AppSyncGraphQLOperation.java:1)
        at okhttp3.internal.connection.RealCall$AsyncCall.run(RealCall.kt:510)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1133)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:607)
        at java.lang.Thread.run(Thread.java:761)
     Caused by: AmplifyException {message=Could not retrieve the response body from the returned JSON, cause=java.io.IOException: Failed to retrieve Cognito User Pools token., recoverySuggestion=Sorry, we don't have a suggested fix for this error yet.}
        at com.amplifyframework.api.aws.AppSyncGraphQLOperation$OkHttpCallback.onFailure(AppSyncGraphQLOperation.java:1)聽
        at okhttp3.internal.connection.RealCall$AsyncCall.run(RealCall.kt:510)聽
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1133)聽
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:607)聽
        at java.lang.Thread.run(Thread.java:761)聽
     Caused by: java.io.IOException: Failed to retrieve Cognito User Pools token.
        at com.amplifyframework.api.aws.sigv4.AppSyncSigV4SignerInterceptor.intercept(AppSyncSigV4SignerInterceptor.java:71)
        at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.kt:100)
        at okhttp3.internal.connection.RealCall.getResponseWithInterceptorChain$okhttp(RealCall.kt:197)
        at okhttp3.internal.connection.RealCall$AsyncCall.run(RealCall.kt:502)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1133)聽
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:607)聽
        at java.lang.Thread.run(Thread.java:761)聽
     Caused by: AmplifyException {message=getTokens does not support retrieving tokens while signed-out, cause=null, recoverySuggestion=Sorry, we don't have a suggested fix for this error yet.}
        at com.amplifyframework.api.aws.sigv4.DefaultCognitoUserPoolsAuthProvider.fetchToken(DefaultCognitoUserPoolsAuthProvider.java:28)
        at com.amplifyframework.api.aws.sigv4.DefaultCognitoUserPoolsAuthProvider.getLatestAuthToken(DefaultCognitoUserPoolsAuthProvider.java:1)
        at com.amplifyframework.api.aws.sigv4.AppSyncSigV4SignerInterceptor.intercept(AppSyncSigV4SignerInterceptor.java:69)
        at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.kt:100)聽
        at okhttp3.internal.connection.RealCall.getResponseWithInterceptorChain$okhttp(RealCall.kt:197)聽
        at okhttp3.internal.connection.RealCall$AsyncCall.run(RealCall.kt:502)聽
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1133)聽
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:607)聽
        at java.lang.Thread.run(Thread.java:761)聽

com.prodigy.smartkospet W/amplify:aws-datastore: An error occurred on the remote WatchdataUnit subscription for model ON_DELETE.
    AmplifyException {message=Error during subscription., cause=AmplifyException {message=Failed to create websocket for subscription, cause=AmplifyException {message=getTokens does not support retrieving tokens while signed-out, cause=null, recoverySuggestion=Sorry, we don't have a suggested fix for this error yet.}, recoverySuggestion=Sorry, we don't have a suggested fix for this error yet.}, recoverySuggestion=Evaluate details.}
        at com.amplifyframework.datastore.appsync.AppSyncClient.lambda$subscription$3(AppSyncClient.java:1)
        at com.amplifyframework.datastore.appsync.-$$Lambda$AppSyncClient$8gXTT9bgLZGP51blif6hkh7EwIc.accept(lambda)
        at com.amplifyframework.api.aws.SubscriptionEndpoint.requestSubscription(SubscriptionEndpoint.java:34)
        at com.amplifyframework.api.aws.SubscriptionOperation.lambda$start$0$SubscriptionOperation(SubscriptionOperation.java:4)
        at com.amplifyframework.api.aws.-$$Lambda$SubscriptionOperation$FXgdmzMG9ubNhC1f2NTwXyG53uo.run(lambda)
        at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:428)
        at java.util.concurrent.FutureTask.run(FutureTask.java:237)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1133)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:607)
        at java.lang.Thread.run(Thread.java:761)
     Caused by: AmplifyException {message=Failed to create websocket for subscription, cause=AmplifyException {message=getTokens does not support retrieving tokens while signed-out, cause=null, recoverySuggestion=Sorry, we don't have a suggested fix for this error yet.}, recoverySuggestion=Sorry, we don't have a suggested fix for this error yet.}
        at com.amplifyframework.api.aws.SubscriptionEndpoint.requestSubscription(SubscriptionEndpoint.java:34)聽
        at com.amplifyframework.api.aws.SubscriptionOperation.lambda$start$0$SubscriptionOperation(SubscriptionOperation.java:4)聽
        at com.amplifyframework.api.aws.-$$Lambda$SubscriptionOperation$FXgdmzMG9ubNhC1f2NTwXyG53uo.run(lambda)聽
        at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:428)聽
        at java.util.concurrent.FutureTask.run(FutureTask.java:237)聽
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1133)聽
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:607)聽
        at java.lang.Thread.run(Thread.java:761)聽
     Caused by: AmplifyException {message=getTokens does not support retrieving tokens while signed-out, cause=null, recoverySuggestion=Sorry, we don't have a suggested fix for this error yet.}
        at com.amplifyframework.api.aws.sigv4.DefaultCognitoUserPoolsAuthProvider.fetchToken(DefaultCognitoUserPoolsAuthProvider.java:28)
        at com.amplifyframework.api.aws.sigv4.DefaultCognitoUserPoolsAuthProvider.getLatestAuthToken(DefaultCognitoUserPoolsAuthProvider.java:1)
        at com.amplifyframework.api.aws.SubscriptionAuthorizer.createHeaders(SubscriptionAuthorizer.java:49)
        at com.amplifyframework.api.aws.SubscriptionAuthorizer.createHeadersForConnection(SubscriptionAuthorizer.java:1)
        at com.amplifyframework.api.aws.SubscriptionEndpoint.createWebSocket(SubscriptionEndpoint.java:2)
        at com.amplifyframework.api.aws.SubscriptionEndpoint.requestSubscription(SubscriptionEndpoint.java:10)
        at com.amplifyframework.api.aws.SubscriptionOperation.lambda$start$0$SubscriptionOperation(SubscriptionOperation.java:4)聽
        at com.amplifyframework.api.aws.-$$Lambda$SubscriptionOperation$FXgdmzMG9ubNhC1f2NTwXyG53uo.run(lambda)聽
        at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:428)聽
        at java.util.concurrent.FutureTask.run(FutureTask.java:237)聽
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1133)聽
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:607)聽
        at java.lang.Thread.run(Thread.java:761)聽
2020-07-13 13:39:40.369 4316-4411/com.prodigy.smartkospet D/OpenGLRenderer: ProgramCache.generateProgram: 68724719680
2020-07-13 13:39:40.389 4316-4411/com.prodigy.smartkospet I/PerfService: PerfServiceNative api init
2020-07-13 13:39:40.397 4316-4316/com.prodigy.smartkospet V/InputMethodManager: onWindowFocus: androidx.appcompat.widget.AppCompatEditText{a88dce4 VFED..CL. .F....ID 0,0-400,31 #7f0800ab app:id/loginUser} softInputMode=288 first=true flags=#81810100
2020-07-13 13:39:40.423 4316-4411/com.prodigy.smartkospet D/IMGSRV: GrallocRegisterBuffer:1878: hnd=0x8d5c0a00 ID=1429 fd=64 ref=1 bufferID=33800
2020-07-13 13:39:40.557 4316-4430/com.prodigy.smartkospet D/AWSMobileClient: Inspecting user state details
2020-07-13 13:39:40.564 4316-4430/com.prodigy.smartkospet D/AWSMobileClient: waitForSignIn: userState:SIGNED_OUT
2020-07-13 13:39:40.569 4316-4404/com.prodigy.smartkospet W/amplify:aws-datastore: An error occurred on the remote WatchdataUnit subscription for model ON_CREATE.
    AmplifyException {message=Error during subscription., cause=AmplifyException {message=Failed to create websocket for subscription, cause=AmplifyException {message=getTokens does not support retrieving tokens while signed-out, cause=null, recoverySuggestion=Sorry, we don't have a suggested fix for this error yet.}, recoverySuggestion=Sorry, we don't have a suggested fix for this error yet.}, recoverySuggestion=Evaluate details.}
        at com.amplifyframework.datastore.appsync.AppSyncClient.lambda$subscription$3(AppSyncClient.java:1)
        at com.amplifyframework.datastore.appsync.-$$Lambda$AppSyncClient$8gXTT9bgLZGP51blif6hkh7EwIc.accept(lambda)
        at com.amplifyframework.api.aws.SubscriptionEndpoint.requestSubscription(SubscriptionEndpoint.java:34)
        at com.amplifyframework.api.aws.SubscriptionOperation.lambda$start$0$SubscriptionOperation(SubscriptionOperation.java:4)
        at com.amplifyframework.api.aws.-$$Lambda$SubscriptionOperation$FXgdmzMG9ubNhC1f2NTwXyG53uo.run(lambda)
        at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:428)
        at java.util.concurrent.FutureTask.run(FutureTask.java:237)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1133)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:607)
        at java.lang.Thread.run(Thread.java:761)
     Caused by: AmplifyException {message=Failed to create websocket for subscription, cause=AmplifyException {message=getTokens does not support retrieving tokens while signed-out, cause=null, recoverySuggestion=Sorry, we don't have a suggested fix for this error yet.}, recoverySuggestion=Sorry, we don't have a suggested fix for this error yet.}
        at com.amplifyframework.api.aws.SubscriptionEndpoint.requestSubscription(SubscriptionEndpoint.java:34)聽
        at com.amplifyframework.api.aws.SubscriptionOperation.lambda$start$0$SubscriptionOperation(SubscriptionOperation.java:4)聽
        at com.amplifyframework.api.aws.-$$Lambda$SubscriptionOperation$FXgdmzMG9ubNhC1f2NTwXyG53uo.run(lambda)聽
        at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:428)聽
        at java.util.concurrent.FutureTask.run(FutureTask.java:237)聽
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1133)聽
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:607)聽
        at java.lang.Thread.run(Thread.java:761)聽
     Caused by: AmplifyException {message=getTokens does not support retrieving tokens while signed-out, cause=null, recoverySuggestion=Sorry, we don't have a suggested fix for this error yet.}
        at com.amplifyframework.api.aws.sigv4.DefaultCognitoUserPoolsAuthProvider.fetchToken(DefaultCognitoUserPoolsAuthProvider.java:28)
        at com.amplifyframework.api.aws.sigv4.DefaultCognitoUserPoolsAuthProvider.getLatestAuthToken(DefaultCognitoUserPoolsAuthProvider.java:1)
        at com.amplifyframework.api.aws.SubscriptionAuthorizer.createHeaders(SubscriptionAuthorizer.java:49)
        at com.amplifyframework.api.aws.SubscriptionAuthorizer.createHeadersForConnection(SubscriptionAuthorizer.java:1)
        at com.amplifyframework.api.aws.SubscriptionEndpoint.createWebSocket(SubscriptionEndpoint.java:2)
        at com.amplifyframework.api.aws.SubscriptionEndpoint.requestSubscription(SubscriptionEndpoint.java:10)
        at com.amplifyframework.api.aws.SubscriptionOperation.lambda$start$0$SubscriptionOperation(SubscriptionOperation.java:4)聽
        at com.amplifyframework.api.aws.-$$Lambda$SubscriptionOperation$FXgdmzMG9ubNhC1f2NTwXyG53uo.run(lambda)聽
        at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:428)聽
        at java.util.concurrent.FutureTask.run(FutureTask.java:237)聽
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1133)聽
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:607)聽
        at java.lang.Thread.run(Thread.java:761)聽
2020-07-13 13:39:40.579 4316-4435/com.prodigy.smartkospet W/amplify:aws-datastore: Reading from subscriptions buffer is completed.

4) On the second initiation of App on Android 7.1.1 device - Data synced from Android 10 device gets displayed on the Android 7.1.1 device.

5) Added one more data on Android 10 device - Data doesn't show on app sync dynamo dB table,s3 bucket shows synced data. Android 7.1.1 device also doesn't shows newly added Android 10 data.
6) Uninstalled app on Android 7.1.1 and reinstalled, Signed Up a new user.and got following exception, but new user got created successfully in Cognito user pool.

com.prodigy.smartkospet E/AuthenticationActivity: Sign up failed
    AmplifyException {message=Sign up failed, cause=com.amazonaws.services.cognitoidentityprovider.model.UsernameExistsException: User already exists (Service: AmazonCognitoIdentityProvider; Status Code: 400; Error Code: UsernameExistsException; Request ID: fa59b479-4071-46b1-a93b-2dea80cbed58), recoverySuggestion=See attached exception for more details}
        at com.amplifyframework.auth.cognito.AWSCognitoAuthPlugin$2.onError(AWSCognitoAuthPlugin.java:1)
        at com.amazonaws.mobile.client.internal.InternalCallback.call(InternalCallback.java:77)
        at com.amazonaws.mobile.client.internal.InternalCallback.onError(InternalCallback.java:67)
        at com.amazonaws.mobile.client.AWSMobileClient$13$1.onFailure(AWSMobileClient.java:1925)
        at com.amazonaws.mobileconnectors.cognitoidentityprovider.CognitoUserPool.signUp(CognitoUserPool.java:423)
        at com.amazonaws.mobile.client.AWSMobileClient$13.run(AWSMobileClient.java:1894)
        at com.amazonaws.mobile.client.internal.InternalCallback$1.run(InternalCallback.java:101)
        at java.lang.Thread.run(Thread.java:761)
     Caused by: com.amazonaws.services.cognitoidentityprovider.model.UsernameExistsException: User already exists (Service: AmazonCognitoIdentityProvider; Status Code: 400; Error Code: UsernameExistsException; Request ID: fa59b479-4071-46b1-a93b-2dea80cbed58)
        at com.amazonaws.http.AmazonHttpClient.handleErrorResponse(AmazonHttpClient.java:730)
        at com.amazonaws.http.AmazonHttpClient.executeHelper(AmazonHttpClient.java:405)
        at com.amazonaws.http.AmazonHttpClient.execute(AmazonHttpClient.java:212)
        at com.amazonaws.services.cognitoidentityprovider.AmazonCognitoIdentityProviderClient.invoke(AmazonCognitoIdentityProviderClient.java:6319)
        at com.amazonaws.services.cognitoidentityprovider.AmazonCognitoIdentityProviderClient.signUp(AmazonCognitoIdentityProviderClient.java:5327)
        at com.amazonaws.mobileconnectors.cognitoidentityprovider.CognitoUserPool.signUpInternal(CognitoUserPool.java:472)
        at com.amazonaws.mobileconnectors.cognitoidentityprovider.CognitoUserPool.signUp(CognitoUserPool.java:418)
        at com.amazonaws.mobile.client.AWSMobileClient$13.run(AWSMobileClient.java:1894)聽
        at com.amazonaws.mobile.client.internal.InternalCallback$1.run(InternalCallback.java:101)聽
        at java.lang.Thread.run(Thread.java:761)聽

7) Took app one more time, automatic sign-in didn't work, signed in with new user created in the previous step, sign in got successful and the app shows data corresponding to previous user.
8) Added new data on watch. Added data doesn't shows up on Dynamo dB cloud console,at the same time s3 bucket shows data.

@sunithapremjee - per issue 6 did you read the output of the error? It says, "UsernameExistsException: User already exists" - you can't sign up a user with the same username as another user you previously created.

I am sure this particular username was not created before.While signup process was going on, I think I clicked sign up button one more time in matter of seconds may be.Ok, I'll try catching this scenario through exception handling then.How can I resolve other pending issues, please direct me.

You mentioned a few times that data is showing up in the S3 bucket but Datastore doesn't publish to S3. Could you clarify?

Following is my code snippet for adding all string data to AWS app sync DynamoDb table and audio file to the S3 bucket. On adding a second item audio file is seen AWS console S3, but the Appsync Dynamo dB table doesn't show any string data. Dynamo db table and s3 bucket picture attached.

Amplify.DataStore.save(
        data,
        success ->uploadFile(),
        error -> Log.e("AddNewDataFragment", "Could not save item to DataStore", error)
);private void uploadFile() {

    Amplify.Storage.uploadFile(
            getS3Key(audioPath),
            new File(audioPath),
            result ->  {
                runOnUiThread(new Runnable() {
                    @Override
                    public void run() {
                        mListener.changeFragment(R.id.yourplaylistfragment);
                    }});
            },
            storageFailure -> Log.e("AddNewDataFragment", "Upload failed", storageFailure)
    );
}

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.

Hey @sunithapremjee - since it seems like your main issue is the initial sync is failing before you can sign in, I recommend trying this as a workaround while we work to correct the root issue. In the success callback for signing in, call the DataStore clear() method as documented here: https://docs.amplify.aws/lib/datastore/sync/q/platform/android#conflict-detection-and-resolution

This should trigger a fresh initial sync which should work now that you're logged in.

Was this page helpful?
0 / 5 - 0 ratings