Closed Bug 1301827 Opened 8 years ago Closed 3 years ago

Error storing records during sync: nested transactions are not supported

Categories

(Firefox for Android Graveyard :: Android Sync, defect, P2)

defect

Tracking

(Not tracked)

RESOLVED INCOMPLETE

People

(Reporter: Grisha, Unassigned)

Details

This was triggered during the very first sync after logging in - I edited Device Name while sync was in progress, and sync didn't seem to ever finish at that point.

09-09 15:20:22.170 13238-15472/org.mozilla.fennec_grisha I/GeckoLogger: fennec_grisha :: GlobalSession :: Running next stage syncFormHistory (org.mozilla.gecko.sync.stage.FormHistoryServerSyncStage@4d2c7e)...
09-09 15:20:23.018 13238-13244/org.mozilla.fennec_grisha W/art: Suspending all threads took: 14.616ms
09-09 15:20:24.524 13238-13244/org.mozilla.fennec_grisha W/art: Suspending all threads took: 20.103ms
09-09 15:20:25.220 13238-15564/org.mozilla.fennec_grisha E/FormHistoryProvider: Error in database BULKINSERT
                                                                                org.mozilla.gecko.sqlite.SQLiteBridgeException: Nested transactions are not supported
                                                                                    at org.mozilla.gecko.sqlite.SQLiteBridge.beginTransaction(SQLiteBridge.java:290)
                                                                                    at org.mozilla.gecko.db.SQLiteBridgeContentProvider.bulkInsert(SQLiteBridgeContentProvider.java:363)
                                                                                    at android.content.ContentProvider$Transport.bulkInsert(ContentProvider.java:278)
                                                                                    at android.content.ContentProviderClient.bulkInsert(ContentProviderClient.java:244)
                                                                                    at org.mozilla.gecko.sync.repositories.android.FormHistoryRepositorySession.flushInsertQueue(FormHistoryRepositorySession.java:472)
                                                                                    at org.mozilla.gecko.sync.repositories.android.FormHistoryRepositorySession.insertNewRegularRecord(FormHistoryRepositorySession.java:510)
                                                                                    at org.mozilla.gecko.sync.repositories.android.FormHistoryRepositorySession$8.run(FormHistoryRepositorySession.java:637)
                                                                                    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1113)
                                                                                    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:588)
                                                                                    at java.lang.Thread.run(Thread.java:818)
09-09 15:20:25.232 13238-15564/org.mozilla.fennec_grisha W/GeckoLogger: fennec_grisha :: SynchronizerSession :: First RecordsChannel onFlowStoreFailed. Logging local store error.
                                                                        org.mozilla.gecko.sqlite.SQLiteBridgeException: Nested transactions are not supported
                                                                            at org.mozilla.gecko.sqlite.SQLiteBridge.beginTransaction(SQLiteBridge.java:290)
                                                                            at org.mozilla.gecko.db.SQLiteBridgeContentProvider.bulkInsert(SQLiteBridgeContentProvider.java:363)
                                                                            at android.content.ContentProvider$Transport.bulkInsert(ContentProvider.java:278)
                                                                            at android.content.ContentProviderClient.bulkInsert(ContentProviderClient.java:244)
                                                                            at org.mozilla.gecko.sync.repositories.android.FormHistoryRepositorySession.flushInsertQueue(FormHistoryRepositorySession.java:472)
                                                                            at org.mozilla.gecko.sync.repositories.android.FormHistoryRepositorySession.insertNewRegularRecord(FormHistoryRepositorySession.java:510)
                                                                            at org.mozilla.gecko.sync.repositories.android.FormHistoryRepositorySession$8.run(FormHistoryRepositorySession.java:637)
                                                                            at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1113)
                                                                            at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:588)
                                                                            at java.lang.Thread.run(Thread.java:818)
