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

DataStoreExeption can not sync added types #2471

Closed
1 task done
yegenpres opened this issue Jun 6, 2023 · 6 comments
Closed
1 task done

DataStoreExeption can not sync added types #2471

yegenpres opened this issue Jun 6, 2023 · 6 comments
Assignees
Labels
bug Something isn't working closing soon This issue will be closed in 7 days unless further comments are made. datastore DataStore category/plugins

Comments

@yegenpres
Copy link

yegenpres commented Jun 6, 2023

Before opening, please confirm:

Language and Async Model

Kotlin, Kotlin - Coroutines

Amplify Categories

DataStore

Gradle script dependencies

// Put output below this line
plugins {
    id("com.android.application")
    kotlin("android")
}

android {
    namespace = "com.app.danskassistent.android"
    compileSdk = 33
    defaultConfig {
        applicationId = "com.app.danskassistent.android"
        minSdk = 29
        targetSdk = 33
        versionCode = 1
        versionName = "1.0"
    }
    buildFeatures {
        compose = true
    }
    composeOptions {
        kotlinCompilerExtensionVersion = "1.4.4"
    }
    packagingOptions {
        resources {
            excludes += "/META-INF/{AL2.0,LGPL2.1}"
        }
    }
    buildTypes {
        getByName("release") {
            isMinifyEnabled = false
        }
    }
    compileOptions {
        sourceCompatibility = JavaVersion.VERSION_1_8
        targetCompatibility = JavaVersion.VERSION_1_8
    }
    kotlinOptions {
        jvmTarget = "1.8"
    }
}

dependencies {
    implementation(project(":shared"))
    implementation("androidx.compose.ui:ui:1.4.0")
    implementation("androidx.compose.ui:ui-tooling:1.4.0")
    implementation("androidx.compose.ui:ui-tooling-preview:1.4.0")
    implementation("androidx.compose.foundation:foundation:1.4.0")
    implementation("androidx.compose.material:material:1.4.0")
    implementation("androidx.activity:activity-compose:1.7.0")
    implementation("androidx.compose.material3:material3:1.1.0-beta01")
    implementation("androidx.compose.material:material-icons-core:1.4.0")
    implementation("androidx.compose.material:material-icons-extended:1.4.0")
    implementation("androidx.compose.material:material-ripple:1.4.0")
    implementation("androidx.compose.material3:material3-window-size-class:1.1.0-beta01")
    implementation("androidx.activity:activity-compose:1.6.1")
    implementation("com.amplifyframework:aws-api:2.8.5")
    implementation("com.amplifyframework:aws-auth-cognito:2.8.5")
    implementation("com.amplifyframework:aws-datastore:2.8.5")
    coreLibraryDesugaring("com.android.tools:desugar_jdk_libs:1.1.5")
    implementation("com.adeo:kviewmodel-compose:0.14")
    implementation("androidx.media3:media3-exoplayer:1.0.0-rc02")
    implementation("androidx.media3:media3-ui:1.0.0-rc02")

    implementation("com.revenuecat.purchases:purchases:6.1.1")
    implementation("com.appsflyer:af-android-sdk:6.9.0")

    testImplementation("androidx.test.ext:junit-ktx:1.1.5")
    testImplementation("junit:junit:4.12")
    testImplementation("androidx.test:core:1.5.0")
    testImplementation("org.mockito:mockito-core:5.2.0")
    testImplementation("org.mockito.kotlin:mockito-kotlin:4.1.0")
    testImplementation("io.mockk:mockk:1.13.4")
    testImplementation("org.jetbrains.kotlinx:kotlinx-coroutines-test:1.7.0-Beta")

    androidTestImplementation("androidx.test:runner:1.5.2")
    androidTestImplementation("androidx.test:rules:1.5.0")
    androidTestImplementation("org.jetbrains.kotlinx:kotlinx-coroutines-test:1.7.0-Beta")


    val nav_version = "2.5.3"
    implementation("androidx.navigation:navigation-compose:$nav_version")

    coreLibraryDesugaring("com.android.tools:desugar_jdk_libs:1.1.5")
}

Environment information

# Put output below this line
-----------------------------------------------------------
Gradle 8.0
------------------------------------------------------------

Build time:   2023-02-13 13:15:21 UTC
Revision:     62ab9b7c7f884426cf79fbedcf07658b2dbe9e97

Kotlin:       1.8.10
Groovy:       3.0.13
Ant:          Apache Ant(TM) version 1.10.11 compiled on July 10 2021
JVM:          20.0.1 (Eclipse Adoptium 20.0.1+9)
OS:           Mac OS X 13.3.1 aarch64


Please include any relevant guides or documentation you're referencing

No response

Describe the bug

Type Word works correctly like Queryes. Data store sync works correct.
But for other types which was added later I received next error in console.
Not only IrregularWord or IrregularSound types invoke to error, but any other type which I they to add.
So every type which I try to add to excited early types invoked the same error.

I tryed rebuild api, or update conflict detection (is is enable). Nothing can helps.
If I remove recently added types and leve only Word and Query it works correct

Reproduction steps (if applicable)

  1. amplify push
  2. amplify codegen models

Code Snippet

// Put your code below this line.
package com.app.danskassistent.android

