firebase / firebase-android-sdk

Firebase Android SDK
https://firebase.google.com
Apache License 2.0
2.26k stars 572 forks source link

SQLiteEventStore.runCriticalSection : java.lang.IllegalStateException - attempt to re-open an already-closed object: SQLiteDatabase #6010

Closed lklong1551019 closed 3 months ago

lklong1551019 commented 3 months ago

[READ] Step 1: Are you in the right place?

Issues filed here should be about bugs in the code in this repository. If you have a general question, need help debugging, or fall into some other category use one of these other channels:

[REQUIRED] Step 2: Describe your environment

[REQUIRED] Step 3: Describe the problem

Steps to reproduce:

After updating firebase bom from 31.2.3 to 32.8.0, for the past few days we have been experiencing random crashes (~ 7 crashes per day on avg) on a variety of devices, across every android version (58% android 13), with 95% events happened while in background. It happened on app start, eg, the first 5 seconds.

We cannot reproduce this. Here is an example stack trace:

 Fatal Exception: java.lang.IllegalStateException: attempt to re-open an already-closed object: SQLiteDatabase: /data/user/0/our-package-name/databases/com.google.android.datatransport.events
       at android.database.sqlite.SQLiteClosable.acquireReference(SQLiteClosable.java:58)
       at android.database.sqlite.SQLiteDatabase.endTransaction(SQLiteDatabase.java:587)
       at com.google.android.datatransport.runtime.scheduling.persistence.SQLiteEventStore.runCriticalSection(SQLiteEventStore.java:772)
       at com.google.android.datatransport.runtime.scheduling.jobscheduling.Uploader.logAndUpdateState(Uploader.java:164)
       at com.google.android.datatransport.runtime.ForcedSender.sendBlocking(ForcedSender.java:36)
       at com.google.firebase.crashlytics.internal.send.ReportQueue.lambda$flushScheduledReportsIfAble$0(ReportQueue.java:138)
       at java.lang.Thread.run(Thread.java:1012)
image image

Is there anything we could do? Any insight would be appreciated.

google-oss-bot commented 3 months ago

I couldn't figure out how to label this issue, so I've labeled it for a human to triage. Hang tight.

lehcar09 commented 3 months ago

Hi @lklong1551019, thank you for reporting the issue. This issue seems related to the issue #6001 you reported. I have raised this issue to our engineers and are already taking a look. Please hang tight!

lklong1551019 commented 3 months ago

thank you, glad to hear that. I'm looking forward to hearing updates, cheers.

lehcar09 commented 3 months ago

I'll be closing this thread now. To streamline the updates from our engineer, moving forward, you can check on the issue #6001. Thanks!