Closed Bug 744660 Opened 8 years ago Closed 8 years ago

SQLiteConstraintException on bulkInsert history data


(Firefox for Android :: Android Sync, defect, P1)




Tracking Status
blocking-fennec1.0 --- beta+


(Reporter: nalexander, Assigned: nalexander)



(1 file)

Attached file adb logcat
Problem with bulkInserting history?  This was on a first sync with m-i pulled today:

changeset:   91441:e819f766c586
tag:         qparent
user:        Patrick McManus <>
date:        Wed Apr 11 13:49:32 2012 -0400
summary:     bug 743747: fix landing with 603514 r=honzab

See attached log for more details.

V GeckoBrowserProvider(21233) Flushing DB bulkinsert...
D dalvikvm(21233)             GC_CONCURRENT freed 529K, 8% free 8347K/9031K, paused 2ms+2ms
D dalvikvm(21233)             GC_FOR_ALLOC freed 507K, 8% free 8312K/9031K, paused 19ms
E SQLiteDatabase(21233)       Error inserting guid=JadQHBs80dbC visits=[{"type":1,"date":1334100347661000},{"type":1,"date":1334100347660000},{"type":1,"date":1334100347659000},{"type":1,"date":1334100347658000},{"type":2,"date":1334097673057317},{"type":2,"date":1334097564731989},{"type":2,"date":1334097498663778},{"type":2,"date":1334097492931013},{"type":2,"date":1334097490052229},{"type":2,"date":1334097260080121}]
E SQLiteDatabase(21233)       android.database.sqlite.SQLiteConstraintException: error code 19: constraint failed
E SQLiteDatabase(21233)       	at android.database.sqlite.SQLiteStatement.native_executeInsert(Native Method)
E SQLiteDatabase(21233)       	at android.database.sqlite.SQLiteStatement.executeInsert(
E SQLiteDatabase(21233)       	at android.database.sqlite.SQLiteDatabase.insertWithOnConflict(
E SQLiteDatabase(21233)       	at android.database.sqlite.SQLiteDatabase.insert(
E SQLiteDatabase(21233)       	at
E SQLiteDatabase(21233)       	at
E SQLiteDatabase(21233)       	at
E SQLiteDatabase(21233)       	at
E SQLiteDatabase(21233)       	at
E SQLiteDatabase(21233)       	at$
E SQLiteDatabase(21233)       	at java.util.concurrent.ThreadPoolExecutor.runWorker(
E SQLiteDatabase(21233)       	at java.util.concurrent.ThreadPoolExecutor$
E SQLiteDatabase(21233)       	at
Looks like it's inserting when a record already exists for that GUID.
From conversation with tchung:

11:24 nalexander: tchung: we recently landed code to insert history items in one db access.
11:24 nalexander: Which may be causing trouble, and may be related to the recent Fennec CP changes.
11:25 nalexander: Doesn't necessarily need testing immediately but keep your eyes open.
11:25 nalexander: I'm going to investigate on my end.
blocking-fennec1.0: --- → ?
blocking-fennec1.0: ? → beta+
(In reply to Naoki Hirata :nhirata from comment #3)
> see

Thanks, but totally unrelated. Same exception, different database, different cause.
Just to clarify: this is failing in the data extender. That means the Fennec version has nothing to do with this; you should be able to reproduce in integration tests.

The only constraint is that GUID is primary key -- that is, it must be unique and non-null.

If guid is JadQHBs80dbC, that implies a duplicate. Perhaps batch is being flushed twice, or the accrued batch reuses an entry and thus contains dupes, or you're inserting *and* batching, or this insert is relying on a delete that failed?
Assignee: nobody → nalexander

QA: please verify that this doesn't pop up in the log!
Whiteboard: [qa+]
Target Milestone: --- → mozilla14
Closed: 8 years ago
Resolution: --- → FIXED
log is fine
Whiteboard: [qa+]
Product: Mozilla Services → Android Background Services
Product: Android Background Services → Firefox for Android
You need to log in before you can comment on or make changes to this bug.