import android.os.Bundle
import android.util.Log
import androidx.activity.ComponentActivity
import androidx.activity.compose.setContent
import androidx.compose.foundation.layout.fillMaxSize
import androidx.compose.material.*
import androidx.compose.runtime.Composable
import androidx.compose.ui.Modifier
import androidx.compose.ui.tooling.preview.Preview
import androidx.core.view.ViewCompat
import androidx.core.view.WindowInsetsCompat
import androidx.core.view.updatePadding
import com.adeo.kviewmodel.BuildConfig
import com.adeo.kviewmodel.KViewModel
import com.amplifyframework.AmplifyException
import com.amplifyframework.api.aws.AWSApiPlugin
import com.amplifyframework.auth.AuthChannelEventName
import com.amplifyframework.auth.cognito.AWSCognitoAuthPlugin
import com.amplifyframework.core.Amplify
import com.amplifyframework.core.AmplifyConfiguration
import com.amplifyframework.core.InitializationStatus
import com.amplifyframework.datastore.AWSDataStorePlugin
import com.amplifyframework.datastore.generated.model.Word
import com.amplifyframework.hub.HubChannel
import com.app.danskassistent.android.model.AWSWordsProvider
import com.app.danskassistent.android.purchases.Subscription
import com.app.danskassistent.di.DanskAssistentApp
import kotlinx.coroutines.CoroutineExceptionHandler

class MainActivity : ComponentActivity() {
    override fun onStart() {
        Amplify.DataStore.observe(Word::class.java,
            {
                Log.i("DataStoreEvent", "Observation began")
                Amplify.DataStore.start({
                                        Log.i("DataStoreEvent", "start() success")
                    DanskAssistentApp.reloadModels()
                }, {
                    Log.e("DataStoreEvent", "start() failed")

                })
                DanskAssistentApp.reloadModels()
            },
            {
                val post = it.item()
                Log.i("DataStoreEvent", "word: $post")
//                DanskAssistentApp.reloadModels()
            },
            { Log.e("DataStoreEvent", "Observation failed", it) },
            { Log.i("DataStoreEvent", "Observation complete") }
        )

        Amplify.Hub.subscribe(HubChannel.AUTH) { event ->
            when (event.name) {
                InitializationStatus.SUCCEEDED.toString() ->
                    Log.i("AuthQuickstart", "Auth successfully initialized")
                InitializationStatus.FAILED.toString() ->
                    Log.i("AuthQuickstart", "Auth failed to succeed")
                else -> when (AuthChannelEventName.valueOf(event.name)) {
                    AuthChannelEventName.SIGNED_IN -> {
                        Log.i("AuthQuickstart", "Auth just became signed in")
                        Amplify.DataStore.stop({}, {})
                        Amplify.DataStore.start({}, {})
                        DanskAssistentApp.reloadModels()
                    }
                    AuthChannelEventName.SIGNED_OUT -> {
                        Log.i("AuthQuickstart", "Auth just became signed out")
                        Amplify.DataStore.clear({
                            Log.i("AuthSignOutDataStoreClearned", "store cleared")
                            DanskAssistentApp.reloadModels()
                        }, {
                            Log.e("AuthSignOutDataStoreClearned", "store cleared id error $it")

                        })
                    }
                    AuthChannelEventName.SESSION_EXPIRED ->
                        Log.i("AuthQuickstart", "Auth session just expired")
                    AuthChannelEventName.USER_DELETED ->
                        Log.i("AuthQuickstart", "User has been deleted")
                    else ->
                        Log.w("AuthQuickstart", "Unhandled Auth Event: ${event.name}")
                }
            }
        }
        super.onStart()
    }

    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        KViewModel.setupSharedExceptionHandler(CoroutineExceptionHandler { _, throwable ->
            Log.e("KVVIEW model exeption: ", throwable.message ?: "")
        })

        configureAmplify(applicationContext)

        DanskAssistentApp.initApp(
            wordsRepo = AWSWordsProvider(),
            isDebug = BuildConfig.DEBUG,
            subscriptionService = Subscription(applicationContext)
        )

        Amplify.Auth.signInWithWebUI(
            this,
            {Log.i("AuthQuickStart", "Signin OK = $it") },
            { Log.e("AuthQuickStart", "Signin failed", it) }
        )

        setContent {
            MyApplicationTheme {
                Surface(
                    modifier = Modifier.fillMaxSize(),
                    color = MaterialTheme.colors.background
                ) {
                    App()
                }
            }
        }
        ViewCompat.setOnApplyWindowInsetsListener(findViewById(android.R.id.content)) { view, insets ->
            val bottom = insets.getInsets(WindowInsetsCompat.Type.ime()).bottom
            view.updatePadding(bottom = bottom)
            insets
        }
    }
}

fun configureAmplify(ctx: android.content.Context) {
    try {
        val config = AmplifyConfiguration.builder(ctx)
            .build()

        Amplify.addPlugin(AWSApiPlugin())
        Amplify.addPlugin(AWSCognitoAuthPlugin())
        Amplify.addPlugin(AWSDataStorePlugin())
        Amplify.configure(config, ctx)

        Log.i("Tutorial", "Initialized Amplify")
    } catch (error: AmplifyException) {
        Log.e("Tutorial", "Could not initialize Amplify", error)
    }
}

Log output

// Put your logs below this line
  W  Unauthorized failure:ON_UPDATE IrregularWord
