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

DataStore IrRecoverableException on Android #3658

Closed
3 of 14 tasks
wojciechzahradnikdeviniti opened this issue Aug 31, 2023 · 24 comments
Closed
3 of 14 tasks

DataStore IrRecoverableException on Android #3658

wojciechzahradnikdeviniti opened this issue Aug 31, 2023 · 24 comments
Assignees
Labels
bug Something is not working; the issue has reproducible steps and has been reproduced datastore Issues related to the DataStore Category requires-cli-fix Issues that require a CLI fix to resolve the root cause of issue.

Comments

@wojciechzahradnikdeviniti

Description

Hi, on Android when I have already some data in the DataStore and sync is doing updates and some data sync successfully then this error occurs (each time with different model). On iOS it works fine.

I'm creating a new issue according to @Jordan-Nelson comment.

#3580
aws-amplify/amplify-android#2471

W/amplify:aws-datastore(24053): Initial cloud sync failed for ObjectTemplate.
W/amplify:aws-datastore(24053): IrRecoverableException{message=Empty response from AppSync., cause=null, recoverySuggestion=Report to AWS team.}
W/amplify:aws-datastore(24053): 	at com.amplifyframework.datastore.syncengine.SyncProcessor.lambda$syncPage$14(SyncProcessor.java:316)
W/amplify:aws-datastore(24053): 	at com.amplifyframework.datastore.syncengine.SyncProcessor$$ExternalSyntheticLambda19.accept(Unknown Source:4)
W/amplify:aws-datastore(24053): 	at com.amplifyframework.datastore.appsync.AppSyncClient$$ExternalSyntheticLambda1.accept(Unknown Source:4)
W/amplify:aws-datastore(24053): 	at com.amplifyframework.api.aws.AppSyncGraphQLOperation$OkHttpCallback.onResponse(AppSyncGraphQLOperation.java:153)
W/amplify:aws-datastore(24053): 	at okhttp3.internal.connection.RealCall$AsyncCall.run(RealCall.kt:539)
W/amplify:aws-datastore(24053): 	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
W/amplify:aws-datastore(24053): 	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:644)
W/amplify:aws-datastore(24053): 	at java.lang.Thread.run(Thread.java:1012)
E/amplify:flutter:datastore(24053): DataStoreException{message=Initial cloud sync failed for ObjectTemplate., cause=IrRecoverableException{message=Empty response from AppSync., cause=null, recoverySuggestion=Report to AWS team.}, recoverySuggestion=Check your internet connection.}
E/amplify:aws-datastore(24053): Failure encountered while attempting to start API sync.
E/amplify:aws-datastore(24053): DataStoreException{message=Initial sync during DataStore initialization failed., cause=java.lang.RuntimeException: IrRecoverableException{message=Empty response from AppSync., cause=null, recoverySuggestion=Report to AWS team.}, recoverySuggestion=There is a possibility that there is a bug if this error persists. Please take a look at 
E/amplify:aws-datastore(24053): https://github.com/aws-amplify/amplify-android/issues to see if there are any existing issues that 
E/amplify:aws-datastore(24053): match your scenario, and file an issue with the details of the bug if there isn't.}
E/amplify:aws-datastore(24053): 	at com.amplifyframework.datastore.syncengine.Orchestrator.lambda$startApiSync$4$com-amplifyframework-datastore-syncengine-Orchestrator(Orchestrator.java:338)
E/amplify:aws-datastore(24053): 	at com.amplifyframework.datastore.syncengine.Orchestrator$$ExternalSyntheticLambda8.subscribe(Unknown Source:2)
E/amplify:aws-datastore(24053): 	at io.reactivex.rxjava3.internal.operators.completable.CompletableCreate.subscribeActual(CompletableCreate.java:40)
E/amplify:aws-datastore(24053): 	at io.reactivex.rxjava3.core.Completable.subscribe(Completable.java:2850)
/amplify:aws-datastore( 5550): Initial cloud sync failed for QuestionItemTemplate.
W/amplify:aws-datastore( 5550): IrRecoverableException{message=Empty response from AppSync., cause=null, recoverySuggestion=Report to AWS team.}
W/amplify:aws-datastore( 5550): 	at com.amplifyframework.datastore.syncengine.SyncProcessor.lambda$syncPage$16(SyncProcessor.java:325)
W/amplify:aws-datastore( 5550): 	at com.amplifyframework.datastore.syncengine.SyncProcessor$$ExternalSyntheticLambda19.accept(Unknown Source:4)
W/amplify:aws-datastore( 5550): 	at com.amplifyframework.datastore.appsync.AppSyncClient$$ExternalSyntheticLambda1.accept(Unknown Source:4)
W/amplify:aws-datastore( 5550): 	at com.amplifyframework.api.aws.AppSyncGraphQLOperation$OkHttpCallback.onResponse(AppSyncGraphQLOperation.java:153)
W/amplify:aws-datastore( 5550): 	at okhttp3.internal.connection.RealCall$AsyncCall.run(RealCall.kt:539)
W/amplify:aws-datastore( 5550): 	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
W/amplify:aws-datastore( 5550): 	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:644)
W/amplify:aws-datastore( 5550): 	at java.lang.Thread.run(Thread.java:1012)
E/amplify:flutter:datastore( 5550): DataStoreException{message=Initial cloud sync failed for QuestionItemTemplate., cause=IrRecoverableException{message=Empty response from AppSync., cause=null, recoverySuggestion=Report to AWS team.}, recoverySuggestion=Check your internet connection.}
E/amplify:aws-datastore( 5550): Failure encountered while attempting to start API sync.
E/amplify:aws-datastore( 5550): DataStoreException{message=Initial sync during DataStore initialization failed., cause=java.lang.RuntimeException: IrRecoverableException{message=Empty response from AppSync., cause=null, recoverySuggestion=Report to AWS team.}, recoverySuggestion=There is a possibility that there is a bug if this error persists. Please take a look at 
E/amplify:aws-datastore( 5550): https://github.com/aws-amplify/amplify-android/issues to see if there are any existing issues that 
E/amplify:aws-datastore( 5550): match your scenario, and file an issue with the details of the bug if there isn't.}
E/amplify:aws-datastore( 5550): 	at com.amplifyframework.datastore.syncengine.Orchestrator.lambda$startApiSync$4$com-amplifyframework-datastore-syncengine-Orchestrator(Orchestrator.java:362)
E/amplify:aws-datastore( 5550): 	at com.amplifyframework.datastore.syncengine.Orchestrator$$ExternalSyntheticLambda8.subscribe(Unknown Source:2)
E/amplify:aws-datastore( 5550): 	at io.reactivex.rxjava3.internal.operators.completable.CompletableCreate.subscribeActual(CompletableCreate.java:40)
E/amplify:aws-datastore( 5550): 	at io.reactivex.rxjava3.core.Completable.subscribe(Completable.java:2850)
E/amplify:aws-datastore( 5550): 	at io.reactivex.rxjava3.internal.operators.completable.CompletablePeek.subscribeActual(CompletablePeek.java:51)
E/amplify:aws-datastore( 5550): 	at io.reactivex.rxjava3.core.Completable.subscribe(Completable.java:2850)
E/amplify:aws-datastore( 5550): 	at io.reactivex.rxjava3.internal.operators.completable.CompletablePeek.subscribeActual(CompletablePeek.java:51)
E/amplify:aws-datastore( 5550): 	at io.reactivex.rxjava3.core.Completable.subscribe(Completable.java:2850)
E/amplify:aws-datastore( 5550): 	at io.reactivex.rxjava3.internal.operators.completable.CompletablePeek.subscribeActual(CompletablePeek.java:51)
E/amplify:aws-datastore( 5550): 	at io.reactivex.rxjava3.core.Completable.subscribe(Completable.java:2850)
E/amplify:aws-datastore( 5550): 	at io.reactivex.rxjava3.internal.operators.completable.CompletableSubscribeOn$SubscribeOnObserver.run(CompletableSubscribeOn.java:64)
E/amplify:aws-datastore( 5550): 	at io.reactivex.rxjava3.core.Scheduler$DisposeTask.run(Scheduler.java:614)
E/amplify:aws-datastore( 5550): 	at io.reactivex.rxjava3.internal.schedulers.ScheduledRunnable.run(ScheduledRunnable.java:65)
E/amplify:aws-datastore( 5550): 	at io.reactivex.rxjava3.internal.schedulers.ScheduledRunnable.call(ScheduledRunnable.java:56)
E/amplify:aws-datastore( 5550): 	at java.util.concurrent.FutureTask.run(FutureTask.java:264)
E/amplify:aws-datastore( 5550): 	at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:307)
E/amplify:aws-datastore( 5550): 	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
E/amplify:aws-datastore( 5550): 	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:644)
E/amplify:aws-datastore( 5550): 	at java.lang.Thread.run(Thread.java:1012)
E/amplify:aws-datastore( 5550): Caused by: java.lang.RuntimeException: IrRecoverableException{message=Empty response from AppSync., cause=null, recoverySuggestion=Report to AWS team.}
E/amplify:aws-datastore( 5550): 	at io.reactivex.rxjava3.internal.util.ExceptionHelper.wrapOrThrow(ExceptionHelper.java:46)
E/amplify:aws-datastore( 5550): 	at io.reactivex.rxjava3.internal.observers.BlockingMultiObserver.blockingGet(BlockingMultiObserver.java:94)
E/amplify:aws-datastore( 5550): 	at io.reactivex.rxjava3.core.Completable.blockingAwait(Completable.java:1461)
E/amplify:aws-datastore( 5550): 	at com.amplifyframework.datastore.syncengine.Orchestrator.lambda$startApiSync$4$com-amplifyframework-datastore-syncengine-Orchestrator(Orchestrator.java:358)
E/amplify:aws-datastore( 5550): 	... 18 more
E/amplify:aws-datastore( 5550): Caused by: IrRecoverableException{message=Empty response from AppSync., cause=null, recoverySuggestion=Report to AWS team.}
E/amplify:aws-datastore( 5550): 	at com.amplifyframework.datastore.syncengine.SyncProcessor.lambda$syncPage$16(SyncProcessor.java:325)
E/amplify:aws-datastore( 5550): 	at com.amplifyframework.datastore.syncengine.SyncProcessor$$ExternalSyntheticLambda19.accept(Unknown Source:4)
E/amplify:aws-datastore( 5550): 	at com.amplifyframework.datastore.appsync.AppSyncClient$$ExternalSyntheticLambda1.accept(Unknown Source:4)
E/amplify:aws-datastore( 5550): 	at com.amplifyframework.api.aws.AppSyncGraphQLOperation$OkHttpCallback.onResponse(AppSyncGraphQLOperation.java:153)
E/amplify:aws-datastore( 5550): 	at okhttp3.internal.connection.RealCall$AsyncCall.run(RealCall.kt:539)
E/amplify:aws-datastore( 5550): 	... 3 more
W/amplify:aws-datastore( 5550): API sync failed - transitioning to LOCAL_ONLY.
W/amplify:aws-datastore( 5550): DataStoreException{message=Initial sync during DataStore initialization failed., cause=java.lang.RuntimeException: IrRecoverableException{message=Empty response from AppSync., cause=null, recoverySuggestion=Report to AWS team.}, recoverySuggestion=There is a possibility that there is a bug if this error persists. Please take a look at 
W/amplify:aws-datastore( 5550): https://github.com/aws-amplify/amplify-android/issues to see if there are any existing issues that 
W/amplify:aws-datastore( 5550): match your scenario, and file an issue with the details of the bug if there isn't.}
W/amplify:aws-datastore( 5550): 	at com.amplifyframework.datastore.syncengine.Orchestrator.lambda$startApiSync$4$com-amplifyframework-datastore-syncengine-Orchestrator(Orchestrator.java:362)
W/amplify:aws-datastore( 5550): 	at com.amplifyframework.datastore.syncengine.Orchestrator$$ExternalSyntheticLambda8.subscribe(Unknown Source:2)
W/amplify:aws-datastore( 5550): 	at io.reactivex.rxjava3.internal.operators.completable.CompletableCreate.subscribeActual(CompletableCreate.java:40)
W/amplify:aws-datastore( 5550): 	at io.reactivex.rxjava3.core.Completable.subscribe(Completable.java:2850)
W/amplify:aws-datastore( 5550): 	at io.reactivex.rxjava3.internal.operators.completable.CompletablePeek.subscribeActual(CompletablePeek.java:51)
W/amplify:aws-datastore( 5550): 	at io.reactivex.rxjava3.core.Completable.subscribe(Completable.java:2850)
W/amplify:aws-datastore( 5550): 	at io.reactivex.rxjava3.internal.operators.completable.CompletablePeek.subscribeActual(CompletablePeek.java:51)
W/amplify:aws-datastore( 5550): 	at io.reactivex.rxjava3.core.Completable.subscribe(Completable.java:2850)
W/amplify:aws-datastore( 5550): 	at io.reactivex.rxjava3.internal.operators.completable.CompletablePeek.subscribeActual(CompletablePeek.java:51)
W/amplify:aws-datastore( 5550): 	at io.reactivex.rxjava3.core.Completable.subscribe(Completable.java:2850)
W/amplify:aws-datastore( 5550): 	at io.reactivex.rxjava3.internal.operators.completable.CompletableSubscribeOn$SubscribeOnObserver.run(CompletableSubscribeOn.java:64)
W/amplify:aws-datastore( 5550): 	at io.reactivex.rxjava3.core.Scheduler$DisposeTask.run(Scheduler.java:614)
W/amplify:aws-datastore( 5550): 	at io.reactivex.rxjava3.internal.schedulers.ScheduledRunnable.run(ScheduledRunnable.java:65)
W/amplify:aws-datastore( 5550): 	at io.reactivex.rxjava3.internal.schedulers.ScheduledRunnable.call(ScheduledRunnable.java:56)
W/amplify:aws-datastore( 5550): 	at java.util.concurrent.FutureTask.run(FutureTask.java:264)
W/amplify:aws-datastore( 5550): 	at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:307)
W/amplify:aws-datastore( 5550): 	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
W/amplify:aws-datastore( 5550): 	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:644)
W/amplify:aws-datastore( 5550): 	at java.lang.Thread.run(Thread.java:1012)
W/amplify:aws-datastore( 5550): Caused by: java.lang.RuntimeException: IrRecoverableException{message=Empty response from AppSync., cause=null, recoverySuggestion=Report to AWS team.}
W/amplify:aws-datastore( 5550): 	at io.reactivex.rxjava3.internal.util.ExceptionHelper.wrapOrThrow(ExceptionHelper.java:46)
W/amplify:aws-datastore( 5550): 	at io.reactivex.rxjava3.internal.observers.BlockingMultiObserver.blockingGet(BlockingMultiObserver.java:94)
W/amplify:aws-datastore( 5550): 	at io.reactivex.rxjava3.core.Completable.blockingAwait(Completable.java:1461)
W/amplify:aws-datastore( 5550): 	at com.amplifyframework.datastore.syncengine.Orchestrator.lambda$startApiSync$4$com-amplifyframework-datastore-syncengine-Orchestrator(Orchestrator.java:358)
W/amplify:aws-datastore( 5550): 	... 18 more
W/amplify:aws-datastore( 5550): Caused by: IrRecoverableException{message=Empty response from AppSync., cause=null, recoverySuggestion=Report to AWS team.}
W/amplify:aws-datastore( 5550): 	at com.amplifyframework.datastore.syncengine.SyncProcessor.lambda$syncPage$16(SyncProcessor.java:325)
W/amplify:aws-datastore( 5550): 	at com.amplifyframework.datastore.syncengine.SyncProcessor$$ExternalSyntheticLambda19.accept(Unknown Source:4)
W/amplify:aws-datastore( 5550): 	at com.amplifyframework.datastore.appsync.AppSyncClient$$ExternalSyntheticLambda1.accept(Unknown Source:4)
W/amplify:aws-datastore( 5550): 	at com.amplifyframework.api.aws.AppSyncGraphQLOperation$OkHttpCallback.onResponse(AppSyncGraphQLOperation.java:153)
W/amplify:aws-datastore( 5550): 	at okhttp3.internal.connection.RealCall$AsyncCall.run(RealCall.kt:539)
W/amplify:aws-datastore( 5550): 	... 3 more
I/amplify:aws-datastore( 5550): Orchestrator transitioning from SYNC_VIA_API to LOCAL_ONLY
I/amplify:aws-datastore( 5550): Stopping subscription processor.
I/amplify:aws-datastore( 5550): Stopped subscription processor.
I/amplify:aws-datastore( 5550): Setting currentState to LOCAL_ONLY

