question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

SQLiteConstraintException: UNIQUE constraint failed: jobs._id

See original GitHub issue

Not 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:closed
  • Created 6 years ago
  • Comments:39 (3 by maintainers)

github_iconTop GitHub Comments

2reactions
tobiasschuergcommented, Apr 13, 2017

Version 1.1.9, according to the logs, it happens right after calling .schedule ().

Read more comments on GitHub >

github_iconTop Results From Across the Web

UNIQUE constraint failed: sqlite database : android
The table has a unique constraint on it. That means that only one row can exist with a given ID value. If you're...
Read more >
SQLite - unique constraint failed - Laracasts
SQLite - unique constraint failed. I have a test in my aqpplication. I have the following model factory: Copy Code
Read more >
SQLite NOT NULL Constraint
This tutorial shows you how to use the SQLite NOT NULL constraint to ensure the values in a column are not NULL.
Read more >
Files and Folders backup error: UNIQUE constraint failed ...
Data Protection: Files and Folders backup error: UNIQUE constraint failed: Node.NodeId, Node.SessionId. Error code: 19:2067 (constraint ...
Read more >
crash in android.database.sqlite.SQLiteConstraintException
SQLiteConstraintException : foreign key constraint failed (code 19) at ... it could theoretically cause this bug (as well as causing more work later)....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found