Fatal Exception: android.database.sqlite.SQLiteException duplicate column name: run_in_foreground (code 1 SQLITE_ERROR): , while compiling: ALTER TABLE workspec ADD COLUMN `run_in_foreground` INTEGER NOT NULL DEFAULT 0
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 25/100
- Issue type
- Bug
- Clarity
- Needs clarification
- Activity status
- Stale
- Tech stack
- kotlin, sqlite
- Domain
- databases, mobile-dev
Research direction
Start with WorkDatabaseMigrations$6.migrate at WorkDatabaseMigrations.java:209 and the RoomOpenHelper.onUpgrade path shown in the stack trace. Compare the androidx.work:work-runtime:2.3.4 and work-runtime-ktx:2.2.0 dependency setup, then determine why the run_in_foreground column is added twice. Done means the migration conflict and a verified resolution are documented.
Written by the indexing model from the issue text.
Description
Hi Team,
We are getting very heavy crash of WorkManager library whenever database migration happening which code written by workmanager it self
So we found that clevertap also using work manager library which is
androidx.work:work-runtime:2.3.4
And We are using which is
api "androidx.work:work-runtime-ktx:2.2.0"
Clevertap lib using in our project is
api 'com.clevertap.android:push-templates:0.0.8'
api 'com.clevertap.android:clevertap-android-sdk:4.0.0'
implementation 'com.clevertap.android:clevertap-xiaomi-sdk:1.0.0'
Have written this piece of code in application class
override fun getWorkManagerConfiguration() =
Configuration.Builder()
.setMinimumLoggingLevel(android.util.Log.INFO)
.build()
android.database.sqlite.SQLiteConnection.nativePrepareStatement (SQLiteConnection.java)
android.database.sqlite.SQLiteConnection.acquirePreparedStatement (SQLiteConnection.java:1055)
android.database.sqlite.SQLiteConnection.prepare (SQLiteConnection.java:662)
android.database.sqlite.SQLiteSession.prepare (SQLiteSession.java:590)
android.database.sqlite.SQLiteProgram.<init> (SQLiteProgram.java:61)
android.database.sqlite.SQLiteStatement.<init> (SQLiteStatement.java:33)
android.database.sqlite.SQLiteDatabase.executeSql (SQLiteDatabase.java:1930)
android.database.sqlite.SQLiteDatabase.execSQL (SQLiteDatabase.java:1852)
androidx.sqlite.db.framework.FrameworkSQLiteDatabase.execSQL (FrameworkSQLiteDatabase.java:242)
androidx.work.impl.WorkDatabaseMigrations$6.migrate (WorkDatabaseMigrations.java:209)
androidx.room.RoomOpenHelper.onUpgrade (RoomOpenHelper.java:99)
androidx.sqlite.db.framework.FrameworkSQLiteOpenHelper$OpenHelper.onUpgrade (FrameworkSQLiteOpenHelper.java:177)
android.database.sqlite.SQLiteOpenHelper.getDatabaseLocked (SQLiteOpenHelper.java:421)
android.database.sqlite.SQLiteOpenHelper.getWritableDatabase (SQLiteOpenHelper.java:321)
androidx.sqlite.db.framework.FrameworkSQLiteOpenHelper$OpenHelper.getWritableSupportDatabase (FrameworkSQLiteOpenHelper.java:145)
androidx.sqlite.db.framework.FrameworkSQLiteOpenHelper.getWritableDatabase (FrameworkSQLiteOpenHelper.java:106)
androidx.room.RoomDatabase.beginTransaction (RoomDatabase.java:352)
androidx.work.impl.utils.ForceStopRunnable.cleanUp (ForceStopRunnable.java:156)
androidx.work.impl.utils.ForceStopRunnable.run (ForceStopRunnable.java:87)
androidx.work.impl.utils.SerialExecutor$Task.run (SerialExecutor.java:91)
java.util.concurrent.ThreadPoolExecutor.runWorker (ThreadPoolExecutor.java:1167)
java.util.concurrent.ThreadPoolExecutor$Worker.run (ThreadPoolExecutor.java:641)
java.lang.Thread.run (Thread.java:923)
please help to find out the root cause so we can solve as soon as possible
This crash happening only when user is in background , but wont able to replicate on our device, So do not have any idea how to solve this
- Dominant language
- Kotlin
- Stars
- 557
- Forks
- 242
- PR merge metrics
- No merged PRs in 30d
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from android/codelab-android-workmanager
-
Difficulty 1/5 Under an hour Newbie friendliness 68/100
android/codelab-android-workmanager#261 · 1 reaction ·
-
Difficulty 1/5 Under an hour Newbie friendliness 62/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 45/100
-
Difficulty 5/5 Over a week Newbie friendliness 15/100
android/codelab-android-workmanager#324 · 1 reaction ·
-
Difficulty 1/5 Under an hour Newbie friendliness 50/100
All issues in android/codelab-android-workmanager
Similar issues
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
-
index-request triaged
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
-
enhancement
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
Anthonyy232/Paperize#614 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
bitcoindevkit/bdk-ffi#1125 ·
-
🌑 nextgen
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
CCBlueX/LiquidBounce#9214 · 1 comment ·