Categories

  • Analytics
  • API (REST)
  • API (GraphQL)
  • Auth
  • Authenticator
  • DataStore
  • Notifications (Push)
  • Storage

Steps to Reproduce

No response

Screenshots

No response

Platforms

  • iOS
  • Android
  • Web
  • macOS
  • Windows
  • Linux

Flutter Version

3.10.6

Amplify Flutter Version

1.4.0

Deployment Method

Amplify CLI

Schema

type ObjectTemplate @model @auth(rules: [{ allow: private }, { allow: private, provider: iam }]) {
  id: ID!
  isArchived: Boolean
  name: String!
  description: String!
  clientId: ID! @index(name: "byClient", queryField: "objectTemplateByClient")
  createdById: ID!
  flowType: FlowType!
  jobs: [Job] @hasMany(indexName: "byFlow", fields: ["id"])
  regionIds: [ID]
}

type QuestionItemTemplate @model @auth(rules: [{ allow: private }, { allow: private, provider: iam }]) {
  id: ID!
  clientId: ID! @index(name: "byClient", queryField: "questionItemTemplateByClient")
  title: String!
  type: QuestionItemType!
  placeholder: String
  questionTemplateId: ID! @index(name: "byQuestionTemplate", queryField: "questionItemTemplateByQuestionTemplate")
  questionItems: [QuestionItem!] @hasMany(indexName: "byQuestionItemTemplate", fields: ["id"])
}
@Jordan-Nelson Jordan-Nelson added datastore Issues related to the DataStore Category pending-triage This issue is in the backlog of issues to triage labels Aug 31, 2023
@Jordan-Nelson
Copy link
Member

