urbanairship / android-library

Urban Airship Android SDK
Other
111 stars 122 forks source link

SQLite crashes triggered from Airship maintenance tasks #165

Closed darrentaft closed 3 years ago

darrentaft commented 3 years ago

❗For how-to inquiries involving Airship functionality or use cases, please contact (support)[https://support.airship.com/].

Preliminary Info

What Airship dependencies are you using?

urbanairship-fcm:14.0.2 urbanairship-automation:14.0.2 urbanairship-message-center:14.0.2

What are the versions of any relevant development tools you are using?

N/A

Report

What unexpected behavior are you seeing?

Crashes from Airship SDK, reported to Google Play.

What is the expected behavior?

Don't crash

What are the steps to reproduce the unexpected behavior?

Unknown

Do you have logging for the issue?

2 crashes reported to Google Play in the SQLite part of Airship - each reported many times:

Reported 467 times from 2 users:

android.database.sqlite.SQLiteException: 
  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 androidx.sqlite.db.framework.FrameworkSQLiteOpenHelper$OpenHelper.getWritableSupportDatabase (FrameworkSQLiteOpenHelper.java:92)
  at androidx.sqlite.db.framework.FrameworkSQLiteOpenHelper.getWritableDatabase (FrameworkSQLiteOpenHelper.java:53)
  at androidx.room.RoomDatabase.inTransaction (RoomDatabase.java:476)
  at androidx.room.RoomDatabase.assertNotSuspendingTransaction (RoomDatabase.java:281)
  at com.urbanairship.automation.storage.AutomationDao_Impl.getActiveExpiredSchedules (AutomationDao_Impl.java:1420)
  at com.urbanairship.automation.AutomationEngine.cleanSchedules (AutomationEngine.java:892)
  at com.urbanairship.automation.AutomationEngine.access$600 (AutomationEngine.java:72)
  at com.urbanairship.automation.AutomationEngine$4.run (AutomationEngine.java:242)

Reported 333 times from 4 users:

android.database.sqlite.SQLiteCantOpenDatabaseException: 
  at android.database.sqlite.SQLiteConnection.nativeOpen (SQLiteConnection.java)
  at android.database.sqlite.SQLiteConnection.open (SQLiteConnection.java:300)
  at android.database.sqlite.SQLiteConnection.open (SQLiteConnection.java:218)
  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:1394)
  at android.database.sqlite.SQLiteDatabase.open (SQLiteDatabase.java:1339)
  at android.database.sqlite.SQLiteDatabase.openDatabase (SQLiteDatabase.java:974)
  at android.database.sqlite.SQLiteOpenHelper.getDatabaseLocked (SQLiteOpenHelper.java:448)
  at android.database.sqlite.SQLiteOpenHelper.getWritableDatabase (SQLiteOpenHelper.java:391)
  at androidx.sqlite.db.framework.FrameworkSQLiteOpenHelper$OpenHelper.getWritableSupportDatabase (FrameworkSQLiteOpenHelper.java:92)
  at androidx.sqlite.db.framework.FrameworkSQLiteOpenHelper.getWritableDatabase (FrameworkSQLiteOpenHelper.java:53)
  at androidx.room.RoomDatabase.inTransaction (RoomDatabase.java:476)
  at androidx.room.RoomDatabase.assertNotSuspendingTransaction (RoomDatabase.java:281)
  at com.urbanairship.automation.storage.AutomationDao_Impl.getActiveExpiredSchedules (AutomationDao_Impl.java:1420)
  at com.urbanairship.automation.AutomationEngine.cleanSchedules (AutomationEngine.java:892)
  at com.urbanairship.automation.AutomationEngine.access$600 (AutomationEngine.java:72)
  at com.urbanairship.automation.AutomationEngine$4.run (AutomationEngine.java:242)
rlepinski commented 3 years ago

Thanks for the report, we will take a look.

rlepinski commented 3 years ago

Do you have any updates on # of users affected? Could you post any other device information like manufacturer?

I am pretty sure it has to do with these handful of users just not having enough space on the device, but would like to know if its a bigger issue before I just blindly try/catch all sql exceptions.

darrentaft commented 3 years ago

14 users, 5.46k crashes so far.

The following devices listed:

Thanks

rlepinski commented 3 years ago

Do you have an idea of your total audience size? 14 users is not that many, maybe just storage space issue?

darrentaft commented 3 years ago

570k unique users in the last 30 days, so yes - the number is small, but it's putting a dent in my stability stats. ;-)

rlepinski commented 3 years ago

I have a fix in review, it just catches the exceptions and no-ops on the operation. It is what we were doing pre-room migration so I believe it should be fine. Should be out today or tomorrow.

darrentaft commented 3 years ago

Great. Thanks Ryan.

rlepinski commented 3 years ago

Fixed in 14.0.3