2023-06-06 22:31:21.005 21427-21517 amplify:aws-datastore   com.app.danskassistent.android       W  Unauthorized failure:ON_DELETE IrregularSound
2023-06-06 22:31:21.113 21427-21517 amplify:aws-datastore   com.app.danskassistent.android       W  Unauthorized failure:ON_CREATE IrregularSound
2023-06-06 22:31:21.230 21427-21517 amplify:aws-datastore   com.app.danskassistent.android       W  Unauthorized failure:ON_UPDATE IrregularSound
2023-06-06 22:31:21.468 21427-21517 amplify:aws-datastore   com.app.danskassistent.android       W  Unauthorized failure:ON_DELETE IrregularWord
2023-06-06 22:31:21.567 21427-21517 amplify:aws-datastore   com.app.danskassistent.android       W  Unauthorized failure:ON_CREATE IrregularWord
2023-06-06 22:31:21.736 21427-21498 amplify:aws-datastore   com.app.danskassistent.android       I  Started subscription processor for models: [Word, IrregularSound, IrregularWord] of types [ON_CREATE, ON_UPDATE, ON_DELETE].
2023-06-06 22:31:21.855 21427-21495 amplify:aws-datastore   com.app.danskassistent.android       W  Initial cloud sync failed for IrregularWord.
                                                                                                    IrRecoverableException{message=Empty response from AppSync., cause=null, recoverySuggestion=Report to AWS team.}
                                                                                                    	at com.amplifyframework.datastore.syncengine.SyncProcessor.lambda$syncPage$14(SyncProcessor.java:315)
                                                                                                    	at com.amplifyframework.datastore.syncengine.SyncProcessor$$ExternalSyntheticLambda19.accept(Unknown Source:4)
                                                                                                    	at com.amplifyframework.datastore.appsync.AppSyncClient$$ExternalSyntheticLambda1.accept(Unknown Source:4)
                                                                                                    	at com.amplifyframework.api.aws.AppSyncGraphQLOperation$OkHttpCallback.onResponse(AppSyncGraphQLOperation.java:152)
                                                                                                    	at okhttp3.internal.connection.RealCall$AsyncCall.run(RealCall.kt:539)
                                                                                                    	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1137)
                                                                                                    	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:637)
                                                                                                    	at java.lang.Thread.run(Thread.java:1012)
2023-06-06 22:31:21.855 21427-21495 amplify:aws-datastore   com.app.danskassistent.android       E  Error encountered in the DataStore.
                                                                                                    DataStoreException{message=Initial cloud sync failed for IrregularWord., cause=IrRecoverableException{message=Empty response from AppSync., cause=null, recoverySuggestion=Report to AWS team.}, recoverySuggestion=Check your internet connection.}
                                                                                                    	at com.amplifyframework.datastore.syncengine.SyncProcessor.lambda$createHydrationTask$7$com-amplifyframework-datastore-syncengine-SyncProcessor(SyncProcessor.java:182)
                                                                                                    	at com.amplifyframework.datastore.syncengine.SyncProcessor$$ExternalSyntheticLambda9.accept(Unknown Source:6)
                                                                                                    	at io.reactivex.rxjava3.internal.operators.completable.CompletablePeek$CompletableObserverImplementation.onError(CompletablePeek.java:88)
                                                                                                    	at io.reactivex.rxjava3.internal.operators.single.SingleFlatMapCompletable$FlatMapCompletableObserver.onError(SingleFlatMapCompletable.java:97)
                                                                                                    	at io.reactivex.rxjava3.internal.operators.single.SingleFlatMap$SingleFlatMapCallback$FlatMapSingleObserver.onError(SingleFlatMap.java:117)
                                                                                                    	at io.reactivex.rxjava3.internal.operators.completable.CompletableToSingle$ToSingle.onError(CompletableToSingle.java:73)
                                                                                                    	at io.reactivex.rxjava3.internal.util.AtomicThrowable.tryTerminateConsumer(AtomicThrowable.java:156)
                                                                                                    	at io.reactivex.rxjava3.internal.operators.mixed.FlowableConcatMapCompletable$ConcatMapCompletableObserver.onError(FlowableConcatMapCompletable.java:129)
                                                                                                    	at io.reactivex.rxjava3.internal.util.AtomicThrowable.tryTerminateConsumer(AtomicThrowable.java:94)
                                                                                                    	at io.reactivex.rxjava3.internal.util.HalfSerializer.onError(HalfSerializer.java:67)
                                                                                                    	at io.reactivex.rxjava3.internal.operators.flowable.FlowableConcatMap$ConcatMapImmediate.onError(FlowableConcatMap.java:199)
                                                                                                    	at io.reactivex.rxjava3.internal.operators.flowable.FlowableObserveOn$ObserveOnSubscriber.runBackfused(FlowableObserveOn.java:449)
                                                                                                    	at io.reactivex.rxjava3.internal.operators.flowable.FlowableObserveOn$BaseObserveOnSubscriber.run(FlowableObserveOn.java:172)
                                                                                                    	at io.reactivex.rxjava3.internal.schedulers.ScheduledRunnable.run(ScheduledRunnable.java:65)
                                                                                                    	at io.reactivex.rxjava3.internal.schedulers.ScheduledRunnable.call(ScheduledRunnable.java:56)
                                                                                                    	at java.util.concurrent.FutureTask.run(FutureTask.java:264)
                                                                                                    	at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:307)
                                                                                                    	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1137)
                                                                                                    	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:637)
                                                                                                    	at java.lang.Thread.run(Thread.java:1012)
                                                                                                    Caused by: IrRecoverableException{message=Empty response from AppSync., cause=null, recoverySuggestion=Report to AWS team.}
                                                                                                    	at com.amplifyframework.datastore.syncengine.SyncProcessor.lambda$syncPage$14(SyncProcessor.java:315)
                                                                                                    	at com.amplifyframework.datastore.syncengine.SyncProcessor$$ExternalSyntheticLambda19.accept(Unknown Source:4)
                                                                                                    	at com.amplifyframework.datastore.appsync.AppSyncClient$$ExternalSyntheticLambda1.accept(Unknown Source:4)
                                                                                                    	at com.amplifyframework.api.aws.AppSyncGraphQLOperation$OkHttpCallback.onResponse(AppSyncGraphQLOperation.java:152)
                                                                                                    	at okhttp3.internal.connection.RealCall$AsyncCall.run(RealCall.kt:539)
                                                                                                    	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1137) 
                                                                                                    	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:637) 
                                                                                                    	at java.lang.Thread.run(Thread.java:1012) 