The exception you are seeing indicates that AppSync returned no data and no errors. It is expected that AppSync will always return one or the other. I am not sure what would cause this to occur.

How was the back end created (with the Amplify cli, or through some other means)? Do you have conflict resolution enabled? Have you (recently, or previously) made changes to the back end to either change the schema or enable/diable conflict resolution? Do you use any custom resolvers?

@Jordan-Nelson Jordan-Nelson added pending-community-response Pending response from the issue opener or other community members Investigating and removed pending-triage This issue is in the backlog of issues to triage pending-community-response Pending response from the issue opener or other community members labels Sep 1, 2023
@Jordan-Nelson Jordan-Nelson self-assigned this Sep 1, 2023
@wojciechzahradnikdeviniti
Copy link
Author

wojciechzahradnikdeviniti commented Sep 4, 2023

hi @Jordan-Nelson

  • with the Amplify cli
  • conflictResolution
"conflictResolution": {
      "defaultResolutionStrategy": {
        "type": "AUTOMERGE"
      }
    },
  • nope
  • I'm not sure but probably no

Some data sync successfully but when IrRecoverableException occurs then sync stop immediately.
Imo in this situation when AppSync return no data and no errors it should continue sync and be able to sync other models.

@wojciechzahradnikdeviniti
Copy link
Author

hi @Jordan-Nelson for now imo it's critical issue, because I cannot sync my datastore on Android without clear it.

