nextcloud / android

📱 Nextcloud Android app
https://play.google.com/store/apps/details?id=com.nextcloud.client
GNU General Public License v2.0
4.3k stars 1.77k forks source link

Crash when mobile storage space is running out: `SQLiteCantOpenDatabaseException: unknown error (code 14 SQLITE_CANTOPEN): Could not open database` #13174

Open adrianahdez opened 4 months ago

adrianahdez commented 4 months ago

⚠️ Before posting ⚠️

Steps to reproduce

Cause of error

Exception in thread "WM.task-1" java.lang.IllegalStateException: The file system on the device is in a bad state. WorkManager cannot access the app's internal data store.
    at androidx.work.impl.utils.ForceStopRunnable.run(ForceStopRunnable.java:163)
    at androidx.work.impl.utils.SerialExecutorImpl$Task.run(SerialExecutorImpl.java:96)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:644)
    at java.lang.Thread.run(Thread.java:1012)
Caused by: Exception in thread "WM.task-1" android.database.sqlite.SQLiteCantOpenDatabaseException: Cannot open database '/data/user/0/com.nextcloud.client/no_backup/androidx.work.workdb': File /data/user/0/com.nextcloud.client/no_backup/androidx.work.workdb doesn't exist
    at android.database.sqlite.SQLiteConnection.open(SQLiteConnection.java:254)
    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:919)
    at android.database.sqlite.SQLiteDatabase.open(SQLiteDatabase.java:899)
    at android.database.sqlite.SQLiteDatabase.openDatabase(SQLiteDatabase.java:763)
    at android.database.sqlite.SQLiteDatabase.openDatabase(SQLiteDatabase.java:752)
    at android.database.sqlite.SQLiteOpenHelper.getDatabaseLocked(SQLiteOpenHelper.java:373)
    at android.database.sqlite.SQLiteOpenHelper.getWritableDatabase(SQLiteOpenHelper.java:316)
    at androidx.sqlite.db.framework.FrameworkSQLiteOpenHelper$OpenHelper.getWritableOrReadableDatabase(FrameworkSQLiteOpenHelper.kt:232)
    at androidx.sqlite.db.framework.FrameworkSQLiteOpenHelper$OpenHelper.innerGetDatabase(FrameworkSQLiteOpenHelper.kt:223)
    at androidx.sqlite.db.framework.FrameworkSQLiteOpenHelper$OpenHelper.getSupportDatabase(FrameworkSQLiteOpenHelper.kt:151)
    at androidx.sqlite.db.framework.FrameworkSQLiteOpenHelper.getWritableDatabase(FrameworkSQLiteOpenHelper.kt:104)
    at androidx.room.RoomDatabase.inTransaction(RoomDatabase.kt:632)
    at androidx.room.RoomDatabase.assertNotSuspendingTransaction(RoomDatabase.kt:451)
    at androidx.work.impl.model.SystemIdInfoDao_Impl.getWorkSpecIds(SystemIdInfoDao_Impl.java:165)
    at androidx.work.impl.background.systemjob.SystemJobScheduler.reconcileJobs(SystemJobScheduler.java:310)
    at androidx.work.impl.utils.ForceStopRunnable.cleanUp(ForceStopRunnable.java:289)
    at androidx.work.impl.utils.ForceStopRunnable.forceStopRunnable(ForceStopRunnable.java:252)
    at androidx.work.impl.utils.ForceStopRunnable.run(ForceStopRunnable.java:135)
    at androidx.work.impl.utils.SerialExecutorImpl$Task.run(SerialExecutorImpl.java:96)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:644)
    at java.lang.Thread.run(Thread.java:1012)
Caused by: Exception in thread "WM.task-1" android.database.sqlite.SQLiteCantOpenDatabaseException: unknown error (code 14 SQLITE_CANTOPEN): Could not open database
    at android.database.sqlite.SQLiteConnection.nativeOpen(Native Method)
    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:919)
    at android.database.sqlite.SQLiteDatabase.open(SQLiteDatabase.java:899)
    at android.database.sqlite.SQLiteDatabase.openDatabase(SQLiteDatabase.java:763)
    at android.database.sqlite.SQLiteDatabase.openDatabase(SQLiteDatabase.java:752)
    at android.database.sqlite.SQLiteOpenHelper.getDatabaseLocked(SQLiteOpenHelper.java:373)
    at android.database.sqlite.SQLiteOpenHelper.getWritableDatabase(SQLiteOpenHelper.java:316)
    at androidx.sqlite.db.framework.FrameworkSQLiteOpenHelper$OpenHelper.getWritableOrReadableDatabase(FrameworkSQLiteOpenHelper.kt:232)
    at androidx.sqlite.db.framework.FrameworkSQLiteOpenHelper$OpenHelper.innerGetDatabase(FrameworkSQLiteOpenHelper.kt:223)
    at androidx.sqlite.db.framework.FrameworkSQLiteOpenHelper$OpenHelper.getSupportDatabase(FrameworkSQLiteOpenHelper.kt:151)
    at androidx.sqlite.db.framework.FrameworkSQLiteOpenHelper.getWritableDatabase(FrameworkSQLiteOpenHelper.kt:104)
    at androidx.room.RoomDatabase.inTransaction(RoomDatabase.kt:632)
    at androidx.room.RoomDatabase.assertNotSuspendingTransaction(RoomDatabase.kt:451)
    at androidx.work.impl.model.SystemIdInfoDao_Impl.getWorkSpecIds(SystemIdInfoDao_Impl.java:165)
    at androidx.work.impl.background.systemjob.SystemJobScheduler.reconcileJobs(SystemJobScheduler.java:310)
    at androidx.work.impl.utils.ForceStopRunnable.cleanUp(ForceStopRunnable.java:289)
    at androidx.work.impl.utils.ForceStopRunnable.forceStopRunnable(ForceStopRunnable.java:252)
    at androidx.work.impl.utils.ForceStopRunnable.run(ForceStopRunnable.java:135)
    at androidx.work.impl.utils.SerialExecutorImpl$Task.run(SerialExecutorImpl.java:96)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:644)
    at java.lang.Thread.run(Thread.java:1012)

App information

Device information

Firmware

Expected behaviour

The app open and work normally

Actual behaviour

The app sometimes is unable to open and sometimes it opens but crash when trying to use the "upload from another app" feature

Android version

12

Device brand and model

Xiaomi MI 10T

Stock or custom OS?

Stock

Nextcloud android app version

3.29.0

Nextcloud server version

-

Using a reverse proxy?

Yes

Android logs

No response

Server error logs

No response

Additional information

No response

joshtrichards commented 4 months ago

App crash when mobile storage space is running out

How low are we talking about?

There's only so much we can do if you don't have any space to work with (though, yes, we could more gracefully fail under these circumstances from the looks of it).