-
Notifications
You must be signed in to change notification settings - Fork 640
Closed
Description
Version Information
- Firebase Component: Firestore
- Component version: 18.2.0
- Affected Android Versions: 4.2.2, 5.1.1
Description
It happens rarely and this is the stack trace from crashlytics:
Fatal Exception: java.lang.RuntimeException: Internal error in Firestore (18.2.0).
at com.google.firebase.firestore.util.AsyncQueue.lambda$panic$5(com.google.firebase:firebase-firestore@@18.2.0:379)
at com.google.firebase.firestore.util.AsyncQueue$$Lambda$5.run(com.google.firebase:firebase-firestore@@18.2.0)
at android.os.Handler.handleCallback(Handler.java:739)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:135)
at android.app.ActivityThread.main(ActivityThread.java:5254)
at java.lang.reflect.Method.invoke(Method.java)
at java.lang.reflect.Method.invoke(Method.java:372)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:902)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:697)
Caused by android.database.CursorWindowAllocationException: Cursor window allocation of 2048 kb failed.
at android.database.CursorWindow.<init>(CursorWindow.java:108)
at android.database.AbstractWindowedCursor.clearOrCreateWindow(AbstractWindowedCursor.java:198)
at android.database.sqlite.SQLiteCursor.fillWindow(SQLiteCursor.java:139)
at android.database.sqlite.SQLiteCursor.getCount(SQLiteCursor.java:133)
at android.database.AbstractCursor.moveToPosition(AbstractCursor.java:197)
at android.database.AbstractCursor.moveToNext(AbstractCursor.java:245)
at com.google.firebase.firestore.local.SQLitePersistence$Query.forEach(com.google.firebase:firebase-firestore@@18.2.0:430)
at com.google.firebase.firestore.local.SQLiteRemoteDocumentCache.getAll(com.google.firebase:firebase-firestore@@18.2.0:98)
at com.google.firebase.firestore.local.LocalStore.lambda$applyRemoteEvent$5(com.google.firebase:firebase-firestore@@18.2.0:385)
at com.google.firebase.firestore.local.LocalStore$$Lambda$6.get(com.google.firebase:firebase-firestore@@18.2.0)
at com.google.firebase.firestore.local.SQLitePersistence.runTransaction(com.google.firebase:firebase-firestore@@18.2.0:195)
at com.google.firebase.firestore.local.LocalStore.applyRemoteEvent(com.google.firebase:firebase-firestore@@18.2.0:328)
at com.google.firebase.firestore.core.SyncEngine.handleRemoteEvent(com.google.firebase:firebase-firestore@@18.2.0:327)
at com.google.firebase.firestore.core.FirestoreClient.handleRemoteEvent(com.google.firebase:firebase-firestore@@18.2.0:260)
at com.google.firebase.firestore.remote.RemoteStore.raiseWatchSnapshot(com.google.firebase:firebase-firestore@@18.2.0:545)
at com.google.firebase.firestore.remote.RemoteStore.handleWatchChange(com.google.firebase:firebase-firestore@@18.2.0:454)
at com.google.firebase.firestore.remote.RemoteStore.access$100(com.google.firebase:firebase-firestore@@18.2.0:53)
at com.google.firebase.firestore.remote.RemoteStore$1.onWatchChange(com.google.firebase:firebase-firestore@@18.2.0:176)
at com.google.firebase.firestore.remote.WatchStream.onNext(com.google.firebase:firebase-firestore@@18.2.0:109)
at com.google.firebase.firestore.remote.WatchStream.onNext(com.google.firebase:firebase-firestore@@18.2.0:39)
at com.google.firebase.firestore.remote.AbstractStream$StreamObserver.lambda$onNext$1(com.google.firebase:firebase-firestore@@18.2.0:119)
at com.google.firebase.firestore.remote.AbstractStream$StreamObserver$$Lambda$2.run(com.google.firebase:firebase-firestore@@18.2.0)
at com.google.firebase.firestore.remote.AbstractStream$CloseGuardedRunner.run(com.google.firebase:firebase-firestore@@18.2.0:67)
at com.google.firebase.firestore.remote.AbstractStream$StreamObserver.onNext(com.google.firebase:firebase-firestore@@18.2.0:110)
at com.google.firebase.firestore.util.FirestoreChannel$1.onMessage(com.google.firebase:firebase-firestore@@18.2.0:150)
at io.grpc.ForwardingClientCallListener.onMessage(ForwardingClientCallListener.java:33)
at io.grpc.ForwardingClientCallListener.onMessage(ForwardingClientCallListener.java:33)
at io.grpc.internal.ClientCallImpl$ClientStreamListenerImpl$1MessagesAvailable.runInContext(ClientCallImpl.java:519)
at io.grpc.internal.ContextRunnable.run(ContextRunnable.java:37)
at io.grpc.internal.SerializingExecutor.run(SerializingExecutor.java:123)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:422)
at java.util.concurrent.FutureTask.run(FutureTask.java:237)
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:152)
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:265)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1112)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:587)
at com.google.firebase.firestore.util.AsyncQueue$DelayedStartFactory.run(com.google.firebase:firebase-firestore@@18.2.0:205)
at java.lang.Thread.run(Thread.java:818)
Steps to reproduce:
It's caused during fetching from firestore. As this thread says: https://stackoverflow.com/questions/11340257/sqlite-android-database-cursor-window-allocation-of-2048-kb-failed
it may be caused due Cursor leak in the code.