E/amplify:aws-datastore( 4998): Failure encountered while attempting to start API sync.
E/amplify:aws-datastore( 4998): DataStoreException{message=Initial sync during DataStore initialization failed., cause=java.lang.RuntimeException: IrRecoverableException{message=Empty response from AppSync., cause=null, recoverySuggestion=Report to AWS team.}, recoverySuggestion=There is a possibility that there is a bug if this error persists. Please take a look at 
E/amplify:aws-datastore( 4998): https://github.com/aws-amplify/amplify-android/issues to see if there are any existing issues that 
E/amplify:aws-datastore( 4998): match your scenario, and file an issue with the details of the bug if there isn't.}
E/amplify:aws-datastore( 4998): 	at com.amplifyframework.datastore.syncengine.Orchestrator.lambda$startApiSync$4$com-amplifyframework-datastore-syncengine-Orchestrator(Orchestrator.java:362)
E/amplify:aws-datastore( 4998): 	at com.amplifyframework.datastore.syncengine.Orchestrator$$ExternalSyntheticLambda8.subscribe(Unknown Source:2)
E/amplify:aws-datastore( 4998): 	at io.reactivex.rxjava3.internal.operators.completable.CompletableCreate.subscribeActual(CompletableCreate.java:40)
E/amplify:aws-datastore( 4998): 	at io.reactivex.rxjava3.core.Completable.subscribe(Completable.java:2850)
E/amplify:aws-datastore( 4998): 	at io.reactivex.rxjava3.internal.operators.completable.CompletablePeek.subscribeActual(CompletablePeek.java:51)
E/amplify:aws-datastore( 4998): 	at io.reactivex.rxjava3.core.Completable.subscribe(Completable.java:2850)
E/amplify:aws-datastore( 4998): 	at io.reactivex.rxjava3.internal.operators.completable.CompletablePeek.subscribeActual(CompletablePeek.java:51)
E/amplify:aws-datastore( 4998): 	at io.reactivex.rxjava3.core.Completable.subscribe(Completable.java:2850)
E/amplify:aws-datastore( 4998): 	at io.reactivex.rxjava3.internal.operators.completable.CompletablePeek.subscribeActual(CompletablePeek.java:51)
E/amplify:aws-datastore( 4998): 	at io.reactivex.rxjava3.core.Completable.subscribe(Completable.java:2850)
E/amplify:aws-datastore( 4998): 	at io.reactivex.rxjava3.internal.operators.completable.CompletableSubscribeOn$SubscribeOnObserver.run(CompletableSubscribeOn.java:64)
E/amplify:aws-datastore( 4998): 	at io.reactivex.rxjava3.core.Scheduler$DisposeTask.run(Scheduler.java:614)
E/amplify:aws-datastore( 4998): 	at io.reactivex.rxjava3.internal.schedulers.ScheduledRunnable.run(ScheduledRunnable.java:65)
E/amplify:aws-datastore( 4998): 	at io.reactivex.rxjava3.internal.schedulers.ScheduledRunnable.call(ScheduledRunnable.java:56)
E/amplify:aws-datastore( 4998): 	at java.util.concurrent.FutureTask.run(FutureTask.java:264)
E/amplify:aws-datastore( 4998): 	at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:307)
E/amplify:aws-datastore( 4998): 	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
E/amplify:aws-datastore( 4998): 	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:644)
E/amplify:aws-datastore( 4998): 	at java.lang.Thread.run(Thread.java:1012)
E/amplify:aws-datastore( 4998): Caused by: java.lang.RuntimeException: IrRecoverableException{message=Empty response from AppSync., cause=null, recoverySuggestion=Report to AWS team.}
E/amplify:aws-datastore( 4998): 	at io.reactivex.rxjava3.internal.util.ExceptionHelper.wrapOrThrow(ExceptionHelper.java:46)
E/amplify:aws-datastore( 4998): 	at io.reactivex.rxjava3.internal.observers.BlockingMultiObserver.blockingGet(BlockingMultiObserver.java:94)
E/amplify:aws-datastore( 4998): 	at io.reactivex.rxjava3.core.Completable.blockingAwait(Completable.java:1461)
E/amplify:aws-datastore( 4998): 	at com.amplifyframework.datastore.syncengine.Orchestrator.lambda$startApiSync$4$com-amplifyframework-datastore-syncengine-Orchestrator(Orchestrator.java:358)
E/amplify:aws-datastore( 4998): 	... 18 more
E/amplify:aws-datastore( 4998): Caused by: IrRecoverableException{message=Empty response from AppSync., cause=null, recoverySuggestion=Report to AWS team.}
E/amplify:aws-datastore( 4998): 	at com.amplifyframework.datastore.syncengine.SyncProcessor.lambda$syncPage$16(SyncProcessor.java:325)
E/amplify:aws-datastore( 4998): 	at com.amplifyframework.datastore.syncengine.SyncProcessor$$ExternalSyntheticLambda19.accept(Unknown Source:4)
E/amplify:aws-datastore( 4998): 	at com.amplifyframework.datastore.appsync.AppSyncClient$$ExternalSyntheticLambda1.accept(Unknown Source:4)
E/amplify:aws-datastore( 4998): 	at com.amplifyframework.api.aws.AppSyncGraphQLOperation$OkHttpCallback.onResponse(AppSyncGraphQLOperation.java:153)
E/amplify:aws-datastore( 4998): 	at okhttp3.internal.connection.RealCall$AsyncCall.run(RealCall.kt:539)
E/amplify:aws-datastore( 4998): 	... 3 more
W/amplify:aws-datastore( 4998): API sync failed - transitioning to LOCAL_ONLY.
W/amplify:aws-datastore( 4998): DataStoreException{message=Initial sync during DataStore initialization failed., cause=java.lang.RuntimeException: IrRecoverableException{message=Empty response from AppSync., cause=null, recoverySuggestion=Report to AWS team.}, recoverySuggestion=There is a possibility that there is a bug if this error persists. Please take a look at 
W/amplify:aws-datastore( 4998): https://github.com/aws-amplify/amplify-android/issues to see if there are any existing issues that 
W/amplify:aws-datastore( 4998): match your scenario, and file an issue with the details of the bug if there isn't.}
W/amplify:aws-datastore( 4998): 	at com.amplifyframework.datastore.syncengine.Orchestrator.lambda$startApiSync$4$com-amplifyframework-datastore-syncengine-Orchestrator(Orchestrator.java:362)
W/amplify:aws-datastore( 4998): 	at com.amplifyframework.datastore.syncengine.Orchestrator$$ExternalSyntheticLambda8.subscribe(Unknown Source:2)
W/amplify:aws-datastore( 4998): 	at io.reactivex.rxjava3.internal.operators.completable.CompletableCreate.subscribeActual(CompletableCreate.java:40)
W/amplify:aws-datastore( 4998): 	at io.reactivex.rxjava3.core.Completable.subscribe(Completable.java:2850)
W/amplify:aws-datastore( 4998): 	at io.reactivex.rxjava3.internal.operators.completable.CompletablePeek.subscribeActual(CompletablePeek.java:51)
W/amplify:aws-datastore( 4998): 	at io.reactivex.rxjava3.core.Completable.subscribe(Completable.java:2850)
W/amplify:aws-datastore( 4998): 	at io.reactivex.rxjava3.internal.operators.completable.CompletablePeek.subscribeActual(CompletablePeek.java:51)
W/amplify:aws-datastore( 4998): 	at io.reactivex.rxjava3.core.Completable.subscribe(Completable.java:2850)
W/amplify:aws-datastore( 4998): 	at io.reactivex.rxjava3.internal.operators.completable.CompletablePeek.subscribeActual(CompletablePeek.java:51)
W/amplify:aws-datastore( 4998): 	at io.reactivex.rxjava3.core.Completable.subscribe(Completable.java:2850)
W/amplify:aws-datastore( 4998): 	at io.reactivex.rxjava3.internal.operators.completable.CompletableSubscribeOn$SubscribeOnObserver.run(CompletableSubscribeOn.java:64)
W/amplify:aws-datastore( 4998): 	at io.reactivex.rxjava3.core.Scheduler$DisposeTask.run(Scheduler.java:614)
W/amplify:aws-datastore( 4998): 	at io.reactivex.rxjava3.internal.schedulers.ScheduledRunnable.run(ScheduledRunnable.java:65)
W/amplify:aws-datastore( 4998): 	at io.reactivex.rxjava3.internal.schedulers.ScheduledRunnable.call(ScheduledRunnable.java:56)
W/amplify:aws-datastore( 4998): 	at java.util.concurrent.FutureTask.run(FutureTask.java:264)
W/amplify:aws-datastore( 4998): 	at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:307)
W/amplify:aws-datastore( 4998): 	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
W/amplify:aws-datastore( 4998): 	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:644)
W/amplify:aws-datastore( 4998): 	at java.lang.Thread.run(Thread.java:1012)
W/amplify:aws-datastore( 4998): Caused by: java.lang.RuntimeException: IrRecoverableException{message=Empty response from AppSync., cause=null, recoverySuggestion=Report to AWS team.}
W/amplify:aws-datastore( 4998): 	at io.reactivex.rxjava3.internal.util.ExceptionHelper.wrapOrThrow(ExceptionHelper.java:46)
W/amplify:aws-datastore( 4998): 	at io.reactivex.rxjava3.internal.observers.BlockingMultiObserver.blockingGet(BlockingMultiObserver.java:94)
W/amplify:aws-datastore( 4998): 	at io.reactivex.rxjava3.core.Completable.blockingAwait(Completable.java:1461)
W/amplify:aws-datastore( 4998): 	at com.amplifyframework.datastore.syncengine.Orchestrator.lambda$startApiSync$4$com-amplifyframework-datastore-syncengine-Orchestrator(Orchestrator.java:358)
W/amplify:aws-datastore( 4998): 	... 18 more
W/amplify:aws-datastore( 4998): Caused by: IrRecoverableException{message=Empty response from AppSync., cause=null, recoverySuggestion=Report to AWS team.}
W/amplify:aws-datastore( 4998): 	at com.amplifyframework.datastore.syncengine.SyncProcessor.lambda$syncPage$16(SyncProcessor.java:325)
W/amplify:aws-datastore( 4998): 	at com.amplifyframework.datastore.syncengine.SyncProcessor$$ExternalSyntheticLambda19.accept(Unknown Source:4)
W/amplify:aws-datastore( 4998): 	at com.amplifyframework.datastore.appsync.AppSyncClient$$ExternalSyntheticLambda1.accept(Unknown Source:4)
W/amplify:aws-datastore( 4998): 	at com.amplifyframework.api.aws.AppSyncGraphQLOperation$OkHttpCallback.onResponse(AppSyncGraphQLOperation.java:153)
W/amplify:aws-datastore( 4998): 	at okhttp3.internal.connection.RealCall$AsyncCall.run(RealCall.kt:539)
W/amplify:aws-datastore( 4998): 	... 3 more
I/amplify:aws-datastore( 4998): Orchestrator transitioning from SYNC_VIA_API to LOCAL_ONLY
I/amplify:aws-datastore( 4998): Stopping subscription processor.
I/amplify:aws-datastore( 4998): Stopped subscription processor.
I/amplify:aws-datastore( 4998): Setting currentState to LOCAL_ONLY

