-
Notifications
You must be signed in to change notification settings - Fork 368
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
Crash SQLiteDatabaseCorruptException from OneSignalDbHelper #1432
Comments
Anyone? |
2 months passed without any feedback... |
We (Audiomack) are also experiencing this crash, and the number is growing by the day with the new user acquisition. However, this crash will undoubtedly have an impact on the performance of our application. Please address this crash as soon as possible so that we can release a new version that does not contain such a crash. onesignalVersion = "4.6.3" OneSignalDbHelper.java line 150 (com.onesignal.OneSignalDbHelper.getSQLiteDatabase) Fatal Exception: android.database.sqlite.SQLiteCantOpenDatabaseException: unknown error (code 14): Could not open database
at android.database.sqlite.SQLiteConnection.nativeOpen(SQLiteConnection.java)
at android.database.sqlite.SQLiteConnection.open(SQLiteConnection.java:210)
at android.database.sqlite.SQLiteConnection.open(SQLiteConnection.java:194)
at android.database.sqlite.SQLiteConnectionPool.openConnectionLocked(SQLiteConnectionPool.java:493)
at android.database.sqlite.SQLiteConnectionPool.open(SQLiteConnectionPool.java:200)
at android.database.sqlite.SQLiteConnectionPool.open(SQLiteConnectionPool.java:192)
at android.database.sqlite.SQLiteDatabase.openInner(SQLiteDatabase.java:864)
at android.database.sqlite.SQLiteDatabase.open(SQLiteDatabase.java:849)
at android.database.sqlite.SQLiteDatabase.openDatabase(SQLiteDatabase.java:724)
at android.database.sqlite.SQLiteDatabase.openDatabase(SQLiteDatabase.java:714)
at android.database.sqlite.SQLiteOpenHelper.getDatabaseLocked(SQLiteOpenHelper.java:295)
at android.database.sqlite.SQLiteOpenHelper.getWritableDatabase(SQLiteOpenHelper.java:238)
at com.onesignal.OneSignalDbHelper.getSQLiteDatabase(OneSignalDbHelper.java:150)
at com.onesignal.OneSignalDbHelper.getSQLiteDatabaseWithRetries(OneSignalDbHelper.java:174)
at com.onesignal.OneSignalDbHelper.delete(OneSignalDbHelper.java:289)
at com.onesignal.OSNotificationDataController$1.run(OSNotificationDataController.java:57)
at java.lang.Thread.run(Thread.java:764) |
same crash Fatal Exception: android.database.sqlite.SQLiteCantOpenDatabaseException: Cannot open database '/data/user/0/com.interfocusllc.patpat/databases/OneSignal.db': File /data/user/0/com.interfocusllc.patpat/databases/OneSignal.db doesn't exist
at android.database.sqlite.SQLiteConnection.open(SQLiteConnection.java:252)
at android.database.sqlite.SQLiteConnection.open(SQLiteConnection.java:205)
at android.database.sqlite.SQLiteConnectionPool.openConnectionLocked(SQLiteConnectionPool.java:505)
at android.database.sqlite.SQLiteConnectionPool.open(SQLiteConnectionPool.java:206)
at android.database.sqlite.SQLiteConnectionPool.open(SQLiteConnectionPool.java:198)
at android.database.sqlite.SQLiteDatabase.openInner(SQLiteDatabase.java:918)
at android.database.sqlite.SQLiteDatabase.open(SQLiteDatabase.java:898)
at android.database.sqlite.SQLiteDatabase.openDatabase(SQLiteDatabase.java:762)
at android.database.sqlite.SQLiteDatabase.openDatabase(SQLiteDatabase.java:751)
at android.database.sqlite.SQLiteOpenHelper.getDatabaseLocked(SQLiteOpenHelper.java:373)
at android.database.sqlite.SQLiteOpenHelper.getWritableDatabase(SQLiteOpenHelper.java:316)
at com.onesignal.OneSignalDbHelper.getSQLiteDatabase(OneSignalDbHelper.java:150)
at com.onesignal.OneSignalDbHelper.getSQLiteDatabaseWithRetries(OneSignalDbHelper.java:174)
at com.onesignal.OneSignalDbHelper.delete(OneSignalDbHelper.java:289)
at com.onesignal.OSNotificationDataController$1.run(OSNotificationDataController.java:57)
at java.lang.Thread.run(Thread.java:923) Caused by android.database.sqlite.SQLiteCantOpenDatabaseException: unknown error (code 14 SQLITE_CANTOPEN): Could not open database
at android.database.sqlite.SQLiteConnection.nativeOpen(SQLiteConnection.java)
at android.database.sqlite.SQLiteConnection.open(SQLiteConnection.java:224)
at android.database.sqlite.SQLiteConnection.open(SQLiteConnection.java:205)
at android.database.sqlite.SQLiteConnectionPool.openConnectionLocked(SQLiteConnectionPool.java:505)
at android.database.sqlite.SQLiteConnectionPool.open(SQLiteConnectionPool.java:206)
at android.database.sqlite.SQLiteConnectionPool.open(SQLiteConnectionPool.java:198)
at android.database.sqlite.SQLiteDatabase.openInner(SQLiteDatabase.java:918)
at android.database.sqlite.SQLiteDatabase.open(SQLiteDatabase.java:898)
at android.database.sqlite.SQLiteDatabase.openDatabase(SQLiteDatabase.java:762)
at android.database.sqlite.SQLiteDatabase.openDatabase(SQLiteDatabase.java:751)
at android.database.sqlite.SQLiteOpenHelper.getDatabaseLocked(SQLiteOpenHelper.java:373)
at android.database.sqlite.SQLiteOpenHelper.getWritableDatabase(SQLiteOpenHelper.java:316)
at com.onesignal.OneSignalDbHelper.getSQLiteDatabase(OneSignalDbHelper.java:150)
at com.onesignal.OneSignalDbHelper.getSQLiteDatabaseWithRetries(OneSignalDbHelper.java:174)
at com.onesignal.OneSignalDbHelper.delete(OneSignalDbHelper.java:289)
at com.onesignal.OSNotificationDataController$1.run(OSNotificationDataController.java:57)
at java.lang.Thread.run(Thread.java:923) |
@rbrauwers @raghav2945 @CharlieZheng Thanks for reporting the issue with the fullstack trace and reason messages. IssueSummaryIt seems all these occurrences are from a lower level issue where the DetailsAll of these occurrences noted here come through All There is also getSQLiteDatabaseWithRetries() which is most likely help mitigating most race conditions, however if there is a lot of I/O which mean another thread could be taking a while then there may still be a timeout and would result in throwing. Questions
|
java.lang.IllegalStateException:
at androidx.work.impl.utils.ForceStopRunnable.run (ForceStopRunnable.java:128)
at androidx.work.impl.utils.SerialExecutor$Task.run (SerialExecutor.java:91)
at java.util.concurrent.ThreadPoolExecutor.runWorker (ThreadPoolExecutor.java:1167)
at java.util.concurrent.ThreadPoolExecutor$Worker.run (ThreadPoolExecutor.java:641)
at java.lang.Thread.run (Thread.java:923)
Caused by: android.database.sqlite.SQLiteCantOpenDatabaseException:
at android.database.sqlite.SQLiteConnection.open (SQLiteConnection.java:365)
at android.database.sqlite.SQLiteConnection.open (SQLiteConnection.java:226)
at android.database.sqlite.SQLiteConnectionPool.openConnectionLocked (SQLiteConnectionPool.java:737)
at android.database.sqlite.SQLiteConnectionPool.open (SQLiteConnectionPool.java:284)
at android.database.sqlite.SQLiteConnectionPool.open (SQLiteConnectionPool.java:251)
at android.database.sqlite.SQLiteDatabase.openInner (SQLiteDatabase.java:1392)
at android.database.sqlite.SQLiteDatabase.open (SQLiteDatabase.java:1337)
at android.database.sqlite.SQLiteDatabase.openDatabase (SQLiteDatabase.java:980)
at android.database.sqlite.SQLiteOpenHelper.getDatabaseLocked (SQLiteOpenHelper.java:444)
at android.database.sqlite.SQLiteOpenHelper.getWritableDatabase (SQLiteOpenHelper.java:387)
at androidx.sqlite.db.framework.FrameworkSQLiteOpenHelper$OpenHelper.getWritableSupportDatabase (FrameworkSQLiteOpenHelper.java:145)
at androidx.sqlite.db.framework.FrameworkSQLiteOpenHelper.getWritableDatabase (FrameworkSQLiteOpenHelper.java:106)
at androidx.room.RoomDatabase.inTransaction (RoomDatabase.java:476)
at androidx.room.RoomDatabase.assertNotSuspendingTransaction (RoomDatabase.java:281)
at androidx.work.impl.model.SystemIdInfoDao_Impl.getWorkSpecIds (SystemIdInfoDao_Impl.java:120)
at androidx.work.impl.background.systemjob.SystemJobScheduler.reconcileJobs (SystemJobScheduler.java:298)
at androidx.work.impl.utils.ForceStopRunnable.cleanUp (ForceStopRunnable.java:249)
at androidx.work.impl.utils.ForceStopRunnable.forceStopRunnable (ForceStopRunnable.java:215)
at androidx.work.impl.utils.ForceStopRunnable.run (ForceStopRunnable.java:110)
Caused by: android.database.sqlite.SQLiteCantOpenDatabaseException:
at android.database.sqlite.SQLiteConnection.nativeOpen (Native Method)
at android.database.sqlite.SQLiteConnection.open (SQLiteConnection.java:337) Note I'm just initialization OneSignal in the Application class onCreate method
|
@thefaisalurrehman Thanks for reporting, however OneSignal is not in the stack trace and isn't related the to other reports here. These are coming from the AndroidX WorkManager library as they start with There are a lot of reports of this issue on apps that don't even use OneSignal.
There is an issue created for this already #1280. |
Thanks for response. I check this |
Thank you @jkasten2 for providing such a thorough analysis and update on the issue. It's useful to understand what's causing the problem. Please find below the answers to your questions based on our current observations. Answers:
One more update: with the most recent crash, we can clearly see in the logs that the OneSignal.db does not exist. Which I suspect you must handle more gracefully in certain positions. I'm including the stack trace for your convenience. Stack-trace:Fatal Exception: android.database.sqlite.SQLiteCantOpenDatabaseException: Cannot open database '/data/user/0/com.audiomack/databases/OneSignal.db': File /data/user/0/com.audiomack/databases/OneSignal.db doesn't exist
at android.database.sqlite.SQLiteConnection.open(SQLiteConnection.java:252)
at android.database.sqlite.SQLiteConnection.open(SQLiteConnection.java:205)
at android.database.sqlite.SQLiteConnectionPool.openConnectionLocked(SQLiteConnectionPool.java:505)
at android.database.sqlite.SQLiteConnectionPool.open(SQLiteConnectionPool.java:206)
at android.database.sqlite.SQLiteConnectionPool.open(SQLiteConnectionPool.java:198)
at android.database.sqlite.SQLiteDatabase.openInner(SQLiteDatabase.java:918)
at android.database.sqlite.SQLiteDatabase.open(SQLiteDatabase.java:898)
at android.database.sqlite.SQLiteDatabase.openDatabase(SQLiteDatabase.java:762)
at android.database.sqlite.SQLiteDatabase.openDatabase(SQLiteDatabase.java:751)
at android.database.sqlite.SQLiteOpenHelper.getDatabaseLocked(SQLiteOpenHelper.java:373)
at android.database.sqlite.SQLiteOpenHelper.getWritableDatabase(SQLiteOpenHelper.java:316)
at com.onesignal.OneSignalDbHelper.getSQLiteDatabase(OneSignalDbHelper.java:150)
at com.onesignal.OneSignalDbHelper.getSQLiteDatabaseWithRetries(OneSignalDbHelper.java:174)
at com.onesignal.OneSignalDbHelper.delete(OneSignalDbHelper.java:289)
at com.onesignal.OSNotificationDataController$1.run(OSNotificationDataController.java:57)
at java.lang.Thread.run(Thread.java:923)
Caused by android.database.sqlite.SQLiteCantOpenDatabaseException: unknown error (code 14 SQLITE_CANTOPEN): Could not open database
at android.database.sqlite.SQLiteConnection.nativeOpen(SQLiteConnection.java)
at android.database.sqlite.SQLiteConnection.open(SQLiteConnection.java:224)
at android.database.sqlite.SQLiteConnection.open(SQLiteConnection.java:205)
at android.database.sqlite.SQLiteConnectionPool.openConnectionLocked(SQLiteConnectionPool.java:505)
at android.database.sqlite.SQLiteConnectionPool.open(SQLiteConnectionPool.java:206)
at android.database.sqlite.SQLiteConnectionPool.open(SQLiteConnectionPool.java:198)
at android.database.sqlite.SQLiteDatabase.openInner(SQLiteDatabase.java:918)
at android.database.sqlite.SQLiteDatabase.open(SQLiteDatabase.java:898)
at android.database.sqlite.SQLiteDatabase.openDatabase(SQLiteDatabase.java:762)
at android.database.sqlite.SQLiteDatabase.openDatabase(SQLiteDatabase.java:751)
at android.database.sqlite.SQLiteOpenHelper.getDatabaseLocked(SQLiteOpenHelper.java:373)
at android.database.sqlite.SQLiteOpenHelper.getWritableDatabase(SQLiteOpenHelper.java:316)
at com.onesignal.OneSignalDbHelper.getSQLiteDatabase(OneSignalDbHelper.java:150)
at com.onesignal.OneSignalDbHelper.getSQLiteDatabaseWithRetries(OneSignalDbHelper.java:174)
at com.onesignal.OneSignalDbHelper.delete(OneSignalDbHelper.java:289)
at com.onesignal.OSNotificationDataController$1.run(OSNotificationDataController.java:57)
at java.lang.Thread.run(Thread.java:923) |
Right after adding OneSignal to our native Android (no Unity) app and since publishing to our users we are starting to see this as well, but with OneSignal in the stack trace: Fatal Exception: android.database.sqlite.SQLiteCantOpenDatabaseException: unknown error (code 14 SQLITE_CANTOPEN): Could not open database
at android.database.sqlite.SQLiteConnection.nativeOpen(SQLiteConnection.java)
at android.database.sqlite.SQLiteConnection.open(SQLiteConnection.java:215)
at android.database.sqlite.SQLiteConnection.open(SQLiteConnection.java:197)
at android.database.sqlite.SQLiteConnectionPool.openConnectionLocked(SQLiteConnectionPool.java:505)
at android.database.sqlite.SQLiteConnectionPool.open(SQLiteConnectionPool.java:206)
at android.database.sqlite.SQLiteConnectionPool.open(SQLiteConnectionPool.java:198)
at android.database.sqlite.SQLiteDatabase.openInner(SQLiteDatabase.java:915)
at android.database.sqlite.SQLiteDatabase.open(SQLiteDatabase.java:895)
at android.database.sqlite.SQLiteDatabase.openDatabase(SQLiteDatabase.java:759)
at android.database.sqlite.SQLiteDatabase.openDatabase(SQLiteDatabase.java:748)
at android.database.sqlite.SQLiteOpenHelper.getDatabaseLocked(SQLiteOpenHelper.java:374)
at android.database.sqlite.SQLiteOpenHelper.getWritableDatabase(SQLiteOpenHelper.java:317)
at com.onesignal.OneSignalDbHelper.getSQLiteDatabase(OneSignalDbHelper.java:150)
at com.onesignal.OneSignalDbHelper.getSQLiteDatabaseWithRetries(OneSignalDbHelper.java:174)
at com.onesignal.OneSignalDbHelper.delete(OneSignalDbHelper.java:289)
at com.onesignal.outcomes.data.OSOutcomeEventsCache.cleanCachedUniqueOutcomeEventNotifications(OSOutcomeEventsCache.java:327)
at com.onesignal.outcomes.data.OSOutcomeEventsRepository.cleanCachedUniqueOutcomeEventNotifications(OSOutcomeEventsRepository.kt:46)
at com.onesignal.OSOutcomeEventsController$1.run(OSOutcomeEventsController.java:71)
at java.lang.Thread.run(Thread.java:919) According to Crashlytics user has enough storage space, so that's not what's causing it. Happens in foreground and in background. It happened only to one user so far, but for them 39(!) times within just a few minutes - until today it happened over 2000 times in total for this user. The user's device is a Motorola One with Android 10. We also have our own database in the app and that one is working just fine, no crashes there - so it seems to be an issue specific to OneSignal and how the SDK accesses the DB. We are using version 4.7.0 of the SDK. |
We released version 4.7.2 that has a speculative fix for the crashes here. Also the root cause exception may be reported better if the thread locking changes we made did not address the problem, so please report the new stacktraces if you continue seeing crashes. |
@ubuntudroid @raghav2945 @thefaisalurrehman @rbrauwers @CharlieZheng Just checking in to see if the OneSignal 4.7.2 release fixed this issue for you? |
I think it's fixed. because after update I have no appear this type of crash |
Same here, doesn't seem to happen anymore. Thanks for fixing this! 🙏 |
Awesome, that is good to hear! Thanks for letting us know. |
Please accept my apologies for the delay in responding. However, because the count was slightly increasing, we had to temporarily halt the use of Onesignal. |
@jkasten2 Hi, is the issue from the title resolved as well? SQLiteDatabaseCorruptException on Android 10 devices? @rbrauwers is it working for you after the update? |
Description
App crashes with android.database.sqlite.SQLiteDatabaseCorruptException.
It seems only occurs on Samsung devices running Android 10.
Currently this crash is by far the most relevant issue on our app.
Environment
Compile SDK: 30
OneSignal SDK: 4.4.2
OneSignal plugin: 0.13.4
Using Maven: yes
Stacktrace
The text was updated successfully, but these errors were encountered: