woocommerce-android icon indicating copy to clipboard operation
woocommerce-android copied to clipboard

Crash on opening the app (Row too big to fit into CursorWindow requiredPos=0, totalRows=1)

Open thabotswana opened this issue 2 years ago • 3 comments

A user reported that the WooAndroid app crashes when they open it. They say it works fine on a colleague's device.

Reported in 5334399-zen.

Sentry reports found here.

Troubleshooting carried out

  • User cleared app storage and cache
  • They tried uninstalling the app and reinstalling it
  • Out of 256GB available on their phone, 37% (94GB) is used.

User has provided 3 screen recordings in the ticket.

Mobile Environment

  • Device: OnePlus 7T
  • Android version: 11
  • WooCommerce Android version: 9.4

thabotswana avatar Jun 29 '22 08:06 thabotswana

Issue with fetchProductLeaderboards in StatsRepository as per Sentry:

android.database.sqlite.SQLiteBlobTooBigException: Row too big to fit into CursorWindow requiredPos=0, totalRows=1
    at android.database.sqlite.SQLiteConnection.nativeExecuteForCursorWindow(SQLiteConnection.java)
    at android.database.sqlite.SQLiteConnection.executeForCursorWindow(SQLiteConnection.java:1001)
    at android.database.sqlite.SQLiteSession.executeForCursorWindow(SQLiteSession.java:838)
    at android.database.sqlite.SQLiteQuery.fillWindow(SQLiteQuery.java:62)
    at android.database.sqlite.SQLiteCursor.fillWindow(SQLiteCursor.java:153)
    at android.database.sqlite.SQLiteCursor.getCount(SQLiteCursor.java:140)
    at android.database.AbstractCursor.moveToPosition(AbstractCursor.java:231)
    at android.database.AbstractCursor.moveToNext(AbstractCursor.java:280)
    at com.yarolegovich.wellsql.SelectQuery.getAsModel(SelectQuery.java:158)
    at com.yarolegovich.wellsql.SelectQuery.getAsModel(SelectQuery.java:151)
    at org.wordpress.android.fluxc.persistence.WCLeaderboardsSqlUtils.getCurrentLeaderboards(WCLeaderboardsSqlUtils.kt:24)
    at org.wordpress.android.fluxc.store.WCLeaderboardsStore.fetchCachedProductLeaderboards(WCLeaderboardsStore.kt:55)
    at com.woocommerce.android.ui.mystore.data.StatsRepository$fetchProductLeaderboards$2.invokeSuspend(StatsRepository.kt:83)
    at com.woocommerce.android.ui.mystore.data.StatsRepository$fetchProductLeaderboards$2.invoke
    at com.woocommerce.android.ui.mystore.data.StatsRepository$fetchProductLeaderboards$2.invoke
    at kotlinx.coroutines.flow.SafeFlow.collectSafely(Builders.kt:61)
    at kotlinx.coroutines.flow.AbstractFlow.collect(Flow.kt:230)
    at com.woocommerce.android.ui.mystore.domain.GetTopPerformers$invoke$$inlined$transform$1.invokeSuspend(Emitters.kt:40)
    at com.woocommerce.android.ui.mystore.domain.GetTopPerformers$invoke$$inlined$transform$1.invoke
    at com.woocommerce.android.ui.mystore.domain.GetTopPerformers$invoke$$inlined$transform$1.invoke
    at kotlinx.coroutines.flow.SafeFlow.collectSafely(Builders.kt:61)
    at kotlinx.coroutines.flow.AbstractFlow.collect(Flow.kt:230)
    at kotlinx.coroutines.flow.internal.ChannelFlowOperatorImpl.flowCollect(ChannelFlow.kt:195)
    at kotlinx.coroutines.flow.internal.ChannelFlowOperator.collectTo$suspendImpl(ChannelFlow.kt:157)
    at kotlinx.coroutines.flow.internal.ChannelFlowOperator.collectTo
    at kotlinx.coroutines.flow.internal.ChannelFlow$collectToFun$1.invokeSuspend(ChannelFlow.kt:60)
    at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
    at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:106)
    at kotlinx.coroutines.scheduling.CoroutineScheduler.runSafely(CoroutineScheduler.kt:570)
    at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.executeTask(CoroutineScheduler.kt:749)
    at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.runWorker(CoroutineScheduler.kt:677)
    at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.run(CoroutineScheduler.kt:664)

hafizrahman avatar Jul 04 '22 10:07 hafizrahman

As per @wzieba's suggestion, would be good to look at WCTopPerformerProductModel and see if we can trim the returned API response before saving to the database, similar to StripOrder in FluxC.

hafizrahman avatar Jul 04 '22 10:07 hafizrahman

Internal discussion link: p91TBi-9rM-p2#comment-10852

erricgunawan avatar Jul 12 '22 04:07 erricgunawan