2023-06-06 22:31:21.856 21427-21498 amplify:aws-datastore   com.app.danskassistent.android       E  Failure encountered while attempting to start API sync.
                                                                                                    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 
                                                                                                    https://github.com/aws-amplify/amplify-android/issues to see if there are any existing issues that 
                                                                                                    match your scenario, and file an issue with the details of the bug if there isn't.}
                                                                                                    	at com.amplifyframework.datastore.syncengine.Orchestrator.lambda$startApiSync$4$com-amplifyframework-datastore-syncengine-Orchestrator(Orchestrator.java:337)
                                                                                                    	at com.amplifyframework.datastore.syncengine.Orchestrator$$ExternalSyntheticLambda8.subscribe(Unknown Source:2)
                                                                                                    	at io.reactivex.rxjava3.internal.operators.completable.CompletableCreate.subscribeActual(CompletableCreate.java:40)
                                                                                                    	at io.reactivex.rxjava3.core.Completable.subscribe(Completable.java:2850)
                                                                                                    	at io.reactivex.rxjava3.internal.operators.completable.CompletablePeek.subscribeActual(CompletablePeek.java:51)
                                                                                                    	at io.reactivex.rxjava3.core.Completable.subscribe(Completable.java:2850)
                                                                                                    	at io.reactivex.rxjava3.internal.operators.completable.CompletablePeek.subscribeActual(CompletablePeek.java:51)
                                                                                                    	at io.reactivex.rxjava3.core.Completable.subscribe(Completable.java:2850)
                                                                                                    	at io.reactivex.rxjava3.internal.operators.completable.CompletablePeek.subscribeActual(CompletablePeek.java:51)
                                                                                                    	at io.reactivex.rxjava3.core.Completable.subscribe(Completable.java:2850)
                                                                                                    	at io.reactivex.rxjava3.internal.operators.completable.CompletableSubscribeOn$SubscribeOnObserver.run(CompletableSubscribeOn.java:64)
                                                                                                    	at io.reactivex.rxjava3.core.Scheduler$DisposeTask.run(Scheduler.java:614)
                                                                                                    	at io.reactivex.rxjava3.internal.schedulers.ScheduledRunnable.run(ScheduledRunnable.java:65)
                                                                                                    	at io.reactivex.rxjava3.internal.schedulers.ScheduledRunnable.call(ScheduledRunnable.java:56)
                                                                                                    	at java.util.concurrent.FutureTask.run(FutureTask.java:264)
                                                                                                    	at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:307)
                                                                                                    	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1137)
                                                                                                    	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:637)
                                                                                                    	at java.lang.Thread.run(Thread.java:1012)
                                                                                                    Caused by: java.lang.RuntimeException: IrRecoverableException{message=Empty response from AppSync., cause=null, recoverySuggestion=Report to AWS team.}
                                                                                                    	at io.reactivex.rxjava3.internal.util.ExceptionHelper.wrapOrThrow(ExceptionHelper.java:46)
                                                                                                    	at io.reactivex.rxjava3.internal.observers.BlockingMultiObserver.blockingGet(BlockingMultiObserver.java:94)
                                                                                                    	at io.reactivex.rxjava3.core.Completable.blockingAwait(Completable.java:1461)
                                                                                                    	at com.amplifyframework.datastore.syncengine.Orchestrator.lambda$startApiSync$4$com-amplifyframework-datastore-syncengine-Orchestrator(Orchestrator.java:333)
                                                                                                    	at com.amplifyframework.datastore.syncengine.Orchestrator$$ExternalSyntheticLambda8.subscribe(Unknown Source:2) 
                                                                                                    	at io.reactivex.rxjava3.internal.operators.completable.CompletableCreate.subscribeActual(CompletableCreate.java:40) 
                                                                                                    	at io.reactivex.rxjava3.core.Completable.subscribe(Completable.java:2850) 
                                                                                                    	at io.reactivex.rxjava3.internal.operators.completable.CompletablePeek.subscribeActual(CompletablePeek.java:51) 
                                                                                                    	at io.reactivex.rxjava3.core.Completable.subscribe(Completable.java:2850) 
                                                                                                    	at io.reactivex.rxjava3.internal.operators.completable.CompletablePeek.subscribeActual(CompletablePeek.java:51) 
                                                                                                    	at io.reactivex.rxjava3.core.Completable.subscribe(Completable.java:2850) 
                                                                                                    	at io.reactivex.rxjava3.internal.operators.completable.CompletablePeek.subscribeActual(CompletablePeek.java:51) 
                                                                                                    	at io.reactivex.rxjava3.core.Completable.subscribe(Completable.java:2850) 
                                                                                                    	at io.reactivex.rxjava3.internal.operators.completable.CompletableSubscribeOn$SubscribeOnObserver.run(CompletableSubscribeOn.java:64) 
                                                                                                    	at io.reactivex.rxjava3.core.Scheduler$DisposeTask.run(Scheduler.java:614) 
                                                                                                    	at io.reactivex.rxjava3.internal.schedulers.ScheduledRunnable.run(ScheduledRunnable.java:65) 
                                                                                                    	at io.reactivex.rxjava3.internal.schedulers.ScheduledRunnable.call(ScheduledRunnable.java:56) 
                                                                                                    	at java.util.concurrent.FutureTask.run(FutureTask.java:264) 
                                                                                                    	at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:307) 
                                                                                                    	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1137) 
                                                                                                    	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:637) 
                                                                                                    	at java.lang.Thread.run(Thread.java:1012) 
                                                                                                    Caused by: IrRecoverableException{message=Empty response from AppSync., cause=null, recoverySuggestion=Report to AWS team.}
                                                                                                    	at com.amplifyframework.datastore.syncengine.SyncProcessor.lambda$syncPage$14(SyncProcessor.java:315)
                                                                                                    	at com.amplifyframework.datastore.syncengine.SyncProcessor$$ExternalSyntheticLambda19.accept(Unknown Source:4)
                                                                                                    	at com.amplifyframework.datastore.appsync.AppSyncClient$$ExternalSyntheticLambda1.accept(Unknown Source:4)
                                                                                                    	at com.amplifyframework.api.aws.AppSyncGraphQLOperation$OkHttpCallback.onResponse(AppSyncGraphQLOperation.java:152)
                                                                                                    	at okhttp3.internal.connection.RealCall$AsyncCall.run(RealCall.kt:539)
                                                                                                    	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1137) 
                                                                                                    	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:637) 
                                                                                                    	at java.lang.Thread.run(Thread.java:1012) 
