Skip to content

Firebase Internal Foreign key constraint error #361

Open
@stephanenicolas

Description

@stephanenicolas

When enable foreign key constraint in our app using :

//https://stackoverflow.com/a/12531927/693752
db.setForeignKeyConstraintsEnabled(true);

we see an internal error in the logcat coming from an internal database schema definition from firebase:

04-16 21:34:57.852  6738  8269 E SQLiteDatabase: Error inserting period=0 target_class=com.firebase.jobdispatcher.GooglePlayReceiver required_network_type=0 runtime=1555450497848 extras={"com.firebase.jobdispatcher.tag":{"com.company.REGISTER":4},"com.firebase.jobdispatcher.trigger_type":{"1":0},"com.firebase.jobdispatcher.replace_current":{"true":3},"com.firebase.jobdispatcher.persistent":{"2":0},"registration_id":{"dIu14E5WNzw:APA91bEheSYPxZM5T_wHaiFcP_EZTHqEuVU0GWT58D-1wlrjUhMzmbrmyeWTjUfLy3zBCqJrf7mwASZlBFqkqdlNMs7hsRh2WPJwa4I4eLrJeAkzZMYZGIZ-fccj4C8zLRbSEDbuMlvu":4},"com.firebase.jobdispatcher.maximum_backoff_seconds":{"3600":0},"com.firebase.jobdispatcher.initial_backoff_seconds":{"30":0},"com.firebase.jobdispatcher.retry_policy":{"1":0},"com.firebase.jobdispatcher.window_end":{"0":0},"com.firebase.jobdispatcher.service":{"com.company.SomeService":4},"com.firebase.jobdispatcher.recurring":{"false":3},"com.firebase.jobdispatcher.constraints":{"2":0},"com.firebase.jobdispatcher.window_start":{"0":0}} source=8 target_package=com.company.dev source_version=1 last_runtime=0 user_id=0 job_id=-1 requires_charging=0 tag=com.company.REGISTER flex_time=0 task_type=0 retry_strategy={"maximum_backoff_seconds":{"3600":0},"initial_backoff_seconds":{"30":0},"retry_policy":{"0":0}}
04-16 21:34:57.852  6738  8269 E SQLiteDatabase: android.database.sqlite.SQLiteConstraintException: UNIQUE constraint failed: pending_ops.tag, pending_ops.target_class, pending_ops.target_package, pending_ops.user_id (code 2067)
04-16 21:34:57.852  6738  8269 E SQLiteDatabase: 	at android.database.sqlite.SQLiteConnection.nativeExecuteForLastInsertedRowId(Native Method)
04-16 21:34:57.852  6738  8269 E SQLiteDatabase: 	at android.database.sqlite.SQLiteConnection.executeForLastInsertedRowId(SQLiteConnection.java:782)
04-16 21:34:57.852  6738  8269 E SQLiteDatabase: 	at android.database.sqlite.SQLiteSession.executeForLastInsertedRowId(SQLiteSession.java:788)
04-16 21:34:57.852  6738  8269 E SQLiteDatabase: 	at android.database.sqlite.SQLiteStatement.executeInsert(SQLiteStatement.java:86)
04-16 21:34:57.852  6738  8269 E SQLiteDatabase: 	at android.database.sqlite.SQLiteDatabase.insertWithOnConflict(SQLiteDatabase.java:1474)
04-16 21:34:57.852  6738  8269 E SQLiteDatabase: 	at android.database.sqlite.SQLiteDatabase.insert(SQLiteDatabase.java:1343)
04-16 21:34:57.852  6738  8269 E SQLiteDatabase: 	at zxx.a(:com.google.android.gms@[email protected] (040700-239467275):148)
04-16 21:34:57.852  6738  8269 E SQLiteDatabase: 	at aaat.a(:com.google.android.gms@[email protected] (040700-239467275):166)
04-16 21:34:57.852  6738  8269 E SQLiteDatabase: 	at aaat.a(:com.google.android.gms@[email protected] (040700-239467275):8)
04-16 21:34:57.852  6738  8269 E SQLiteDatabase: 	at aaat.a(:com.google.android.gms@[email protected] (040700-239467275):157)
04-16 21:34:57.852  6738  8269 E SQLiteDatabase: 	at zxu.run(:com.google.android.gms@[email protected] (040700-239467275):2)
04-16 21:34:57.852  6738  8269 E SQLiteDatabase: 	at rrt.b(:com.google.android.gms@[email protected] (040700-239467275):32)
04-16 21:34:57.852  6738  8269 E SQLiteDatabase: 	at rrt.run(:com.google.android.gms@[email protected] (040700-239467275):21)
04-16 21:34:57.852  6738  8269 E SQLiteDatabase: 	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1162)
04-16 21:34:57.852  6738  8269 E SQLiteDatabase: 	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:636)
04-16 21:34:57.852  6738  8269 E SQLiteDatabase: 	at rxx.run(Unknown Source:7)
04-16 21:34:57.852  6738  8269 E SQLiteDatabase: 	at java.lang.Thread.run(Thread.java:764)

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions