codelab-android-workmanager icon indicating copy to clipboard operation
codelab-android-workmanager copied to clipboard

android.database.sqlite.SQLiteException: cannot rollback - no transaction is active (code 1)

Open dcboy opened this issue 4 years ago • 7 comments

android.database.sqlite.SQLiteException: cannot rollback - no transaction is active (code 1)
	at android.database.sqlite.SQLiteConnection.nativeExecute(Native Method)
	at android.database.sqlite.SQLiteConnection.execute(SQLiteConnection.java:555)
 	at android.database.sqlite.SQLiteSession.endTransactionUnchecked(SQLiteSession.java:439)
	at android.database.sqlite.SQLiteSession.endTransaction(SQLiteSession.java:401)
 	at android.database.sqlite.SQLiteDatabase.endTransaction(SQLiteDatabase.java:522)
 	at androidx.sqlite.db.framework.FrameworkSQLiteDatabase.endTransaction(FrameworkSQLiteDatabase.java:90)
 	at androidx.work.impl.WorkDatabase$2.onOpen(WorkDatabase.java:169)
 	at androidx.work.impl.WorkDatabase_Impl$1.onOpen(WorkDatabase_Impl.java:113)
 	at androidx.room.RoomOpenHelper.onOpen(RoomOpenHelper.java:136)
 	at androidx.sqlite.db.framework.FrameworkSQLiteOpenHelper$OpenHelper.onOpen(FrameworkSQLiteOpenHelper.java:195)
 	at android.database.sqlite.SQLiteOpenHelper.getDatabaseLocked(SQLiteOpenHelper.java:266)
 	at android.database.sqlite.SQLiteOpenHelper.getWritableDatabase(SQLiteOpenHelper.java:163)
 	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.beginTransaction(RoomDatabase.java:352)
 	at androidx.work.impl.utils.ForceStopRunnable.cleanUp(ForceStopRunnable.java:205)
 	at androidx.work.impl.utils.ForceStopRunnable.forceStopRunnable(ForceStopRunnable.java:165)
 	at androidx.work.impl.utils.ForceStopRunnable.run(ForceStopRunnable.java:102)
 	at androidx.work.impl.utils.SerialExecutor$Task.run(SerialExecutor.java:91)
 	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1112)
 	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:587)
 	at java.lang.Thread.run(Thread.java:818)

Android Platform API Version 22

dcboy avatar Apr 14 '21 10:04 dcboy

Hey @dcboy , is this an error you ran into while working on the codelab? If so, which codelab were you working on and which step did you see this issue?

calren avatar May 27 '21 22:05 calren

I have the same issue, is there any clue what it is?

MMohamad70 avatar Jul 12 '21 14:07 MMohamad70

Can you please provide information on how this issue can be reproduced, @dcboy or @MMohamad70. Otherwise we can't reproduce the issue and will have to close it.

keyboardsurfer avatar Oct 19 '21 09:10 keyboardsurfer

Can you please provide information on how this issue can be reproduced, @dcboy or @MMohamad70. Otherwise we can't reproduce the issue and will have to close it.

so sorry for that i don't know how to reproduced this issues, may be in special android version eg API version 22 may reproduced, if the storage can implement another provider eg: objectbox may be solved

dcboy avatar Oct 19 '21 09:10 dcboy

Can you please provide information on how this issue can be reproduced, @dcboy or @MMohamad70. Otherwise we can't reproduce the issue and will have to close it.

Sorry but I don't know exactly what happens. It only occurs in one device (Not mine) and I get lots of this error in crashlytics. I Check the device, everything looks normal but the workers don't work. I check androidx.work.workdb file it becomes more than 100MB (look strange because I only have 5 unique workers which starts continuesly), when I remove this file worker starts working but after 3 days the crash starts occurring again! I think maybe it is related to it that I create a unique worker every minute (for syncing some staff).

MMohamad70 avatar Oct 20 '21 10:10 MMohamad70

Please use the issuetracker to report this with stacktrace and more detailed information so we can investigate it further.

keyboardsurfer avatar Oct 20 '21 10:10 keyboardsurfer

@keyboardsurfer I will try to get more info about how to reproduce it, and then report it with more detailed information.

MMohamad70 avatar Oct 20 '21 10:10 MMohamad70