2023-06-06 22:31:21.857 21427-21498 amplify:aws-datastore   com.app.danskassistent.android       W  API sync failed - transitioning to LOCAL_ONLY.
                                                                                                    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 
                                                                                                    https://github.com/aws-amplify/amplify-android/issues to see if there are any existing issues that 
                                                                                                    match your scenario, and file an issue with the details of the bug if there isn't.}
                                                                                                    	at com.amplifyframework.datastore.syncengine.Orchestrator.lambda$startApiSync$4$com-amplifyframework-datastore-syncengine-Orchestrator(Orchestrator.java:337)
                                                                                                    	at com.amplifyframework.datastore.syncengine.Orchestrator$$ExternalSyntheticLambda8.subscribe(Unknown Source:2)
                                                                                                    	at io.reactivex.rxjava3.internal.operators.completable.CompletableCreate.subscribeActual(CompletableCreate.java:40)
                                                                                                    	at io.reactivex.rxjava3.core.Completable.subscribe(Completable.java:2850)
                                                                                                    	at io.reactivex.rxjava3.internal.operators.completable.CompletablePeek.subscribeActual(CompletablePeek.java:51)
                                                                                                    	at io.reactivex.rxjava3.core.Completable.subscribe(Completable.java:2850)
                                                                                                    	at io.reactivex.rxjava3.internal.operators.completable.CompletablePeek.subscribeActual(CompletablePeek.java:51)
                                                                                                    	at io.reactivex.rxjava3.core.Completable.subscribe(Completable.java:2850)
                                                                                                    	at io.reactivex.rxjava3.internal.operators.completable.CompletablePeek.subscribeActual(CompletablePeek.java:51)
                                                                                                    	at io.reactivex.rxjava3.core.Completable.subscribe(Completable.java:2850)
                                                                                                    	at io.reactivex.rxjava3.internal.operators.completable.CompletableSubscribeOn$SubscribeOnObserver.run(CompletableSubscribeOn.java:64)
                                                                                                    	at io.reactivex.rxjava3.core.Scheduler$DisposeTask.run(Scheduler.java:614)
                                                                                                    	at io.reactivex.rxjava3.internal.schedulers.ScheduledRunnable.run(ScheduledRunnable.java:65)
                                                                                                    	at io.reactivex.rxjava3.internal.schedulers.ScheduledRunnable.call(ScheduledRunnable.java:56)
                                                                                                    	at java.util.concurrent.FutureTask.run(FutureTask.java:264)
                                                                                                    	at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:307)
                                                                                                    	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1137)
                                                                                                    	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:637)
                                                                                                    	at java.lang.Thread.run(Thread.java:1012)
                                                                                                    Caused by: java.lang.RuntimeException: IrRecoverableException{message=Empty response from AppSync., cause=null, recoverySuggestion=Report to AWS team.}
                                                                                                    	at io.reactivex.rxjava3.internal.util.ExceptionHelper.wrapOrThrow(ExceptionHelper.java:46)
                                                                                                    	at io.reactivex.rxjava3.internal.observers.BlockingMultiObserver.blockingGet(BlockingMultiObserver.java:94)
                                                                                                    	at io.reactivex.rxjava3.core.Completable.blockingAwait(Completable.java:1461)
                                                                                                    	at com.amplifyframework.datastore.syncengine.Orchestrator.lambda$startApiSync$4$com-amplifyframework-datastore-syncengine-Orchestrator(Orchestrator.java:333)
                                                                                                    	at com.amplifyframework.datastore.syncengine.Orchestrator$$ExternalSyntheticLambda8.subscribe(Unknown Source:2) 
                                                                                                    	at io.reactivex.rxjava3.internal.operators.completable.CompletableCreate.subscribeActual(CompletableCreate.java:40) 
                                                                                                    	at io.reactivex.rxjava3.core.Completable.subscribe(Completable.java:2850) 
                                                                                                    	at io.reactivex.rxjava3.internal.operators.completable.CompletablePeek.subscribeActual(CompletablePeek.java:51) 
                                                                                                    	at io.reactivex.rxjava3.core.Completable.subscribe(Completable.java:2850) 
                                                                                                    	at io.reactivex.rxjava3.internal.operators.completable.CompletablePeek.subscribeActual(CompletablePeek.java:51) 
                                                                                                    	at io.reactivex.rxjava3.core.Completable.subscribe(Completable.java:2850) 
                                                                                                    	at io.reactivex.rxjava3.internal.operators.completable.CompletablePeek.subscribeActual(CompletablePeek.java:51) 
                                                                                                    	at io.reactivex.rxjava3.core.Completable.subscribe(Completable.java:2850) 
                                                                                                    	at io.reactivex.rxjava3.internal.operators.completable.CompletableSubscribeOn$SubscribeOnObserver.run(CompletableSubscribeOn.java:64) 
                                                                                                    	at io.reactivex.rxjava3.core.Scheduler$DisposeTask.run(Scheduler.java:614) 
                                                                                                    	at io.reactivex.rxjava3.internal.schedulers.ScheduledRunnable.run(ScheduledRunnable.java:65) 
                                                                                                    	at io.reactivex.rxjava3.internal.schedulers.ScheduledRunnable.call(ScheduledRunnable.java:56) 
                                                                                                    	at java.util.concurrent.FutureTask.run(FutureTask.java:264) 
                                                                                                    	at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:307) 
                                                                                                    	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1137) 
                                                                                                    	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:637) 
                                                                                                    	at java.lang.Thread.run(Thread.java:1012) 
                                                                                                    Caused by: IrRecoverableException{message=Empty response from AppSync., cause=null, recoverySuggestion=Report to AWS team.}
                                                                                                    	at com.amplifyframework.datastore.syncengine.SyncProcessor.lambda$syncPage$14(SyncProcessor.java:315)
                                                                                                    	at com.amplifyframework.datastore.syncengine.SyncProcessor$$ExternalSyntheticLambda19.accept(Unknown Source:4)
                                                                                                    	at com.amplifyframework.datastore.appsync.AppSyncClient$$ExternalSyntheticLambda1.accept(Unknown Source:4)
                                                                                                    	at com.amplifyframework.api.aws.AppSyncGraphQLOperation$OkHttpCallback.onResponse(AppSyncGraphQLOperation.java:152)
                                                                                                    	at okhttp3.internal.connection.RealCall$AsyncCall.run(RealCall.kt:539)