09-09 15:20:28.480 13238-15549/org.mozilla.fennec_grisha E/FormHistoryProvider: Error in database BULKINSERT
                                                                                org.mozilla.gecko.sqlite.SQLiteBridgeException: setTransactionSuccessful called outside a transaction
                                                                                    at org.mozilla.gecko.sqlite.SQLiteBridge.setTransactionSuccessful(SQLiteBridge.java:325)
                                                                                    at org.mozilla.gecko.db.SQLiteBridgeContentProvider.bulkInsert(SQLiteBridgeContentProvider.java:371)
                                                                                    at android.content.ContentProvider$Transport.bulkInsert(ContentProvider.java:278)
                                                                                    at android.content.ContentProviderClient.bulkInsert(ContentProviderClient.java:244)
                                                                                    at org.mozilla.gecko.sync.repositories.android.FormHistoryRepositorySession.flushInsertQueue(FormHistoryRepositorySession.java:472)
                                                                                    at org.mozilla.gecko.sync.repositories.android.FormHistoryRepositorySession.insertNewRegularRecord(FormHistoryRepositorySession.java:510)
                                                                                    at org.mozilla.gecko.sync.repositories.android.FormHistoryRepositorySession$8.run(FormHistoryRepositorySession.java:637)
                                                                                    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1113)
                                                                                    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:588)
                                                                                    at java.lang.Thread.run(Thread.java:818)
09-09 15:20:28.480 13238-15549/org.mozilla.fennec_grisha W/GeckoLogger: fennec_grisha :: SynchronizerSession :: First RecordsChannel onFlowStoreFailed. Logging local store error.
                                                                        org.mozilla.gecko.sqlite.SQLiteBridgeException: setTransactionSuccessful called outside a transaction
                                                                            at org.mozilla.gecko.sqlite.SQLiteBridge.setTransactionSuccessful(SQLiteBridge.java:325)
                                                                            at org.mozilla.gecko.db.SQLiteBridgeContentProvider.bulkInsert(SQLiteBridgeContentProvider.java:371)
                                                                            at android.content.ContentProvider$Transport.bulkInsert(ContentProvider.java:278)
                                                                            at android.content.ContentProviderClient.bulkInsert(ContentProviderClient.java:244)
                                                                            at org.mozilla.gecko.sync.repositories.android.FormHistoryRepositorySession.flushInsertQueue(FormHistoryRepositorySession.java:472)
                                                                            at org.mozilla.gecko.sync.repositories.android.FormHistoryRepositorySession.insertNewRegularRecord(FormHistoryRepositorySession.java:510)
                                                                            at org.mozilla.gecko.sync.repositories.android.FormHistoryRepositorySession$8.run(FormHistoryRepositorySession.java:637)
                                                                            at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1113)
                                                                            at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:588)
                                                                            at java.lang.Thread.run(Thread.java:818)
09-09 15:20:29.115 13238-15564/org.mozilla.fennec_grisha E/FormHistoryProvider: Error in database BULKINSERT
                                                                                org.mozilla.gecko.sqlite.SQLiteBridgeException: Nested transactions are not supported
                                                                                    at org.mozilla.gecko.sqlite.SQLiteBridge.beginTransaction(SQLiteBridge.java:290)
                                                                                    at org.mozilla.gecko.db.SQLiteBridgeContentProvider.bulkInsert(SQLiteBridgeContentProvider.java:363)
                                                                                    at android.content.ContentProvider$Transport.bulkInsert(ContentProvider.java:278)
                                                                                    at android.content.ContentProviderClient.bulkInsert(ContentProviderClient.java:244)
                                                                                    at org.mozilla.gecko.sync.repositories.android.FormHistoryRepositorySession.flushInsertQueue(FormHistoryRepositorySession.java:472)
                                                                                    at org.mozilla.gecko.sync.repositories.android.FormHistoryRepositorySession$7.run(FormHistoryRepositorySession.java:487)
                                                                                    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1113)
                                                                                    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:588)
                                                                                    at java.lang.Thread.run(Thread.java:818)
09-09 15:20:29.117 13238-15564/org.mozilla.fennec_grisha W/GeckoLogger: fennec_grisha :: SynchronizerSession :: First RecordsChannel onFlowStoreFailed. Logging local store error.
                                                                        org.mozilla.gecko.sqlite.SQLiteBridgeException: Nested transactions are not supported
                                                                            at org.mozilla.gecko.sqlite.SQLiteBridge.beginTransaction(SQLiteBridge.java:290)
                                                                            at org.mozilla.gecko.db.SQLiteBridgeContentProvider.bulkInsert(SQLiteBridgeContentProvider.java:363)
                                                                            at android.content.ContentProvider$Transport.bulkInsert(ContentProvider.java:278)
                                                                            at android.content.ContentProviderClient.bulkInsert(ContentProviderClient.java:244)
                                                                            at org.mozilla.gecko.sync.repositories.android.FormHistoryRepositorySession.flushInsertQueue(FormHistoryRepositorySession.java:472)
                                                                            at org.mozilla.gecko.sync.repositories.android.FormHistoryRepositorySession$7.run(FormHistoryRepositorySession.java:487)
                                                                            at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1113)
                                                                            at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:588)
                                                                            at java.lang.Thread.run(Thread.java:818)