@Jordan-Nelson
Copy link
Member

@wojciechzahradnikdeviniti - Are you able to reproduce consistently? Are you able to capture the network requests/responses when this occurs? The requests are made from the native Android layer, so they will not show in the Dart dev tools. You could use a tool like Charles proxy to capture them.

@Jordan-Nelson Jordan-Nelson added the pending-community-response Pending response from the issue opener or other community members label Sep 6, 2023
@ridakaddir
Copy link

I'm getting the same issue occasionally when I disconnect and connect the Android device to the internet

W/amplify:aws-datastore( 1737): Initial cloud sync failed for ********. W/amplify:aws-datastore( 1737): IrRecoverableException{message=Empty response from AppSync., cause=null, recoverySuggestion=Report to AWS team.} W/amplify:aws-datastore( 1737): at com.amplifyframework.datastore.syncengine.SyncProcessor.lambda$syncPage$16(SyncProcessor.java:325) W/amplify:aws-datastore( 1737): at com.amplifyframework.datastore.syncengine.SyncProcessor$$ExternalSyntheticLambda11.accept(Unknown Source:4) W/amplify:aws-datastore( 1737): at com.amplifyframework.datastore.appsync.AppSyncClient$$ExternalSyntheticLambda4.accept(Unknown Source:4) W/amplify:aws-datastore( 1737): at com.amplifyframework.api.aws.AppSyncGraphQLOperation$OkHttpCallback.onResponse(AppSyncGraphQLOperation.java:153) W/amplify:aws-datastore( 1737): at okhttp3.internal.connection.RealCall$AsyncCall.run(RealCall.kt:539) W/amplify:aws-datastore( 1737): at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1137) W/amplify:aws-datastore( 1737): at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:637) W/amplify:aws-datastore( 1737): at java.lang.Thread.run(Thread.java:1012) E/amplify:aws-datastore( 1737): Failure encountered while attempting to start API sync. E/amplify:aws-datastore( 1737): DataStoreException{message=Initial sync during DataStore initialization failed., cause=io.reactivex.rxjava3.exceptions.CompositeException: 2 exceptions occurred. , recoverySuggestion=There is a possibility that there is a bug if this error persists. Please take a look at E/amplify:aws-datastore( 1737): https://github.com/aws-amplify/amplify-android/issues to see if there are any existing issues that E/amplify:aws-datastore( 1737): match your scenario, and file an issue with the details of the bug if there isn't.} E/amplify:aws-datastore( 1737): at com.amplifyframework.datastore.syncengine.Orchestrator.lambda$startApiSync$4$com-amplifyframework-datastore-syncengine-Orchestrator(Orchestrator.java:362) E/amplify:aws-datastore( 1737): at com.amplifyframework.datastore.syncengine.Orchestrator$$ExternalSyntheticLambda8.subscribe(Unknown Source:2) E/amplify:aws-datastore( 1737): at io.reactivex.rxjava3.internal.operators.completable.CompletableCreate.subscribeActual(CompletableCreate.java:40) E/amplify:aws-datastore( 1737): at io.reactivex.rxjava3.core.Completable.subscribe(Completable.java:2850) E/amplify:aws-datastore( 1737): at io.reactivex.rxjava3.internal.operators.completable.CompletablePeek.subscribeActual(CompletablePeek.java:51) E/amplify:aws-datastore( 1737): at io.reactivex.rxjava3.core.Completable.subscribe(Completable.java:2850) E/amplify:aws-datastore( 1737): at io.reactivex.rxjava3.internal.operators.completable.CompletablePeek.subscribeActual(CompletablePeek.java:51) E/amplify:aws-datastore( 1737): at io.reactivex.rxjava3.core.Completable.subscribe(Completable.java:2850) E/amplify:aws-datastore( 1737): at io.reactivex.rxjava3.internal.operators.completable.CompletablePeek.subscribeActual(CompletablePeek.java:51) E/amplify:aws-datastore( 1737): at io.reactivex.rxjava3.core.Completable.subscribe(Completable.java:2850) E/amplify:aws-datastore( 1737): at io.reactivex.rxjava3.internal.operators.completable.CompletableSubscribeOn$SubscribeOnObserver.run(CompletableSubscribeOn.java:64) E/amplify:aws-datastore( 1737): at io.reactivex.rxjava3.core.Scheduler$DisposeTask.run(Scheduler.java:614) E/amplify:aws-datastore( 1737): at io.reactivex.rxjava3.internal.schedulers.ScheduledRunnable.run(ScheduledRunnable.java:65) E/amplify:aws-datastore( 1737): at io.reactivex.rxjava3.internal.schedulers.ScheduledRunnable.call(ScheduledRunnable.java:56) E/amplify:aws-datastore( 1737): at java.util.concurrent.FutureTask.run(FutureTask.java:264) E/amplify:aws-datastore( 1737): at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:307) E/amplify:aws-datastore( 1737): at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1137) E/amplify:aws-datastore( 1737): at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:637) E/amplify:aws-datastore( 1737): at java.lang.Thread.run(Thread.java:1012) E/amplify:aws-datastore( 1737): Caused by: io.reactivex.rxjava3.exceptions.CompositeException: 2 exceptions occurred. E/amplify:aws-datastore( 1737): at io.reactivex.rxjava3.internal.operators.completable.CompletablePeek$CompletableObserverImplementation.onError(CompletablePeek.java:92) E/amplify:aws-datastore( 1737): at io.reactivex.rxjava3.internal.operators.single.SingleFlatMapCompletable$FlatMapCompletableObserver.onError(SingleFlatMapCompletable.java:97) E/amplify:aws-datastore( 1737): at io.reactivex.rxjava3.internal.operators.single.SingleFlatMap$SingleFlatMapCallback$FlatMapSingleObserver.onError(SingleFlatMap.java:117) E/amplify:aws-datastore( 1737): at io.reactivex.rxjava3.internal.operators.completable.CompletableToSingle$ToSingle.onError(CompletableToSingle.java:73) E/amplify:aws-datastore( 1737): at io.reactivex.rxjava3.internal.util.AtomicThrowable.tryTerminateConsumer(AtomicThrowable.java:156) E/amplify:aws-datastore( 1737): at io.reactivex.rxjava3.internal.operators.mixed.FlowableConcatMapCompletable$ConcatMapCompletableObserver.onError(FlowableConcatMapCompletable.java:129) E/amplify:aws-datastore( 1737): at io.reactivex.rxjava3.internal.util.AtomicThrowable.tryTerminateConsumer(AtomicThrowable.java:94) E/amplify:aws-datastore( 1737): at io.reactivex.rxjava3.internal.util.HalfSerializer.onError(HalfSerializer.java:67) E/amplify:aws-datastore( 1737): at io.reactivex.rxjava3.internal.operators.flowable.FlowableConcatMap$ConcatMapImmediate.onError(FlowableConcatMap.java:199) E/amplify:aws-datastore( 1737): at io.reactivex.rxjava3.internal.operators.flowable.FlowableDematerialize$DematerializeSubscriber.onError(FlowableDematerialize.java:104) E/amplify:aws-datastore( 1737): at io.reactivex.rxjava3.internal.operators.flowable.FlowableDematerialize$DematerializeSubscriber.onNext(FlowableDematerialize.java:87) E/amplify:aws-datastore( 1737): at io.reactivex.rxjava3.internal.operators.flowable.FlowableFilter$FilterSubscriber.tryOnNext(FlowableFilter.java:74) E/amplify:aws-datastore( 1737): at io.reactivex.rxjava3.internal.operators.flowable.FlowableFilter$FilterSubscriber.onNext(FlowableFilter.java:52) E/amplify:aws-datastore( 1737): at io.reactivex.rxjava3.internal.subscribers.SinglePostCompleteSubscriber.complete(SinglePostCompleteSubscriber.java:81) E/amplify:aws-datastore( 1737): at io.reactivex.rxjava3.internal.operators.flowable.FlowableMaterialize$MaterializeSubscriber.onError(FlowableMaterialize.java:49) E/amplify:aws-datastore( 1737): at io.reactivex.rxjava3.internal.operators.flowable.FlowableObserveOn$BaseObserveOnSubscriber.checkTerminated(FlowableObserveOn.java:209) E/amplify:aws-datastore( 1737): at io.reactivex.rxjava3.internal.operators.flowable.FlowableObserveOn$ObserveOnSubscriber.runAsync(FlowableObserveOn.java:394) E/amplify:aws-datastore( 1737): at io.reactivex.rxjava3.internal.operators.flowable.FlowableObserveOn$BaseObserveOnSubscriber.run(FlowableObserveOn.java:176) E/amplify:aws-datastore( 1737): ... 7 more E/amplify:aws-datastore( 1737): Caused by: io.reactivex.rxjava3.exceptions.CompositeException$ExceptionOverview: Multiple exceptions (2) E/amplify:aws-datastore( 1737): |-- com.amplifyframework.datastore.DataStoreException.IrRecoverableException: Empty response from AppSync. E/amplify:aws-datastore( 1737): at com.amplifyframework.datastore.syncengine.SyncProcessor.lambda$syncPage$16(SyncProcessor.java:325) E/amplify:aws-datastore( 1737): |-- java.lang.RuntimeException: Methods marked with @UiThread must be executed on the main thread. Current thread: RxCachedThreadScheduler-34 E/amplify:aws-datastore( 1737): at io.flutter.embedding.engine.FlutterJNI.ensureRunningOnMainThread(FlutterJNI.java:1433) W/amplify:aws-datastore( 1737): API sync failed - transitioning to LOCAL_ONLY. W/amplify:aws-datastore( 1737): DataStoreException{message=Initial sync during DataStore initialization failed., cause=io.reactivex.rxjava3.exceptions.CompositeException: 2 exceptions occurred. , recoverySuggestion=There is a possibility that there is a bug if this error persists. Please take a look at W/amplify:aws-datastore( 1737): https://github.com/aws-amplify/amplify-android/issues to see if there are any existing issues that W/amplify:aws-datastore( 1737): match your scenario, and file an issue with the details of the bug if there isn't.} W/amplify:aws-datastore( 1737): at com.amplifyframework.datastore.syncengine.Orchestrator.lambda$startApiSync$4$com-amplifyframework-datastore-syncengine-Orchestrator(Orchestrator.java:362) W/amplify:aws-datastore( 1737): at com.amplifyframework.datastore.syncengine.Orchestrator$$ExternalSyntheticLambda8.subscribe(Unknown Source:2) W/amplify:aws-datastore( 1737): at io.reactivex.rxjava3.internal.operators.completable.CompletableCreate.subscribeActual(CompletableCreate.java:40) W/amplify:aws-datastore( 1737): at io.reactivex.rxjava3.core.Completable.subscribe(Completable.java:2850) W/amplify:aws-datastore( 1737): at io.reactivex.rxjava3.internal.operators.completable.CompletablePeek.subscribeActual(CompletablePeek.java:51) W/amplify:aws-datastore( 1737): at io.reactivex.rxjava3.core.Completable.subscribe(Completable.java:2850) W/amplify:aws-datastore( 1737): at io.reactivex.rxjava3.internal.operators.completable.CompletablePeek.subscribeActual(CompletablePeek.java:51) W/amplify:aws-datastore( 1737): at io.reactivex.rxjava3.core.Completable.subscribe(Completable.java:2850) W/amplify:aws-datastore( 1737): at io.reactivex.rxjava3.internal.operators.completable.CompletablePeek.subscribeActual(CompletablePeek.java:51) W/amplify:aws-datastore( 1737): at io.reactivex.rxjava3.core.Completable.subscribe(Completable.java:2850) W/amplify:aws-datastore( 1737): at io.reactivex.rxjava3.internal.operators.completable.CompletableSubscribeOn$SubscribeOnObserver.run(CompletableSubscribeOn.java:64) W/amplify:aws-datastore( 1737): at io.reactivex.rxjava3.core.Scheduler$DisposeTask.run(Scheduler.java:614) W/amplify:aws-datastore( 1737): at io.reactivex.rxjava3.internal.schedulers.ScheduledRunnable.run(ScheduledRunnable.java:65) W/amplify:aws-datastore( 1737): at io.reactivex.rxjava3.internal.schedulers.ScheduledRunnable.call(ScheduledRunnable.java:56) W/amplify:aws-datastore( 1737): at java.util.concurrent.FutureTask.run(FutureTask.java:264) W/amplify:aws-datastore( 1737): at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:307) W/amplify:aws-datastore( 1737): at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1137) W/amplify:aws-datastore( 1737): at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:637) W/amplify:aws-datastore( 1737): at java.lang.Thread.run(Thread.java:1012) W/amplify:aws-datastore( 1737): Caused by: io.reactivex.rxjava3.exceptions.CompositeException: 2 exceptions occurred. W/amplify:aws-datastore( 1737): at io.reactivex.rxjava3.internal.operators.completable.CompletablePeek$CompletableObserverImplementation.onError(CompletablePeek.java:92) W/amplify:aws-datastore( 1737): at io.reactivex.rxjava3.internal.operators.single.SingleFlatMapCompletable$FlatMapCompletableObserver.onError(SingleFlatMapCompletable.java:97) W/amplify:aws-datastore( 1737): at io.reactivex.rxjava3.internal.operators.single.SingleFlatMap$SingleFlatMapCallback$FlatMapSingleObserver.onError(SingleFlatMap.java:117) W/amplify:aws-datastore( 1737): at io.reactivex.rxjava3.internal.operators.completable.CompletableToSingle$ToSingle.onError(CompletableToSingle.java:73) W/amplify:aws-datastore( 1737): at io.reactivex.rxjava3.internal.util.AtomicThrowable.tryTerminateConsumer(AtomicThrowable.java:156) W/amplify:aws-datastore( 1737): at io.reactivex.rxjava3.internal.operators.mixed.FlowableConcatMapCompletable$ConcatMapCompletableObserver.onError(FlowableConcatMapCompletable.java:129) W/amplify:aws-datastore( 1737): at io.reactivex.rxjava3.internal.util.AtomicThrowable.tryTerminateConsumer(AtomicThrowable.java:94) W/amplify:aws-datastore( 1737): at io.reactivex.rxjava3.internal.util.HalfSerializer.onError(HalfSerializer.java:67) W/amplify:aws-datastore( 1737): at io.reactivex.rxjava3.internal.operators.flowable.FlowableConcatMap$ConcatMapImmediate.onError(FlowableConcatMap.java:199) W/amplify:aws-datastore( 1737): at io.reactivex.rxjava3.internal.operators.flowable.FlowableDematerialize$DematerializeSubscriber.onError(FlowableDematerialize.java:104) W/amplify:aws-datastore( 1737): at io.reactivex.rxjava3.internal.operators.flowable.FlowableDematerialize$DematerializeSubscriber.onNext(FlowableDematerialize.java:87) W/amplify:aws-datastore( 1737): at io.reactivex.rxjava3.internal.operators.flowable.FlowableFilter$FilterSubscriber.tryOnNext(FlowableFilter.java:74) W/amplify:aws-datastore( 1737): at io.reactivex.rxjava3.internal.operators.flowable.FlowableFilter$FilterSubscriber.onNext(FlowableFilter.java:52) W/amplify:aws-datastore( 1737): at io.reactivex.rxjava3.internal.subscribers.SinglePostCompleteSubscriber.complete(SinglePostCompleteSubscriber.java:81) W/amplify:aws-datastore( 1737): at io.reactivex.rxjava3.internal.operators.flowable.FlowableMaterialize$MaterializeSubscriber.onError(FlowableMaterialize.java:49) W/amplify:aws-datastore( 1737): at io.reactivex.rxjava3.internal.operators.flowable.FlowableObserveOn$BaseObserveOnSubscriber.checkTerminated(FlowableObserveOn.java:209) W/amplify:aws-datastore( 1737): at io.reactivex.rxjava3.internal.operators.flowable.FlowableObserveOn$ObserveOnSubscriber.runAsync(FlowableObserveOn.java:394) W/amplify:aws-datastore( 1737): at io.reactivex.rxjava3.internal.operators.flowable.FlowableObserveOn$BaseObserveOnSubscriber.run(FlowableObserveOn.java:176) W/amplify:aws-datastore( 1737): ... 7 more W/amplify:aws-datastore( 1737): Caused by: io.reactivex.rxjava3.exceptions.CompositeException$ExceptionOverview: Multiple exceptions (2) W/amplify:aws-datastore( 1737): |-- com.amplifyframework.datastore.DataStoreException.IrRecoverableException: Empty response from AppSync. W/amplify:aws-datastore( 1737): at com.amplifyframework.datastore.syncengine.SyncProcessor.lambda$syncPage$16(SyncProcessor.java:325) W/amplify:aws-datastore( 1737): |-- java.lang.RuntimeException: Methods marked with @UiThread must be executed on the main thread. Current thread: RxCachedThreadScheduler-34 W/amplify:aws-datastore( 1737): at io.flutter.embedding.engine.FlutterJNI.ensureRunningOnMainThread(FlutterJNI.java:1433) I/amplify:aws-datastore( 1737): Orchestrator transitioning from SYNC_VIA_API to LOCAL_ONLY I/amplify:aws-datastore( 1737): Stopping subscription processor. I/amplify:aws-datastore( 1737): Stopped subscription processor. I/amplify:aws-datastore( 1737): Setting currentState to LOCAL_ONLY

@ridakaddir
Copy link

ridakaddir commented Sep 7, 2023

@Jordan-Nelson
In my case, AppSync is returning an error. do you have any idea why my dynamodb table fails sometimes to find the index?

{ "data": { "syncCollections": null }, "errors": [ { "path": [ "syncCollections" ], "data": null, "errorType": "DynamoDB:DynamoDbException", "errorInfo": null, "locations": [ { "line": 2, "column": 3, "sourceName": null } ], "message": "The table does not have the specified index: IndexName (Service: DynamoDb, Status Code: 400, Request ID: *****************************************)" } ] }

I have an index created using amplify cli in my Appsync schema model (dynamodb table)

when datastore tries to sync the delta using the lastSync value I get the error The table does not have the specified index
but if I send the same query without the lastSync field the query works

@Jordan-Nelson
Copy link
Member

@ridakaddir - Is that only response with an error? Do any responses have null/empty data and null/empty errors?

@ridakaddir
Copy link

ridakaddir commented Sep 7, 2023

I have an index created using amplify cli in my Appsync schema model (dynamodb table)

when datastore tries to sync the delta using the lastSync value I get the error The table does not have the specified index but if I send the same query without the lastSync field the query works. all other queries without lastSync work

I have an index created using amplify cli in my Appsync schema model (dynamodb table)

when datastore tries to sync the delta using the lastSync value I get the error The table does not have the specified index
but if I send the same query without the lastSync field the query works

@Jordan-Nelson
Copy link
Member

when datastore tries to sync the delta using the lastSync value I get the error

@ridakaddir - Can you confirm this result is the exception you shared in the log above (IrRecoverableException{message=Empty response from AppSync)?

@ridakaddir
Copy link

ridakaddir commented Sep 7, 2023

when datastore tries to sync the delta using the lastSync value I get the error

@ridakaddir - Can you confirm this result is the exception you shared in the log above (IrRecoverableException{message=Empty response from AppSync)?

Yes, this happened only on the delta sync because the data I got from AppSync in null with errors.

The delta sync creates a query like

query SyncCollections(
    $filter: ModelCollectionsFilterInput, 
    $lastSync: AWSTimestamp, 
    $limit: Int) 
    {  
        syncCollections(filter: $filter, lastSync: $lastSync, limit: $limit) {    items {
               
            }
            nextToken
            startedAt  
        }
    }

this query sends the lastSync datetime saved in the local DB.

the response

{
  "data": {
    "syncCollections": null
  },
  "errors": [
    {
      "path": [
        "syncCollections"
      ],
      "data": null,
      "errorType": "DynamoDB:DynamoDbException",
      "errorInfo": null,
      "locations": [
        {
          "line": 2,
          "column": 3,
          "sourceName": null
        }
      ],
      "message": "The table does not have the specified index: indexName (Service: DynamoDb, Status Code: 400, Request ID: TT0J07TK989EGNPH3JVMC7RVVVVV4KQNSO5AEMVJF66Q9ASUAAJG)"
    }
  ]
}

if I send the same query again but with lastSync value set to null. the query works

@ridakaddir
Copy link

I am having the same problem described here aws-amplify/amplify-android#2564

after approximately 25 minutes the same query with the same lastSync value works.
is it an AppSync issue?

@ridakaddir
Copy link

@Jordan-Nelson
I found the root cause of my problem.
amplify cli didn't create an index in the delta table. creating the index manually solved the issue.

@Jordan-Nelson
Copy link
Member

@ridakaddir - Thanks for letting me know. If you are able to reproduce that, you can open an issue in https://github.com/aws-amplify/amplify-cli to figure out why that happened.

@Jordan-Nelson
Copy link
Member

@ridakaddir - Just to confirm, you are no longer seeing any issue during delta sync?

@ridakaddir
Copy link

@ridakaddir - Just to confirm, you are no longer seeing any issue during delta sync?

After manually creating the index for the delta table, the delta API returned the correct data, and the issue with the datastore error was resolved

@Jordan-Nelson
Copy link
Member

@wojciechzahradnikdeviniti - Are you able to capture the network request as mentioned here?

@wojciechzahradnikdeviniti
Copy link
Author

@Jordan-Nelson I'm not able to catch that

@wojciechzahradnikdeviniti
Copy link
Author

wojciechzahradnikdeviniti commented Sep 13, 2023

I caught the same error in Android Studio as @ridakaddir :

{
  "data": {
    "syncRegions": null
  },
  "errors": [
    {
      "path": [
        "syncRegions"
      ],
      "data": null,
      "errorType": "DynamoDB:DynamoDbException",
      "errorInfo": null,
      "locations": [
        {
          "line": 2,
          "column": 3,
          "sourceName": null
        }
      ],
      "message": "The table does not have the specified index: byClient (Service: DynamoDb, Status Code: 400, Request ID: ***********)"
    }
  ]
}

@Jordan-Nelson Jordan-Nelson added bug Something is not working; the issue has reproducible steps and has been reproduced requires-cli-fix Issues that require a CLI fix to resolve the root cause of issue. and removed pending-community-response Pending response from the issue opener or other community members labels Sep 13, 2023
@Jordan-Nelson
Copy link
Member

@wojciechzahradnikdeviniti - Thanks for providing that. I have marked this as a bug for now. Please follow aws-amplify/amplify-category-api#1853 for updates.

@Jordan-Nelson
Copy link
Member

@wojciechzahradnikdeviniti @ridakaddir - Would either of you being able to confirm that you do not see any issues with delta sync on iOS, even when running the app from Xcode? You may see additional logs when running from Xcode compared to from VSCode/Android studio or flutter run.

@wojciechzahradnikdeviniti
Copy link
Author

wojciechzahradnikdeviniti commented Sep 14, 2023

On iOS I have also problems with sync using DataStoreSyncExpression and model indexes. IMO this issue can be connected but I cannot see any logs in VSCode.

@wojciechzahradnikdeviniti
Copy link
Author

The only logs I get on iOS

Encoder Foundation.(unknown context at $1127e0838).__JSONEncoder
Encoder Foundation.(unknown context at $1127e0838).__JSONEncoder
Encoder Foundation.(unknown context at $1127e0838).__JSONEncoder
Encoder Foundation.(unknown context at $1127e0838).__JSONEncoder
Encoder Foundation.(unknown context at $1127e0838).__JSONEncoder
Encoder Foundation.(unknown context at $1127e0838).__JSONEncoder
Encoder Foundation.(unknown context at $1127e0838).__JSONEncoder
Encoder Foundation.(unknown context at $1127e0838).__JSONEncoder
Encoder Foundation.(unknown context at $1127e0838).__JSONEncoder
Encoder Foundation.(unknown context at $1127e0838).__JSONEncoder
Encoder Foundation.(unknown context at $1127e0838).__JSONEncoder
Encoder Foundation.(unknown context at $1127e0838).__JSONEncoder
Encoder Foundation.(unknown context at $1127e0838).__JSONEncoder
Encoder Foundation.(unknown context at $1127e0838).__JSONEncoder
Encoder Foundation.(unknown context at $1127e0838).__JSONEncoder
Encoder Foundation.(unknown context at $1127e0838).__JSONEncoder
Encoder Foundation.(unknown context at $1127e0838).__JSONEncoder
Encoder Foundation.(unknown context at $1127e0838).__JSONEncoder
Encoder Foundation.(unknown context at $1127e0838).__JSONEncoder
Encoder Foundation.(unknown context at $1127e0838).__JSONEncoder
Encoder Foundation.(unknown context at $1127e0838).__JSONEncoder
Encoder Foundation.(unknown context at $1127e0838).__JSONEncoder
Encoder Foundation.(unknown context at $1127e0838).__JSONEncoder
Encoder Foundation.(unknown context at $1127e0838).__JSONEncoder
2023-09-14 14:24:05.170240+0200 Runner[71880:19507610] [connection] nw_connection_add_timestamp_locked_on_nw_queue [C14] Hit maximum timestamp count, will start dropping events
Encoder Foundation.(unknown context at $1127e0838).__JSONEncoder
Encoder Foundation.(unknown context at $1127e0838).__JSONEncoder
Encoder Foundation.(unknown context at $1127e0838).__JSONEncoder
Encoder Foundation.(unknown context at $1127e0838).__JSONEncoder
Encoder Foundation.(unknown context at $1127e0838).__JSONEncoder
Encoder Foundation.(unknown context at $1127e0838).__JSONEncoder
2023-09-14 14:25:27.136676+0200 Runner[71880:19508128] [IncomingAsyncSubscriptionEventToAnyModelMapper] The operation couldn’t be completed. (Amplify.GraphQLResponseError<AWSPluginsCore.MutationSync<AWSPluginsCore.AnyModel>> error 0.)

@phani-srikar
Copy link

Please see the comment posted here for a workaround.

@Jordan-Nelson
Copy link
Member

Hello @wojciechzahradnikdeviniti - Closing this out as it looks like aws-amplify/amplify-category-api#1853 is resolved.

For anyone else facing this issue, please refer to aws-amplify/amplify-category-api#1853.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something is not working; the issue has reproducible steps and has been reproduced datastore Issues related to the DataStore Category requires-cli-fix Issues that require a CLI fix to resolve the root cause of issue.
Projects
None yet
Development

No branches or pull requests

4 participants