amplifyconfiguration.json

{
"UserAgent": "aws-amplify-cli/2.0",
"Version": "1.0",
"api": {
"plugins": {
"awsAPIPlugin": {
"danskassistent": {
"endpointType": "GraphQL",
"endpoint": "https://xxxxx.appsync-api.eu-central-1.amazonaws.com/graphql",
"region": "eu-central-1",
"authorizationType": "AMAZON_COGNITO_USER_POOLS",
"apiKey": "xxxxx"
}
}
}
},
"auth": {
"plugins": {
"awsCognitoAuthPlugin": {
"UserAgent": "aws-amplify-cli/0.1.0",
"Version": "0.1.0",
"IdentityManager": {
"Default": {}
},
"AppSync": {
"Default": {
"ApiUrl": "https://xxxxx.appsync-api.eu-central-1.amazonaws.com/graphql",
"Region": "eu-central-1",
"AuthMode": "AMAZON_COGNITO_USER_POOLS",
"ClientDatabasePrefix": "danskassistent_AMAZON_COGNITO_USER_POOLS"
},
"danskassistent_API_KEY": {
"ApiUrl": "https://xxxxx.appsync-api.eu-central-1.amazonaws.com/graphql",
"Region": "eu-central-1",
"AuthMode": "API_KEY",
"ApiKey": "xxxxx",
"ClientDatabasePrefix": "danskassistent_API_KEY"
},
"danskassistent_AWS_IAM": {
"ApiUrl": "https://xxxxx.appsync-api.eu-central-1.amazonaws.com/graphql",
"Region": "eu-central-1",
"AuthMode": "AWS_IAM",
"ClientDatabasePrefix": "danskassistent_AWS_IAM"
}
},
"CredentialsProvider": {
"CognitoIdentity": {
"Default": {
"PoolId": "xxxxx",
"Region": "eu-central-1"
}
}
},
"CognitoUserPool": {
"Default": {
"PoolId": "xxxxx",
"AppClientId": "xxxxx",
"Region": "eu-central-1"
}
},
"Auth": {
"Default": {
"OAuth": {
"WebDomain": "xxxxx.auth.eu-central-1.amazoncognito.com",
"AppClientId": "xxxxx",
"SignInRedirectURI": "myapp://",
"SignOutRedirectURI": "myapp://",
"Scopes": [
"phone",
"email",
"openid",
"profile",
"aws.cognito.signin.user.admin"
]
},
"authenticationFlowType": "USER_SRP_AUTH",
"mfaConfiguration": "OFF",
"mfaTypes": [
"SMS"
],
"passwordProtectionSettings": {
"passwordPolicyMinLength": 8,
"passwordPolicyCharacters": []
},
"signupAttributes": [
"EMAIL"
],
"socialProviders": [
"GOOGLE",
"APPLE"
],
"usernameAttributes": [
"EMAIL"
],
"verificationMechanisms": [
"EMAIL"
]
}
}
}
}
}
}

GraphQL Schema

// Put your schema below this line
input AMPLIFY { globalAuthRule: AuthRule = { allow: public } } # FOR TESTING ONLY!

//added latter
type IrregularWord @model {
    id: ID!
    navnem: String!
    nutid: String!
    datid: String!
    fornutid: String!
    fordatid: String!
    bydem: String!
    boj: String!
    translateEng: String!
    translateUkr: String!
}

//added latter
type IrregularSound @model {
    id: ID!
    wordId: String!
    navnem: String!
    nutid: String!
    datid: String!
    fornutid: String!
    fordatid: String!
    bydem: String!
}

//added at first
type Word @model @auth(rules: [{allow: owner}]) {
    id: ID!
    soundPath: String!
    translate: String!
    wordDK: String!
    tag: String!
}

//added at first
type Query {
    makeWordSound(word: String): String @function(name: "makeWordSound-${env}")
    chatCPTQuery(text: String): String @function(name: "askGPT-${env}")
}

Additional information and screenshots

No response

@yegenpres
Copy link
Author

Error disappeared yesterday evening, I added 300 items to mew model. And it returned again, the same error.
I did non change anything in scheme or code.

The reason is not in auth, it works correct. In example it was just experiment.

@yegenpres
Copy link
Author

additional error, it is printed after first error:

amplify:aws-datastore com.app.danskassistent.android I Orchestrator transitioning from SYNC_VIA_API to LOCAL_ONLY
2023-06-07 18:34:43.012 8579-8661 amplify:aws-datastore com.app.danskassistent.android I Setting currentState to LOCAL_ONLY
2023-06-07 18:34:43.012 8579-8661 amplify:aws-datastore com.app.danskassistent.android I Stopping subscription processor.
2023-06-07 18:34:43.012 8579-8661 amplify:aws-datastore com.app.danskassistent.android I Stopped subscription processor.
2023-06-07 18:34:43.038 8579-8640 amplify:aws-datastore com.app.danskassistent.android I Orchestrator lock acquired.
2023-06-07 18:34:43.039 8579-8665 amplify:aws-datastore com.app.danskassistent.android I DataStore plugin initialized.
2023-06-07 18:34:43.039 8579-8665 amplify:aws-datastore com.app.danskassistent.android I Orchestrator transitioning from LOCAL_ONLY to SYNC_VIA_API
2023-06-07 18:34:43.039 8579-8665 amplify:aws-datastore com.app.danskassistent.android I Setting currentState to SYNC_VIA_API
2023-06-07 18:34:43.040 8579-8665 amplify:aws-datastore com.app.danskassistent.android I Orchestrator lock released.
2023-06-07 18:34:43.040 8579-8671 amplify:aws-datastore com.app.danskassistent.android I Starting API synchronization mode.
2023-06-07 18:34:43.041 8579-8671 amplify:aws-datastore com.app.danskassistent.android I Starting processing subscription events.
2023-06-07 18:35:43.065 8579-8671 amplify:aws-datastore com.app.danskassistent.android E Failure encountered while attempting to start API sync.
DataStoreException{message=DataStore subscriptionProcessor failed to start., cause=DataStoreException{message=Timed out waiting for subscription processor to start., cause=null, recoverySuggestion=Retry}, recoverySuggestion=Check your internet.}
at com.amplifyframework.datastore.syncengine.Orchestrator.lambda$startApiSync$4$com-amplifyframework-datastore-syncengine-Orchestrator(Orchestrator.java:319)
at com.amplifyframework.datastore.syncengine.Orchestrator$$ExternalSyntheticLambda8.subscribe(Unknown Source:2)
at io.reactivex.rxjava3.internal.operators.completable.CompletableCreate.subscribeActual(CompletableCreate.java:40)
at io.reactivex.rxjava3.core.Completable.subscribe(Completable.java:2850)
at io.reactivex.rxjava3.internal.operators.completable.CompletablePeek.subscribeActual(CompletablePeek.java:51)
at io.reactivex.rxjava3.core.Completable.subscribe(Completable.java:2850)
at io.reactivex.rxjava3.internal.operators.completable.CompletablePeek.subscribeActual(CompletablePeek.java:51)
at io.reactivex.rxjava3.core.Completable.subscribe(Completable.java:2850)
at io.reactivex.rxjava3.internal.operators.completable.CompletablePeek.subscribeActual(CompletablePeek.java:51)
at io.reactivex.rxjava3.core.Completable.subscribe(Completable.java:2850)
at io.reactivex.rxjava3.internal.operators.completable.CompletableSubscribeOn$SubscribeOnObserver.run(CompletableSubscribeOn.java:64)
at io.reactivex.rxjava3.core.Scheduler$DisposeTask.run(Scheduler.java:614)
at io.reactivex.rxjava3.internal.schedulers.ScheduledRunnable.run(ScheduledRunnable.java:65)
at io.reactivex.rxjava3.internal.schedulers.ScheduledRunnable.call(ScheduledRunnable.java:56)
at java.util.concurrent.FutureTask.run(FutureTask.java:264)
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:307)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1137)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:637)
at java.lang.Thread.run(Thread.java:1012)
Caused by: DataStoreException{message=Timed out waiting for subscription processor to start., cause=null, recoverySuggestion=Retry}
at com.amplifyframework.datastore.syncengine.SubscriptionProcessor.startSubscriptions(SubscriptionProcessor.java:162)
at com.amplifyframework.datastore.syncengine.Orchestrator.lambda$startApiSync$4$com-amplifyframework-datastore-syncengine-Orchestrator(Orchestrator.java:317)
at com.amplifyframework.datastore.syncengine.Orchestrator$$ExternalSyntheticLambda8.subscribe(Unknown Source:2) 
at io.reactivex.rxjava3.internal.operators.completable.CompletableCreate.subscribeActual(CompletableCreate.java:40) 
at io.reactivex.rxjava3.core.Completable.subscribe(Completable.java:2850) 
at io.reactivex.rxjava3.internal.operators.completable.CompletablePeek.subscribeActual(CompletablePeek.java:51) 
at io.reactivex.rxjava3.core.Completable.subscribe(Completable.java:2850) 
at io.reactivex.rxjava3.internal.operators.completable.CompletablePeek.subscribeActual(CompletablePeek.java:51) 
at io.reactivex.rxjava3.core.Completable.subscribe(Completable.java:2850) 
at io.reactivex.rxjava3.internal.operators.completable.CompletablePeek.subscribeActual(CompletablePeek.java:51) 
at io.reactivex.rxjava3.core.Completable.subscribe(Completable.java:2850) 
at io.reactivex.rxjava3.internal.operators.completable.CompletableSubscribeOn$SubscribeOnObserver.run(CompletableSubscribeOn.java:64) 
at io.reactivex.rxjava3.core.Scheduler$DisposeTask.run(Scheduler.java:614) 
at io.reactivex.rxjava3.internal.schedulers.ScheduledRunnable.run(ScheduledRunnable.java:65) 
at io.reactivex.rxjava3.internal.schedulers.ScheduledRunnable.call(ScheduledRunnable.java:56) 
at java.util.concurrent.FutureTask.run(FutureTask.java:264) 
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:307) 
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1137) 
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:637) 
at java.lang.Thread.run(Thread.java:1012) 
2023-06-07 18:35:43.065 8579-8671 amplify:aws-datastore com.app.danskassistent.android W API sync failed - transitioning to LOCAL_ONLY.
DataStoreException{message=DataStore subscriptionProcessor failed to start., cause=DataStoreException{message=Timed out waiting for subscription processor to start., cause=null, recoverySuggestion=Retry}, recoverySuggestion=Check your internet.}
at com.amplifyframework.datastore.syncengine.Orchestrator.lambda$startApiSync$4$com-amplifyframework-datastore-syncengine-Orchestrator(Orchestrator.java:319)
at com.amplifyframework.datastore.syncengine.Orchestrator$$ExternalSyntheticLambda8.subscribe(Unknown Source:2)
at io.reactivex.rxjava3.internal.operators.completable.CompletableCreate.subscribeActual(CompletableCreate.java:40)
at io.reactivex.rxjava3.core.Completable.subscribe(Completable.java:2850)
at io.reactivex.rxjava3.internal.operators.completable.CompletablePeek.subscribeActual(CompletablePeek.java:51)
at io.reactivex.rxjava3.core.Completable.subscribe(Completable.java:2850)
at io.reactivex.rxjava3.internal.operators.completable.CompletablePeek.subscribeActual(CompletablePeek.java:51)
at io.reactivex.rxjava3.core.Completable.subscribe(Completable.java:2850)
at io.reactivex.rxjava3.internal.operators.completable.CompletablePeek.subscribeActual(CompletablePeek.java:51)
at io.reactivex.rxjava3.core.Completable.subscribe(Completable.java:2850)
at io.reactivex.rxjava3.internal.operators.completable.CompletableSubscribeOn$SubscribeOnObserver.run(CompletableSubscribeOn.java:64)
at io.reactivex.rxjava3.core.Scheduler$DisposeTask.run(Scheduler.java:614)
at io.reactivex.rxjava3.internal.schedulers.ScheduledRunnable.run(ScheduledRunnable.java:65)
at io.reactivex.rxjava3.internal.schedulers.ScheduledRunnable.call(ScheduledRunnable.java:56)
at java.util.concurrent.FutureTask.run(FutureTask.java:264)
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:307)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1137)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:637)
at java.lang.Thread.run(Thread.java:1012)
Caused by: DataStoreException{message=Timed out waiting for subscription processor to start., cause=null, recoverySuggestion=Retry}
at com.amplifyframework.datastore.syncengine.SubscriptionProcessor.startSubscriptions(SubscriptionProcessor.java:162)
at com.amplifyframework.datastore.syncengine.Orchestrator.lambda$startApiSync$4$com-amplifyframework-datastore-syncengine-Orchestrator(Orchestrator.java:317)
at com.amplifyframework.datastore.syncengine.Orchestrator$$ExternalSyntheticLambda8.subscribe(Unknown Source:2) 
at io.reactivex.rxjava3.internal.operators.completable.CompletableCreate.subscribeActual(CompletableCreate.java:40) 
at io.reactivex.rxjava3.core.Completable.subscribe(Completable.java:2850) 
at io.reactivex.rxjava3.internal.operators.completable.CompletablePeek.subscribeActual(CompletablePeek.java:51) 
at io.reactivex.rxjava3.core.Completable.subscribe(Completable.java:2850) 
at io.reactivex.rxjava3.internal.operators.completable.CompletablePeek.subscribeActual(CompletablePeek.java:51) 
at io.reactivex.rxjava3.core.Completable.subscribe(Completable.java:2850) 
at io.reactivex.rxjava3.internal.operators.completable.CompletablePeek.subscribeActual(CompletablePeek.java:51) 
at io.reactivex.rxjava3.core.Completable.subscribe(Completable.java:2850) 
at io.reactivex.rxjava3.internal.operators.completable.CompletableSubscribeOn$SubscribeOnObserver.run(CompletableSubscribeOn.java:64) 
at io.reactivex.rxjava3.core.Scheduler$DisposeTask.run(Scheduler.java:614) 
at io.reactivex.rxjava3.internal.schedulers.ScheduledRunnable.run(ScheduledRunnable.java:65) 
at io.reactivex.rxjava3.internal.schedulers.ScheduledRunnable.call(ScheduledRunnable.java:56) 
at java.util.concurrent.FutureTask.run(FutureTask.java:264) 
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:307) 
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1137) 
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:637) 
at java.lang.Thread.run(Thread.java:1012) 
2023-06-07 18:35:43.071 8579-8671 amplify:aws-datastore com.app.danskassistent.android I Orchestrator transitioning from SYNC_VIA_API to LOCAL_ONLY
2023-06-07 18:35:43.074 8579-8671 amplify:aws-datastore com.app.danskassistent.android I Setting currentState to LOCAL_ONLY
2023-06-07 18:35:43.074 8579-8671 amplify:aws-datastore com.app.danskassistent.android I Stopping subscription processor.
2023-06-07 18:35:43.076 8579-8671 amplify:aws-datastore com.app.danskassistent.android I Stopped subscription processor.

@sdhuka sdhuka added datastore DataStore category/plugins bug Something isn't working labels Jun 8, 2023
@wojciechzahradnikdeviniti

Hi, any updates on this issue? I have the same problem.

W/amplify:aws-datastore(24053): Initial cloud sync failed for FlowTemplate.
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 FlowTemplate., 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)

@wojciechzahradnikdeviniti

any updates?

@tylerjroach
Copy link
Member

I'm sorry for the delays on this ticket.

Looking at the initial code snippet, I'd like to suggest at least a few changes so that we can rule them out.

Amplify.configure should be placed in the application's onCreate and not in the Activity. Amplify can only be configured once, so any configuration change could cause an issue.

Next, there are at least some models like Word that may require authentication as I see in the schema. While signIn is being called in onCreate, there is no wait for calling Amplify.DataStore.observe(Word::class.java.

@sktimalsina sktimalsina added the closing soon This issue will be closed in 7 days unless further comments are made. label Feb 8, 2024
Copy link
Contributor

This issue is now closed. Comments on closed issues are hard for our team to see.
If you need more assistance, please open a new issue that references this one.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working closing soon This issue will be closed in 7 days unless further comments are made. datastore DataStore category/plugins
Projects
None yet
Development

No branches or pull requests

5 participants