09-09 15:20:29.871 13238-15549/org.mozilla.fennec_grisha E/FormHistoryProvider: Error in database BULKINSERT
                                                                                org.mozilla.gecko.sqlite.SQLiteBridgeException: setTransactionSuccessful called outside a transaction
                                                                                    at org.mozilla.gecko.sqlite.SQLiteBridge.setTransactionSuccessful(SQLiteBridge.java:325)
                                                                                    at org.mozilla.gecko.db.SQLiteBridgeContentProvider.bulkInsert(SQLiteBridgeContentProvider.java:371)
                                                                                    at android.content.ContentProvider$Transport.bulkInsert(ContentProvider.java:278)
                                                                                    at android.content.ContentProviderClient.bulkInsert(ContentProviderClient.java:244)
                                                                                    at org.mozilla.gecko.sync.repositories.android.FormHistoryRepositorySession.flushInsertQueue(FormHistoryRepositorySession.java:472)
                                                                                    at org.mozilla.gecko.sync.repositories.android.FormHistoryRepositorySession$7.run(FormHistoryRepositorySession.java:487)
                                                                                    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1113)
                                                                                    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:588)
                                                                                    at java.lang.Thread.run(Thread.java:818)
09-09 15:20:29.872 13238-15549/org.mozilla.fennec_grisha W/GeckoLogger: fennec_grisha :: SynchronizerSession :: First RecordsChannel onFlowStoreFailed. Logging local store error.
                                                                        org.mozilla.gecko.sqlite.SQLiteBridgeException: setTransactionSuccessful called outside a transaction
                                                                            at org.mozilla.gecko.sqlite.SQLiteBridge.setTransactionSuccessful(SQLiteBridge.java:325)
                                                                            at org.mozilla.gecko.db.SQLiteBridgeContentProvider.bulkInsert(SQLiteBridgeContentProvider.java:371)
                                                                            at android.content.ContentProvider$Transport.bulkInsert(ContentProvider.java:278)
                                                                            at android.content.ContentProviderClient.bulkInsert(ContentProviderClient.java:244)
                                                                            at org.mozilla.gecko.sync.repositories.android.FormHistoryRepositorySession.flushInsertQueue(FormHistoryRepositorySession.java:472)
                                                                            at org.mozilla.gecko.sync.repositories.android.FormHistoryRepositorySession$7.run(FormHistoryRepositorySession.java:487)
                                                                            at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1113)
                                                                            at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:588)
                                                                            at java.lang.Thread.run(Thread.java:818)
Priority: -- → P2
This needs more investigation. I haven't seen this crop up, but things like

org.mozilla.gecko.sqlite.SQLiteBridgeException: setTransactionSuccessful called outside a transaction

certainly indicate that something is getting pretty screwed up.

I'm somewhat inclined to move formhistory data accessor away from using bulkInsert and towards a custom call() which will perform the work in a single transaction (similarly to how history gets mass-inserted from sync now).
Product: Android Background Services → Firefox for Android
We have completed our launch of our new Firefox on Android. The development of the new versions use GitHub for issue tracking. If the bug report still reproduces in a current version of [Firefox on Android nightly](https://play.google.com/store/apps/details?id=org.mozilla.fenix) an issue can be reported at the [Fenix GitHub project](https://github.com/mozilla-mobile/fenix/). If you want to discuss your report please use [Mozilla's chat](https://wiki.mozilla.org/Matrix#Connect_to_Matrix) server https://chat.mozilla.org and join the [#fenix](https://chat.mozilla.org/#/room/#fenix:mozilla.org) channel.
Status: NEW → RESOLVED
Closed: 3 years ago
Resolution: --- → INCOMPLETE
Product: Firefox for Android → Firefox for Android Graveyard
You need to log in before you can comment on or make changes to this bug.