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

Failed to perform store operation #279

Closed
sandipgh19 opened this issue Jun 4, 2020 · 6 comments
Closed

Failed to perform store operation #279

sandipgh19 opened this issue Jun 4, 2020 · 6 comments
Assignees
Labels
bug Something isn't working closing-soon

Comments

@sandipgh19
Copy link

sandipgh19 commented Jun 4, 2020

Describe the bug
When store the data into local cache through appSyncClient, got the android.database.sqlite.SQLiteBlobTooBigException

Exception Details

02:59:57.351 E/AWSRepository(24976): com.apollographql.apollo.exception.ApolloException: Failed to perform store operation
02:59:57.351 E/AWSRepository(24976): at com.apollographql.apollo.cache.normalized.GraphQLStoreOperation.execute(GraphQLStoreOperation.java:67)
02:59:57.351 E/AWSRepository(24976): at com.example.AWSRepository$15.onResponse(AWSRepository.java:857) 
02:59:57.351 E/AWSRepository(24976): at com.apollographql.apollo.internal.RealAppSyncCall$1.onResponse(RealAppSyncCall.java:268) 02:59:57.351 E/AWSRepository(24976): at com.apollographql.apollo.internal.fetcher.CacheOnlyFetcher$CacheOnlyInterceptor$1.onFailure(CacheOnlyFetcher.java:47)
02:59:57.351 E/AWSRepository(24976): at com.apollographql.apollo.internal.interceptor.ApolloCacheInterceptor$1.run(ApolloCacheInterceptor.java:72) 
02:59:57.351 E/AWSRepository(24976): at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
02:59:57.351 E/AWSRepository(24976): at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
02:59:57.351 E/AWSRepository(24976): at java.lang.Thread.run(Thread.java:764) 
02:59:57.351 E/AWSRepository(24976): Caused by: android.database.sqlite.SQLiteBlobTooBigException: Row too big to fit into CursorWindow requiredPos=0, totalRows=1 
02:59:57.351 E/AWSRepository(24976): at android.database.sqlite.SQLiteConnection.nativeExecuteForCursorWindow(Native Method) 02:59:57.351 E/AWSRepository(24976): at android.database.sqlite.SQLiteConnection.executeForCursorWindow(SQLiteConnection.java:859) 02:59:57.351 E/AWSRepository(24976): at android.database.sqlite.SQLiteSession.executeForCursorWindow(SQLiteSession.java:836) 02:59:57.351 E/AWSRepository(24976): at android.database.sqlite.SQLiteQuery.fillWindow(SQLiteQuery.java:62) 
02:59:57.351 E/AWSRepository(24976): at android.database.sqlite.SQLiteCursor.fillWindow(SQLiteCursor.java:149) 
02:59:57.351 E/AWSRepository(24976): at android.database.sqlite.SQLiteCursor.getCount(SQLiteCursor.java:137) 
02:59:57.351 E/AWSRepository(24976): at android.database.AbstractCursor.moveToPosition(AbstractCursor.java:220)
02:59:57.351 E/AWSRepository(24976): at android.database.AbstractCursor.moveToFirst(AbstractCursor.java:259)
02:59:57.351 E/AWSRepository(24976): at com.apollographql.apollo.cache.normalized.sql.SqlNormalizedCache.selectRecordForKey(SqlNormalizedCache.java:208) 
02:59:57.351 E/AWSRepository(24976): at com.apollographql.apollo.cache.normalized.sql.SqlNormalizedCache.merge(SqlNormalizedCache.java:108) 
02:59:57.351 E/AWSRepository(24976): at com.apollographql.apollo.cache.normalized.OptimisticNormalizedCache$3.apply(OptimisticNormalizedCache.java:68) 
02:59:57.351 E/AWSRepository(24976): at com.apollographql.apollo.cache.normalized.OptimisticNormalizedCache$3.apply(OptimisticNormalizedCache.java:66) 
02:59:57.351 E/AWSRepository(24976): at com.apollographql.apollo.api.internal.Present.map(Present.java:70) 
02:59:57.351 E/AWSRepository(24976): at com.apollographql.apollo.cache.normalized.OptimisticNormalizedCache.merge(OptimisticNormalizedCache.java:66) 
02:59:57.351 E/AWSRepository(24976): at com.apollographql.apollo.cache.normalized.NormalizedCache.merge(NormalizedCache.java:88) 02:59:57.351 E/AWSRepository(24976): at com.apollographql.apollo.internal.cache.normalized.RealAppSyncStore$20.execute(RealAppSyncStore.java:436) 
02:59:57.351 E/AWSRepository(24976): at com.apollographql.apollo.internal.cache.normalized.RealAppSyncStore$20.execute(RealAppSyncStore.java:421) 
02:59:57.351 E/AWSRepository(24976): at com.apollographql.apollo.internal.cache.normalized.RealAppSyncStore.writeTransaction(RealAppSyncStore.java:178) 
02:59:57.351 E/AWSRepository(24976): at com.apollographql.apollo.internal.cache.normalized.RealAppSyncStore.doWrite(RealAppSyncStore.java:421) 
02:59:57.351 E/AWSRepository(24976): at com.apollographql.apollo.internal.cache.normalized.RealAppSyncStore.access$600(RealAppSyncStore.java:46) 
02:59:57.351 E/AWSRepository(24976): at com.apollographql.apollo.internal.cache.normalized.RealAppSyncStore$9.perform(RealAppSyncStore.java:250) 
02:59:57.351 E/AWSRepository(24976): at com.apollographql.apollo.internal.cache.normalized.RealAppSyncStore$9.perform(RealAppSyncStore.java:248)
02:59:57.351 E/AWSRepository(24976): at com.apollographql.apollo.cache.normalized.GraphQLStoreOperation.execute(GraphQLStoreOperation.java:65) 
02:59:57.351 E/AWSRepository(24976): ... 7 more

Environment(please complete the following information):

  • AppSync SDK Version: 2.10.1
@sandipgh19
Copy link
Author

is there any update?

@TrekSoft TrekSoft added AppSync bug Something isn't working labels Jun 16, 2020
@sandipgh19
Copy link
Author

any update?

@raphkim
Copy link
Contributor

raphkim commented Nov 11, 2020

Heya @sandipgh19 ,
Sorry for the delayed response. I will take a look at the issue for an update.

@raphkim
Copy link
Contributor

raphkim commented Nov 12, 2020

Hi @sandipgh19,
SQLite imposes a 2MB size limit on the cursor, which is causing this error. Would you be able to share the type of record that you are trying to store and its size?

@sandipgh19
Copy link
Author

Hi @raphkim,
In one data contains:

  1. String value 2. timestamp, 3. 1040 size of byte array. 4. json converted string. 5. 1040 size of int array.

@raphkim
Copy link
Contributor

raphkim commented Nov 13, 2020

Hey @sandipgh19 ,

I just released version 3.1.2, which contains a fix to prevent the crash. Would you be able to let us know if this fixed your problem? Thank you.

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
Projects
None yet
Development

No branches or pull requests

5 participants