SQLiteConstraintException: UNIQUE constraint failed: jobs._id
See original GitHub issueNot sure if this is just an concurrency issue of the users’ db got corruped.
There following crash was observed by fabric on an Samsung 5.0 and 6.0 when executing:
new JobRequest.Builder(JOB_WIDGET_UPDATER)
.setExecutionWindow(SECONDS.toMillis(3), SECONDS.toMillis(15))
.build()
.schedule();
android.database.sqlite.SQLiteConstraintException: UNIQUE constraint failed: jobs._id (code 1555) ################################################################# Error Code : 1555 (SQLITE_CONSTRAINT_PRIMARYKEY) Caused By : Abort due to constraint violation. (UNIQUE constraint failed: jobs._id (code 1555)) ################################################################# at android.app.ActivityThread.handleReceiver(ActivityThread.java:3641) at android.app.ActivityThread.access$2000(ActivityThread.java:221) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1876) at android.os.Handler.dispatchMessage(Handler.java:102) at android.os.Looper.loop(Looper.java:158) at android.app.ActivityThread.main(ActivityThread.java:7224) at java.lang.reflect.Method.invoke(Method.java) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1230) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1120) Caused by android.database.sqlite.SQLiteConstraintException: UNIQUE constraint failed: jobs._id (code 1555) ################################################################# Error Code : 1555 (SQLITE_CONSTRAINT_PRIMARYKEY) Caused By : Abort due to constraint violation. (UNIQUE constraint failed: jobs._id (code 1555)) ################################################################# at android.database.sqlite.SQLiteConnection.nativeExecuteForLastInsertedRowId(SQLiteConnection.java) at android.database.sqlite.SQLiteConnection.executeForLastInsertedRowId(SQLiteConnection.java:915) at android.database.sqlite.SQLiteSession.executeForLastInsertedRowId(SQLiteSession.java:788) at android.database.sqlite.SQLiteStatement.executeInsert(SQLiteStatement.java:86) at android.database.sqlite.SQLiteDatabase.insertWithOnConflict(SQLiteDatabase.java:1609) at android.database.sqlite.SQLiteDatabase.insertOrThrow(SQLiteDatabase.java:1505) at com.evernote.android.job.JobStorage.store(JobStorage.java:245) at com.evernote.android.job.JobStorage.put(JobStorage.java:127) at com.evernote.android.job.JobManager.schedule(JobManager.java:231) at com.evernote.android.job.JobRequest.schedule(JobRequest.java:354)
Issue Analytics
- State:
- Created 6 years ago
- Comments:39 (3 by maintainers)
Top GitHub Comments
Done https://github.com/evernote/android-job/releases/tag/v1.1.11
Version 1.1.9, according to the logs, it happens right after calling
.schedule ()
.