Bug: Bookmarks sync fails with: MergeError: Failed to execute SQL string with code 1 (cannot start a transaction within a transaction)
Status: RESOLVED
Priority: P2
Resolution: FIXED
Created: 2020-02-07 05:39:14+00:00
Resolved: 2020-03-13 15:12:38+00:00

This is from JR - my personal profile has also seen this 10 times in total starting Jan 11. Subsequent syncs work fine. If it turns out this is just a fact of life due to bad timing, we shouldn't report it as a failure.

```
1578367911204	Sync.Telemetry	TRACE	observed weave:engine:sync:start bookmarks
1578367911205	Sync.Engine.Bookmarks	DEBUG	Checking if server sync ID 99HiuIbpP1WN matches existing
1578367911205	Sync.Engine.Bookmarks.BookmarkSyncUtils	TRACE	Bookmarks sync ID up-to-date: {"existingSyncId":"99HiuIbpP1WN"}
1578367911208	Sync.Engine.Bookmarks.Mirror	TRACE	Sync ID up-to-date in mirror: {"existingSyncId":"99HiuIbpP1WN"}
1578367911208	Sync.Engine.Bookmarks	INFO	0 outgoing items pre-reconciliation
1578367911210	Sync.Engine.Bookmarks.Tracker	TRACE	onItemChanged: 1998, uri = "about:reader?url=https%3A%2F%2Fstep.state.gov%2FSTEP%2Fpages%2Findividuals%2FItinerary.aspx"
1578367911210	Sync.SyncScheduler	TRACE	Handling weave:engine:score:updated
1578367911211	Sync.Engine.Bookmarks	TRACE	Downloading & applying server changes
1578367911213	Sync.Engine.Bookmarks	INFO	Records: 0 applied, 0 successfully, 0 failed to apply, 0 newly failed to apply, 0 reconciled.
1578367911213	Sync.ErrorHandler	TRACE	Handling weave:engine:sync:applied
1578367911213	Sync.SyncScheduler	TRACE	Handling weave:engine:sync:applied
1578367911213	Sync.SyncScheduler	TRACE	Engine bookmarks successfully applied 0 items.
1578367911213	Sync.Telemetry	TRACE	observed weave:engine:sync:applied bookmarks
1578367911214	Sync.Engine.Bookmarks.Mirror	DEBUG	Merging bookmarks in Rust
1578367911227	Sync.Engine.Bookmarks.Mirror	DEBUG	Building local tree
1578367911238	Sync.Telemetry	TRACE	observed weave:engine:sync:step bookmarks
1578367911238	Sync.Engine.Bookmarks.Mirror	DEBUG	Building remote tree
1578367911250	Sync.Telemetry	TRACE	observed weave:engine:sync:step bookmarks
1578367911250	Sync.Telemetry	TRACE	observed weave:engine:validate:finish bookmarks
1578367911250	Sync.Engine.Bookmarks.Mirror	DEBUG	Building merged tree
1578367911252	Sync.Telemetry	TRACE	observed weave:engine:sync:step bookmarks
1578367911252	Sync.Engine.Bookmarks.Mirror	DEBUG	Applying merged tree
1578367911252	Sync.Engine.Bookmarks.BookmarkSyncUtils	DEBUG	pushChanges: Processed change records: {"weak":0,"skipped":0,"updated":0}
1578367911253	Sync.Engine.Bookmarks	ERROR	Bookmark sync failed, 336231.253000021s elapsed since last run; running Places maintenance



1578367911262	Sync.Engine.Bookmarks.Tracker	TRACE	onItemChanged: 1998, uri = "about:reader?url=https%3A%2F%2Fstep.state.gov%2FSTEP%2Fpages%2Findividuals%2FItinerary.aspx"
1578367911262	Sync.SyncScheduler	TRACE	Handling weave:engine:score:updated
1578367911362	Sync.SyncScheduler	TRACE	clients: score: 0
1578367911362	Sync.SyncScheduler	TRACE	prefs: score: 0
1578367911362	Sync.SyncScheduler	TRACE	passwords: score: 0
1578367911363	Sync.SyncScheduler	TRACE	tabs: score: 0
1578367911363	Sync.SyncScheduler	TRACE	bookmarks: score: 602
1578367911363	Sync.SyncScheduler	TRACE	addons: score: 0
1578367911363	Sync.SyncScheduler	TRACE	forms: score: 0
1578367911363	Sync.SyncScheduler	TRACE	history: score: 1
1578367911363	Sync.SyncScheduler	TRACE	extension-storage: score: 0
1578367911363	Sync.SyncScheduler	TRACE	Global score updated: 603
1578367911363	Sync.SyncScheduler	TRACE	_checkSync returned "".
1578367911363	Sync.SyncScheduler	DEBUG	Next sync in 3600000 ms. (why=schedule)
1578367911370	Sync.Telemetry	TRACE	observed weave:telemetry:event null
1578367911370	Sync.Telemetry	DEBUG	recording event: {"object":"maintenance","method":"run","value":"bookmarks"}
1578367911370	Sync.Engine.Bookmarks	TRACE	Event: weave:engine:sync:error
1578367911371	Sync.ErrorHandler	TRACE	Handling weave:engine:sync:error
1578367911371	Sync.Status	DEBUG	Status for engine bookmarks: error.engine.reason.unknown_fail
1578367911371	Sync.Status	DEBUG	Status.service: success.status_ok => error.sync.failed_partial
1578367911371	Sync.ErrorHandler	DEBUG	bookmarks failed: MergeError: Failed to execute SQL string with code 1 (cannot start a transaction within a transaction)(resource://gre/modules/SyncedBookmarksMirror.jsm:1417:5) JS Stack trace: MergeError@SyncedBookmarksMirror.jsm:1417:5
handleError@SyncedBookmarksMirror.jsm:779:22
1578367911371	Sync.SyncScheduler	TRACE	Handling weave:engine:sync:error
1578367911371	Sync.Telemetry	TRACE	observed weave:engine:sync:error bookmarks
```