Insert item fails on db constraint with monkey sometimes

Bug #726067 reported by pjv
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Collectionista
New
Low
Unassigned

Bug Description

Found with monkey:

adb shell monkey -p net.lp.collectionista.alpha --throttle 5 -v 10000 -s 1 --pct-anyevent 50 --ignore-timeouts

02-27 16:26:01.732: ERROR/Database(6650): Error inserting composite_id=1 component_id=1
02-27 16:26:01.732: ERROR/Database(6650): android.database.sqlite.SQLiteConstraintException: error code 19: constraint failed
02-27 16:26:01.732: ERROR/Database(6650): at android.database.sqlite.SQLiteStatement.native_execute(Native Method)
02-27 16:26:01.732: ERROR/Database(6650): at android.database.sqlite.SQLiteStatement.execute(SQLiteStatement.java:55)
02-27 16:26:01.732: ERROR/Database(6650): at android.database.sqlite.SQLiteDatabase.insertWithOnConflict(SQLiteDatabase.java:1549)
02-27 16:26:01.732: ERROR/Database(6650): at android.database.sqlite.SQLiteDatabase.insert(SQLiteDatabase.java:1410)
02-27 16:26:01.732: ERROR/Database(6650): at net.lp.collectionista.alpha.providers.CompositionContentProvider.insert(CompositionContentProvider.java:287)
02-27 16:26:01.732: ERROR/Database(6650): at android.content.ContentProvider$Transport.insert(ContentProvider.java:174)
02-27 16:26:01.732: ERROR/Database(6650): at android.content.ContentResolver.insert(ContentResolver.java:587)
02-27 16:26:01.732: ERROR/Database(6650): at net.lp.collectionista.alpha.providers.FacadeContentProvider.insert(FacadeContentProvider.java:468)
02-27 16:26:01.732: ERROR/Database(6650): at android.content.ContentProvider$Transport.insert(ContentProvider.java:174)
02-27 16:26:01.732: ERROR/Database(6650): at android.content.ContentResolver.insert(ContentResolver.java:587)
02-27 16:26:01.732: ERROR/Database(6650): at net.lp.collectionista.alpha.ui.activities.RegularEditWindow.onCreate(RegularEditWindow.java:253)
02-27 16:26:01.732: ERROR/Database(6650): at net.lp.collectionista.alpha.ui.activities.items.cd.music.MusicCDItemEditWindow.onCreate(MusicCDItemEditWindow.java:630)
02-27 16:26:01.732: ERROR/Database(6650): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047)
02-27 16:26:01.732: ERROR/Database(6650): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2627)
02-27 16:26:01.732: ERROR/Database(6650): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2679)
02-27 16:26:01.732: ERROR/Database(6650): at android.app.ActivityThread.access$2300(ActivityThread.java:125)
02-27 16:26:01.732: ERROR/Database(6650): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2033)
02-27 16:26:01.732: ERROR/Database(6650): at android.os.Handler.dispatchMessage(Handler.java:99)
02-27 16:26:01.732: ERROR/Database(6650): at android.os.Looper.loop(Looper.java:123)
02-27 16:26:01.732: ERROR/Database(6650): at android.app.ActivityThread.main(ActivityThread.java:4627)
02-27 16:26:01.732: ERROR/Database(6650): at java.lang.reflect.Method.invokeNative(Native Method)
02-27 16:26:01.732: ERROR/Database(6650): at java.lang.reflect.Method.invoke(Method.java:521)
02-27 16:26:01.732: ERROR/Database(6650): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868)
02-27 16:26:01.732: ERROR/Database(6650): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)
02-27 16:26:01.732: ERROR/Database(6650): at dalvik.system.NativeStart.main(Native Method)
02-27 16:26:01.772: ERROR/AndroidRuntime(6650): FATAL EXCEPTION: main
02-27 16:26:01.772: ERROR/AndroidRuntime(6650): java.lang.RuntimeException: Unable to start activity ComponentInfo{net.lp.collectionista.alpha/net.lp.collectionista.alpha.ui.activities.items.cd.music.MusicCDItemEditWindow}: android.database.SQLException: Failed to insert row into content://net.lp.collectionista.alpha.composition
02-27 16:26:01.772: ERROR/AndroidRuntime(6650): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2663)
02-27 16:26:01.772: ERROR/AndroidRuntime(6650): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2679)
02-27 16:26:01.772: ERROR/AndroidRuntime(6650): at android.app.ActivityThread.access$2300(ActivityThread.java:125)
02-27 16:26:01.772: ERROR/AndroidRuntime(6650): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2033)
02-27 16:26:01.772: ERROR/AndroidRuntime(6650): at android.os.Handler.dispatchMessage(Handler.java:99)
02-27 16:26:01.772: ERROR/AndroidRuntime(6650): at android.os.Looper.loop(Looper.java:123)
02-27 16:26:01.772: ERROR/AndroidRuntime(6650): at android.app.ActivityThread.main(ActivityThread.java:4627)
02-27 16:26:01.772: ERROR/AndroidRuntime(6650): at java.lang.reflect.Method.invokeNative(Native Method)
02-27 16:26:01.772: ERROR/AndroidRuntime(6650): at java.lang.reflect.Method.invoke(Method.java:521)
02-27 16:26:01.772: ERROR/AndroidRuntime(6650): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868)
02-27 16:26:01.772: ERROR/AndroidRuntime(6650): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)
02-27 16:26:01.772: ERROR/AndroidRuntime(6650): at dalvik.system.NativeStart.main(Native Method)
02-27 16:26:01.772: ERROR/AndroidRuntime(6650): Caused by: android.database.SQLException: Failed to insert row into content://net.lp.collectionista.alpha.composition
02-27 16:26:01.772: ERROR/AndroidRuntime(6650): at net.lp.collectionista.alpha.providers.CompositionContentProvider.insert(CompositionContentProvider.java:294)
02-27 16:26:01.772: ERROR/AndroidRuntime(6650): at android.content.ContentProvider$Transport.insert(ContentProvider.java:174)
02-27 16:26:01.772: ERROR/AndroidRuntime(6650): at android.content.ContentResolver.insert(ContentResolver.java:587)
02-27 16:26:01.772: ERROR/AndroidRuntime(6650): at net.lp.collectionista.alpha.providers.FacadeContentProvider.insert(FacadeContentProvider.java:468)
02-27 16:26:01.772: ERROR/AndroidRuntime(6650): at android.content.ContentProvider$Transport.insert(ContentProvider.java:174)
02-27 16:26:01.772: ERROR/AndroidRuntime(6650): at android.content.ContentResolver.insert(ContentResolver.java:587)
02-27 16:26:01.772: ERROR/AndroidRuntime(6650): at net.lp.collectionista.alpha.ui.activities.RegularEditWindow.onCreate(RegularEditWindow.java:253)
02-27 16:26:01.772: ERROR/AndroidRuntime(6650): at net.lp.collectionista.alpha.ui.activities.items.cd.music.MusicCDItemEditWindow.onCreate(MusicCDItemEditWindow.java:630)
02-27 16:26:01.772: ERROR/AndroidRuntime(6650): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047)
02-27 16:26:01.772: ERROR/AndroidRuntime(6650): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2627)
02-27 16:26:01.772: ERROR/AndroidRuntime(6650): ... 11 more

Revision history for this message
pjv (pjv) wrote :

02-27 02:47:31.938: INFO/Database(3132): sqlite returned: error code = 17, msg = prepared statement aborts at 17: [SELECT composite_id, component_id FROM composition WHERE (composite_id=?) ORDER BY component_id ASC]

02-27 02:47:33.578: INFO/Database(3132): sqlite returned: error code = 17, msg = prepared statement aborts at 13: [INSERT INTO items(created, modified, subtype) VALUES(?, ?, ?);]

These are benign apparently: http://code.google.com/p/android/issues/detail?id=11743

Revision history for this message
pjv (pjv) wrote :

The real problem seems to be that there is no collection with composite_id=1, no collection at all in the db. But issue depends on throttle, so some race condition?

Revision history for this message
pjv (pjv) wrote :

Could be because of bug #716103.

Revision history for this message
pjv (pjv) wrote :

Is not because of bug #716103!

Revision history for this message
pjv (pjv) wrote :

Not seen anymore lately (v0.3.1)

Changed in collectionista:
importance: Undecided → Low
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.