Lots of errors after archiving a large number of emails

Description

Over the weekend, I used Thunderbird to archive emails from 2007 to 2014 into archive folders by year (Archive/2007, Archive/2008, etc). This moved tens of thousands of emails from the inbox into other folders.

Today, another PC I use Mailspring on is constantly throwing errors:
image

There are 15 “database is locked” C++ errors in the Mailsync logs, eg:

20428 [2021-03-29 12:57:31.308] [background] [info] - Building queries for range 255823-255823
20428 [2021-03-29 12:57:31.308] [background] [info] - Building queries for range 255876-255876
20428 [2021-03-29 12:57:31.308] [background] [info] - Building queries for range 255892-255892
20428 [2021-03-29 12:57:31.308] [background] [info] - Building queries for range 255933-255933
20428 [2021-03-29 12:57:31.308] [background] [info] - Building queries for range 255953-255953
20428 [2021-03-29 12:57:31.308] [background] [info] - Building queries for range 255973-255973
20428 [2021-03-29 12:57:31.308] [background] [info] - Building queries for range 256014-256015
20428 [2021-03-29 12:57:31.308] [background] [info] - Building queries for range 256024-256024
20428 [2021-03-29 12:57:31.308] [background] [info] Unlinking messages  WHERE remoteFolderId = ? AND remoteUID < ? no longer present in remote range.
20428 [2021-03-29 12:57:31.487] [foreground] [info] syncFolderChangesViaCondstore - Changes since HMODSEQ 259988: 453 changed, 65597 vanished
20428 [2021-03-29 12:57:31.523] [foreground] [info] - Updating message N9qzCWvfwVYtH4mAkCHYbmbGy3qRck4Csea9PJumU
20428 [2021-03-29 12:57:31.523] [foreground] [info] -- UID (256068 to 256050)
20428 [2021-03-29 12:57:32.135] [background] [info] -- 0 matches.
20428 [2021-03-29 12:57:32.135] [background] [warning] [SLOW] Transaction=unlinkMessagesMatchingQuery > 80ms (826ms, 0 waiting to aquire)
20428 [2021-03-29 12:57:32.135] [background] [info] Unlinking messages  WHERE remoteFolderId = ? AND remoteUID < ? no longer present in remote range.
20428 [2021-03-29 12:57:33.041] [background] [info] -- 0 matches.
20428 [2021-03-29 12:57:33.041] [background] [warning] [SLOW] Transaction=unlinkMessagesMatchingQuery > 80ms (905ms, 0 waiting to aquire)
20428 [2021-03-29 12:57:33.041] [background] [info] Unlinking messages  WHERE remoteFolderId = ? AND remoteUID < ? no longer present in remote range.
20428 [2021-03-29 12:57:33.857] [background] [info] -- 0 matches.
20428 [2021-03-29 12:57:33.857] [background] [warning] [SLOW] Transaction=unlinkMessagesMatchingQuery > 80ms (816ms, 0 waiting to aquire)
20428 [2021-03-29 12:57:33.857] [background] [info] Unlinking messages  WHERE remoteFolderId = ? AND remoteUID < ? no longer present in remote range.
20428 [2021-03-29 12:57:34.730] [background] [info] -- 0 matches.
20428 [2021-03-29 12:57:34.730] [background] [warning] [SLOW] Transaction=unlinkMessagesMatchingQuery > 80ms (872ms, 0 waiting to aquire)
20428 [2021-03-29 12:57:34.730] [background] [info] Unlinking messages  WHERE remoteFolderId = ? AND remoteUID < ? no longer present in remote range.
20428 [2021-03-29 12:57:35.545] [background] [info] -- 0 matches.
20428 [2021-03-29 12:57:35.545] [background] [warning] [SLOW] Transaction=unlinkMessagesMatchingQuery > 80ms (815ms, 0 waiting to aquire)
20428 [2021-03-29 12:57:35.545] [background] [info] Unlinking messages  WHERE remoteFolderId = ? AND remoteUID < ? no longer present in remote range.
20428 [2021-03-29 12:57:36.441] [background] [info] -- 0 matches.
20428 [2021-03-29 12:57:36.441] [background] [warning] [SLOW] Transaction=unlinkMessagesMatchingQuery > 80ms (895ms, 0 waiting to aquire)
20428 [2021-03-29 12:57:36.441] [background] [info] Unlinking messages  WHERE remoteFolderId = ? AND remoteUID < ? no longer present in remote range.
20428 [2021-03-29 12:57:36.853] [metadata] [info] Will retry in 3 sec.
20428 [2021-03-29 12:57:37.199] [background] [info] -- 0 matches.
20428 [2021-03-29 12:57:37.199] [background] [warning] [SLOW] Transaction=unlinkMessagesMatchingQuery > 80ms (758ms, 0 waiting to aquire)
20428 [2021-03-29 12:57:37.199] [background] [info] Unlinking messages  WHERE remoteFolderId = ? AND remoteUID < ? no longer present in remote range.
20428 [2021-03-29 12:57:38.159] [background] [info] -- 0 matches.
20428 [2021-03-29 12:57:38.159] [background] [warning] [SLOW] Transaction=unlinkMessagesMatchingQuery > 80ms (959ms, 0 waiting to aquire)
20428 [2021-03-29 12:57:38.159] [background] [info] Unlinking messages  WHERE remoteFolderId = ? AND remoteUID < ? no longer present in remote range.
20428 [2021-03-29 12:57:39.013] [background] [info] -- 0 matches.
20428 [2021-03-29 12:57:39.013] [background] [warning] [SLOW] Transaction=unlinkMessagesMatchingQuery > 80ms (854ms, 0 waiting to aquire)
20428 [2021-03-29 12:57:39.013] [background] [info] Unlinking messages  WHERE remoteFolderId = ? AND remoteUID < ? no longer present in remote range.
20428 [2021-03-29 12:57:39.870] [background] [info] -- 0 matches.
20428 [2021-03-29 12:57:39.870] [background] [warning] [SLOW] Transaction=unlinkMessagesMatchingQuery > 80ms (856ms, 0 waiting to aquire)
20428 [2021-03-29 12:57:39.870] [background] [info] Unlinking messages  WHERE remoteFolderId = ? AND remoteUID < ? no longer present in remote range.
20428 [2021-03-29 12:57:40.710] [background] [info] -- 0 matches.
20428 [2021-03-29 12:57:40.710] [background] [warning] [SLOW] Transaction=unlinkMessagesMatchingQuery > 80ms (839ms, 0 waiting to aquire)
20428 [2021-03-29 12:57:40.710] [background] [info] Unlinking messages  WHERE remoteFolderId = ? AND remoteUID < ? no longer present in remote range.
20428 [2021-03-29 12:57:41.547] [background] [info] -- 0 matches.
20428 [2021-03-29 12:57:41.547] [background] [warning] [SLOW] Transaction=unlinkMessagesMatchingQuery > 80ms (837ms, 0 waiting to aquire)
20428 [2021-03-29 12:57:41.547] [background] [info] Unlinking messages  WHERE remoteFolderId = ? AND remoteUID < ? no longer present in remote range.
20428 [2021-03-29 12:57:42.464] [background] [info] -- 0 matches.
20428 [2021-03-29 12:57:42.464] [background] [warning] [SLOW] Transaction=unlinkMessagesMatchingQuery > 80ms (917ms, 0 waiting to aquire)
20428 [2021-03-29 12:57:42.464] [background] [info] Unlinking messages  WHERE remoteFolderId = ? AND remoteUID < ? no longer present in remote range.
20428 [2021-03-29 12:57:42.500] [metadata] [info] Will retry in 5 sec.
20428 [2021-03-29 12:57:42.555] [foreground] [critical] 
***
*** Mailspring Sync 
*** A C++ exception occurred during program execution: 
*** database is locked
***
32736 [2021-03-29 12:57:57.449] [background] [warning] [SLOW] Transaction=unlinkMessagesMatchingQuery > 80ms (764ms, 0 waiting to aquire)
32736 [2021-03-29 12:57:57.449] [background] [info] Unlinking messages  WHERE remoteFolderId = ? AND remoteUID < ? no longer present in remote range.
32736 [2021-03-29 12:57:58.216] [metadata] [info] Will retry in 5 sec.
32736 [2021-03-29 12:57:58.260] [background] [info] -- 0 matches.
32736 [2021-03-29 12:57:58.260] [background] [warning] [SLOW] Transaction=unlinkMessagesMatchingQuery > 80ms (810ms, 0 waiting to aquire)
32736 [2021-03-29 12:57:58.260] [background] [info] Unlinking messages  WHERE remoteFolderId = ? AND remoteUID < ? no longer present in remote range.
32736 [2021-03-29 12:57:58.331] [foreground] [critical] 
***
*** Mailspring Sync 
*** A C++ exception occurred during program execution: 
*** database is locked
***
19880 [2021-03-29 12:58:43.859] [background] [warning] [SLOW] Transaction=unlinkMessagesMatchingQuery > 80ms (768ms, 0 waiting to aquire)
19880 [2021-03-29 12:58:43.859] [background] [info] Unlinking messages  WHERE remoteFolderId = ? AND remoteUID < ? no longer present in remote range.
19880 [2021-03-29 12:58:44.651] [background] [info] -- 0 matches.
19880 [2021-03-29 12:58:44.652] [background] [warning] [SLOW] Transaction=unlinkMessagesMatchingQuery > 80ms (792ms, 0 waiting to aquire)
19880 [2021-03-29 12:58:44.652] [background] [info] Unlinking messages  WHERE remoteFolderId = ? AND remoteUID < ? no longer present in remote range.
19880 [2021-03-29 12:58:45.434] [background] [info] -- 0 matches.
19880 [2021-03-29 12:58:45.434] [background] [warning] [SLOW] Transaction=unlinkMessagesMatchingQuery > 80ms (782ms, 0 waiting to aquire)
19880 [2021-03-29 12:58:45.435] [background] [info] Unlinking messages  WHERE remoteFolderId = ? AND remoteUID < ? no longer present in remote range.
19880 [2021-03-29 12:58:45.948] [metadata] [info] Will retry in 5 sec.
19880 [2021-03-29 12:58:46.010] [foreground] [critical] 
***
*** Mailspring Sync 
*** A C++ exception occurred during program execution: 
*** database is locked
***
5840 [2021-03-29 09:51:49.645] [foreground] [warning] [SLOW] Transaction=unlinkMessagesMatchingQuery > 80ms (1048ms, 0 waiting to aquire)
5840 [2021-03-29 09:51:49.650] [foreground] [info] Unlinking messages  WHERE remoteFolderId = ? AND remoteUID < ? no longer present in remote range.
5840 [2021-03-29 09:51:50.289] [background] [info] -- 0 matches.
5840 [2021-03-29 09:51:50.289] [background] [warning] [SLOW] Transaction=unlinkMessagesMatchingQuery > 80ms (3873ms, 3107 waiting to aquire)
5840 [2021-03-29 09:51:50.289] [background] [info] Unlinking messages  WHERE remoteFolderId = ? AND remoteUID < ? no longer present in remote range.
5840 [2021-03-29 09:51:51.037] [background] [info] -- 0 matches.
5840 [2021-03-29 09:51:51.037] [background] [warning] [SLOW] Transaction=unlinkMessagesMatchingQuery > 80ms (747ms, 0 waiting to aquire)
5840 [2021-03-29 09:51:51.037] [background] [info] Unlinking messages  WHERE remoteFolderId = ? AND remoteUID < ? no longer present in remote range.
5840 [2021-03-29 09:51:51.731] [background] [info] -- 107 matches.
5840 [2021-03-29 09:51:51.796] [background] [warning] [SLOW] Transaction=unlinkMessagesMatchingQuery > 80ms (759ms, 0 waiting to aquire)
5840 [2021-03-29 09:51:51.797] [background] [info] Unlinking messages  WHERE remoteFolderId = ? AND remoteUID < ? no longer present in remote range.
5840 [2021-03-29 09:51:52.546] [background] [info] -- 114 matches.
5840 [2021-03-29 09:51:52.608] [background] [warning] [SLOW] Transaction=unlinkMessagesMatchingQuery > 80ms (811ms, 0 waiting to aquire)
5840 [2021-03-29 09:51:52.609] [background] [info] Unlinking messages  WHERE remoteFolderId = ? AND remoteUID < ? no longer present in remote range.
5840 [2021-03-29 09:51:58.216] [background] [info] -- 176642 matches.
5840 [2021-03-29 09:52:00.920] [foreground] [critical] 
***
*** Mailspring Sync 
*** A C++ exception occurred during program execution: 
*** database is locked

Full log: https://d.ls/mailspring/large-changes-bug.log

I totally deleted the account from Mailspring and re-added it, which should hopefully resync everything and fix this. I guess the “rebuild cache” option might have helped too (but I forgot to try it)

To Reproduce…

Steps to reproduce the behavior:

  1. Move a LOT of emails around in a different email client
  2. Try to use Mailspring

Expected Behavior

It should handle this properly.

Screenshots

As above

Setup

  • OS and Version: Windows 10, 20H2
    • Installation Method: Windows Installer
  • Mailspring Version: 1.8.0

Totally removing the account then re-adding it seemed to work yesterday, but I’m hitting these errors again today

Here’s some parts of today’s log:

1088 [2021-03-30 10:07:17.811] [foreground] [info] - Building queries for range 255660-255660
1088 [2021-03-30 10:07:17.811] [foreground] [info] - Building queries for range 255663-255663
1088 [2021-03-30 10:07:17.811] [foreground] [info] - Building queries for range 255686-255686
1088 [2021-03-30 10:07:17.811] [foreground] [info] - Building queries for range 255715-255715
1088 [2021-03-30 10:07:17.811] [foreground] [info] - Building queries for range 255719-255719
1088 [2021-03-30 10:07:17.811] [foreground] [info] - Building queries for range 255799-255800
1088 [2021-03-30 10:07:17.811] [foreground] [info] - Building queries for range 255823-255823
1088 [2021-03-30 10:07:17.811] [foreground] [info] - Building queries for range 255876-255876
1088 [2021-03-30 10:07:17.811] [foreground] [info] - Building queries for range 255892-255892
1088 [2021-03-30 10:07:17.811] [foreground] [info] - Building queries for range 255933-255933
1088 [2021-03-30 10:07:17.811] [foreground] [info] - Building queries for range 255953-255953
1088 [2021-03-30 10:07:17.811] [foreground] [info] - Building queries for range 255973-255973
1088 [2021-03-30 10:07:17.811] [foreground] [info] - Building queries for range 256014-256015
1088 [2021-03-30 10:07:17.811] [foreground] [info] - Building queries for range 256024-256024
1088 [2021-03-30 10:07:17.811] [foreground] [info] - Building queries for range 256169-256169
1088 [2021-03-30 10:07:17.811] [foreground] [info] - Building queries for range 256183-256183
1088 [2021-03-30 10:07:17.811] [foreground] [info] - Building queries for range 256194-256194
1088 [2021-03-30 10:07:17.811] [foreground] [info] - Building queries for range 256209-256209
1088 [2021-03-30 10:07:17.812] [foreground] [info] Unlinking messages  WHERE remoteFolderId = ? AND remoteUID < ? no longer present in remote range.
1088 [2021-03-30 10:07:18.517] [background] [info] -- 0 matches.
1088 [2021-03-30 10:07:18.517] [background] [warning] [SLOW] Transaction=unlinkMessagesMatchingQuery > 80ms (718ms, 0 waiting to aquire)
1088 [2021-03-30 10:07:18.517] [background] [info] Unlinking messages  WHERE remoteFolderId = ? AND remoteUID < ? no longer present in remote range.
1088 [2021-03-30 10:07:19.207] [background] [info] -- 0 matches.
1088 [2021-03-30 10:07:19.207] [background] [warning] [SLOW] Transaction=unlinkMessagesMatchingQuery > 80ms (689ms, 0 waiting to aquire)
1088 [2021-03-30 10:07:19.207] [background] [info] Unlinking messages  WHERE remoteFolderId = ? AND remoteUID < ? no longer present in remote range.
1088 [2021-03-30 10:07:19.912] [background] [info] -- 0 matches.
1088 [2021-03-30 10:07:19.912] [background] [warning] [SLOW] Transaction=unlinkMessagesMatchingQuery > 80ms (704ms, 0 waiting to aquire)
1088 [2021-03-30 10:07:19.912] [background] [info] Unlinking messages  WHERE remoteFolderId = ? AND remoteUID < ? no longer present in remote range.
1088 [2021-03-30 10:07:20.625] [background] [info] -- 0 matches.
1088 [2021-03-30 10:07:20.625] [background] [warning] [SLOW] Transaction=unlinkMessagesMatchingQuery > 80ms (713ms, 0 waiting to aquire)
1088 [2021-03-30 10:07:20.625] [background] [info] Unlinking messages  WHERE remoteFolderId = ? AND remoteUID < ? no longer present in remote range.
1088 [2021-03-30 10:07:21.349] [background] [info] -- 0 matches.
1088 [2021-03-30 10:07:21.349] [background] [warning] [SLOW] Transaction=unlinkMessagesMatchingQuery > 80ms (723ms, 0 waiting to aquire)
1088 [2021-03-30 10:07:21.349] [background] [info] Unlinking messages  WHERE remoteFolderId = ? AND remoteUID < ? no longer present in remote range.
1088 [2021-03-30 10:07:22.047] [background] [info] -- 0 matches.
1088 [2021-03-30 10:07:22.047] [background] [warning] [SLOW] Transaction=unlinkMessagesMatchingQuery > 80ms (697ms, 0 waiting to aquire)
1088 [2021-03-30 10:07:22.047] [background] [info] Unlinking messages  WHERE remoteFolderId = ? AND remoteUID < ? no longer present in remote range.
1088 [2021-03-30 10:07:22.744] [background] [info] -- 0 matches.
1088 [2021-03-30 10:07:22.744] [background] [warning] [SLOW] Transaction=unlinkMessagesMatchingQuery > 80ms (697ms, 0 waiting to aquire)
1088 [2021-03-30 10:07:22.744] [background] [info] Unlinking messages  WHERE remoteFolderId = ? AND remoteUID < ? no longer present in remote range.
1088 [2021-03-30 10:07:23.134] [metadata] [info] Will retry in 3 sec.
1088 [2021-03-30 10:07:23.473] [background] [info] -- 0 matches.
1088 [2021-03-30 10:07:23.473] [background] [warning] [SLOW] Transaction=unlinkMessagesMatchingQuery > 80ms (728ms, 0 waiting to aquire)
1088 [2021-03-30 10:07:23.473] [background] [info] Unlinking messages  WHERE remoteFolderId = ? AND remoteUID < ? no longer present in remote range.
1088 [2021-03-30 10:07:24.191] [background] [info] -- 0 matches.
1088 [2021-03-30 10:07:24.191] [background] [warning] [SLOW] Transaction=unlinkMessagesMatchingQuery > 80ms (717ms, 0 waiting to aquire)
1088 [2021-03-30 10:07:24.191] [background] [info] Unlinking messages  WHERE remoteFolderId = ? AND remoteUID < ? no longer present in remote range.
1088 [2021-03-30 10:07:24.876] [background] [info] -- 0 matches.
1088 [2021-03-30 10:07:24.876] [background] [warning] [SLOW] Transaction=unlinkMessagesMatchingQuery > 80ms (685ms, 0 waiting to aquire)
1088 [2021-03-30 10:07:24.876] [background] [info] Unlinking messages  WHERE remoteFolderId = ? AND remoteUID < ? no longer present in remote range.
1088 [2021-03-30 10:07:25.557] [background] [info] -- 0 matches.
1088 [2021-03-30 10:07:25.557] [background] [warning] [SLOW] Transaction=unlinkMessagesMatchingQuery > 80ms (681ms, 0 waiting to aquire)
1088 [2021-03-30 10:07:25.557] [background] [info] Unlinking messages  WHERE remoteFolderId = ? AND remoteUID < ? no longer present in remote range.
1088 [2021-03-30 10:07:26.309] [background] [info] -- 1 matches.
1088 [2021-03-30 10:07:26.309] [background] [info] -- Unlinking "[New comment] How fast are Melbourne's ticket gates?" (egiUkdbxBWaJTdQdARKWe7Wg934yJV3wUmwpPfCo8)
1088 [2021-03-30 10:07:26.311] [background] [warning] [SLOW] Transaction=unlinkMessagesMatchingQuery > 80ms (753ms, 0 waiting to aquire)
1088 [2021-03-30 10:07:26.311] [background] [info] Unlinking messages  WHERE remoteFolderId = ? AND remoteUID < ? no longer present in remote range.
1088 [2021-03-30 10:07:27.021] [background] [info] -- 1 matches.
1088 [2021-03-30 10:07:27.021] [background] [info] -- Unlinking "[daniel15] Re: Twitter autoreply bot - DBZNappa" (khdUydGFQdeBGCrDkghwjLdWzh5HrnV7EcUJpUj1u)
1088 [2021-03-30 10:07:27.027] [background] [warning] [SLOW] Transaction=unlinkMessagesMatchingQuery > 80ms (715ms, 0 waiting to aquire)
1088 [2021-03-30 10:07:27.027] [background] [info] Unlinking messages  WHERE remoteFolderId = ? AND remoteUID < ? no longer present in remote range.
1088 [2021-03-30 10:07:27.724] [background] [info] -- 4 matches.
1088 [2021-03-30 10:07:27.724] [background] [info] -- Unlinking "[New comment] Cookie based TempData provider" (mvpQU5pJv585qSTSDtpnw1DTsbUbz3ehjY34fvqFq)
1088 [2021-03-30 10:07:27.725] [background] [info] -- Unlinking "[New comment] Cookie based TempData provider" (P6a8dMa85u5DNNsgvijkYdy5xJtykXQpiELMd9R1B)
1088 [2021-03-30 10:07:27.726] [background] [info] -- Unlinking "[New comment] Cookie based TempData provider" (sdp7Vcdot47XYyfQ2uZfoazmHM5TDQJKqw8jJoqjQ)
1088 [2021-03-30 10:07:27.727] [background] [info] -- Unlinking "[New comment] Cookie based TempData provider" (XF71rKN9XjxFbBdQ73Q2YMNUVy3BPNArRNNqWh5vT)
1088 [2021-03-30 10:07:27.728] [background] [warning] [SLOW] Transaction=unlinkMessagesMatchingQuery > 80ms (700ms, 0 waiting to aquire)
1088 [2021-03-30 10:07:27.728] [background] [info] Unlinking messages  WHERE remoteFolderId = ? AND remoteUID < ? no longer present in remote range.
1088 [2021-03-30 10:07:28.436] [background] [warning] [SLOW] Transaction=unlinkMessagesMatchingQuery > 80ms (708ms, 0 waiting to aquire)
1088 [2021-03-30 10:07:28.436] [background] [info] Unlinking messages  WHERE remoteFolderId = ? AND remoteUID < ? no longer present in remote range.
1088 [2021-03-30 10:07:28.737] [metadata] [info] Will retry in 5 sec.
1088 [2021-03-30 10:07:28.824] [foreground] [critical] 
***
*** Mailspring Sync 
*** A C++ exception occurred during program execution: 
*** database is locked
***
10900 [2021-03-30 10:06:34.043] [foreground] [info] - Building queries for range 255823-255823
10900 [2021-03-30 10:06:34.043] [foreground] [info] - Building queries for range 255876-255876
10900 [2021-03-30 10:06:34.043] [foreground] [info] - Building queries for range 255892-255892
10900 [2021-03-30 10:06:34.043] [foreground] [info] - Building queries for range 255933-255933
10900 [2021-03-30 10:06:34.043] [foreground] [info] - Building queries for range 255953-255953
10900 [2021-03-30 10:06:34.043] [foreground] [info] - Building queries for range 255973-255973
10900 [2021-03-30 10:06:34.043] [foreground] [info] - Building queries for range 256014-256015
10900 [2021-03-30 10:06:34.043] [foreground] [info] - Building queries for range 256024-256024
10900 [2021-03-30 10:06:34.043] [foreground] [info] - Building queries for range 256169-256169
10900 [2021-03-30 10:06:34.043] [foreground] [info] - Building queries for range 256183-256183
10900 [2021-03-30 10:06:34.043] [foreground] [info] - Building queries for range 256194-256194
10900 [2021-03-30 10:06:34.043] [foreground] [info] - Building queries for range 256209-256209
10900 [2021-03-30 10:06:34.043] [foreground] [info] Unlinking messages  WHERE remoteFolderId = ? AND remoteUID < ? no longer present in remote range.
10900 [2021-03-30 10:06:36.048] [metadata] [info] Will retry in 10 sec.
10900 [2021-03-30 10:06:42.608] [background] [critical] 
***
*** Mailspring Sync 
*** A C++ exception occurred during program execution: 
*** database is locked
***
16704 [2021-03-30 12:01:02.417] [foreground] [info] - Building queries for range 255066-255066
16704 [2021-03-30 12:01:02.417] [foreground] [info] - Building queries for range 255068-255068
16704 [2021-03-30 12:01:02.417] [foreground] [info] - Building queries for range 255113-255115
16704 [2021-03-30 12:01:02.417] [foreground] [info] - Building queries for range 255134-255134
16704 [2021-03-30 12:01:02.417] [foreground] [info] - Building queries for range 255137-255137
16704 [2021-03-30 12:01:02.417] [foreground] [info] - Building queries for range 255143-255143
16704 [2021-03-30 12:01:02.417] [foreground] [info] - Building queries for range 255176-255176
16704 [2021-03-30 12:01:02.417] [foreground] [info] - Building queries for range 255236-255236
16704 [2021-03-30 12:01:02.417] [foreground] [info] - Building queries for range 255250-255250
16704 [2021-03-30 12:01:02.417] [foreground] [info] - Building queries for range 255312-255312
16704 [2021-03-30 12:01:02.417] [foreground] [info] - Building queries for range 255323-255323
16704 [2021-03-30 12:01:02.417] [foreground] [info] - Building queries for range 255383-255383
16704 [2021-03-30 12:01:02.417] [foreground] [info] - Building queries for range 255491-255491
16704 [2021-03-30 12:01:02.417] [foreground] [info] - Building queries for range 255500-255500
16704 [2021-03-30 12:01:02.417] [foreground] [info] - Building queries for range 255507-255507
16704 [2021-03-30 12:01:02.417] [foreground] [info] - Building queries for range 255515-255515
16704 [2021-03-30 12:01:02.417] [foreground] [info] - Building queries for range 255547-255547
16704 [2021-03-30 12:01:02.417] [foreground] [info] - Building queries for range 255583-255583
16704 [2021-03-30 12:01:02.417] [foreground] [info] - Building queries for range 255660-255660
16704 [2021-03-30 12:01:02.417] [foreground] [info] - Building queries for range 255663-255663
16704 [2021-03-30 12:01:02.417] [foreground] [info] - Building queries for range 255686-255686
16704 [2021-03-30 12:01:02.417] [foreground] [info] - Building queries for range 255715-255715
16704 [2021-03-30 12:01:02.417] [foreground] [info] - Building queries for range 255719-255719
16704 [2021-03-30 12:01:02.417] [foreground] [info] - Building queries for range 255799-255800
16704 [2021-03-30 12:01:02.417] [foreground] [info] - Building queries for range 255823-255823
16704 [2021-03-30 12:01:02.417] [foreground] [info] - Building queries for range 255876-255876
16704 [2021-03-30 12:01:02.417] [foreground] [info] - Building queries for range 255892-255892
16704 [2021-03-30 12:01:02.417] [foreground] [info] - Building queries for range 255933-255933
16704 [2021-03-30 12:01:02.417] [foreground] [info] - Building queries for range 255953-255953
16704 [2021-03-30 12:01:02.417] [foreground] [info] - Building queries for range 255973-255973
16704 [2021-03-30 12:01:02.417] [foreground] [info] - Building queries for range 256014-256015
16704 [2021-03-30 12:01:02.417] [foreground] [info] - Building queries for range 256024-256024
16704 [2021-03-30 12:01:02.417] [foreground] [info] - Building queries for range 256169-256169
16704 [2021-03-30 12:01:02.417] [foreground] [info] - Building queries for range 256183-256183
16704 [2021-03-30 12:01:02.417] [foreground] [info] - Building queries for range 256194-256194
16704 [2021-03-30 12:01:02.417] [foreground] [info] - Building queries for range 256209-256209
16704 [2021-03-30 12:01:02.418] [foreground] [info] Unlinking messages  WHERE remoteFolderId = ? AND remoteUID < ? no longer present in remote range.
16704 [2021-03-30 12:01:03.129] [background] [info] -- 0 matches.
16704 [2021-03-30 12:01:03.129] [background] [warning] [SLOW] Transaction=unlinkMessagesMatchingQuery > 80ms (801ms, 0 waiting to aquire)
16704 [2021-03-30 12:01:03.129] [background] [info] Unlinking messages  WHERE remoteFolderId = ? AND remoteUID < ? no longer present in remote range.
16704 [2021-03-30 12:01:03.860] [background] [info] -- 0 matches.
16704 [2021-03-30 12:01:03.860] [background] [warning] [SLOW] Transaction=unlinkMessagesMatchingQuery > 80ms (730ms, 0 waiting to aquire)
16704 [2021-03-30 12:01:03.860] [background] [info] Unlinking messages  WHERE remoteFolderId = ? AND remoteUID < ? no longer present in remote range.
16704 [2021-03-30 12:01:04.569] [background] [info] -- 0 matches.
16704 [2021-03-30 12:01:04.569] [background] [warning] [SLOW] Transaction=unlinkMessagesMatchingQuery > 80ms (709ms, 0 waiting to aquire)
16704 [2021-03-30 12:01:04.569] [background] [info] Unlinking messages  WHERE remoteFolderId = ? AND remoteUID < ? no longer present in remote range.
16704 [2021-03-30 12:01:05.354] [background] [info] -- 0 matches.
16704 [2021-03-30 12:01:05.354] [background] [warning] [SLOW] Transaction=unlinkMessagesMatchingQuery > 80ms (785ms, 0 waiting to aquire)
16704 [2021-03-30 12:01:05.354] [background] [info] Unlinking messages  WHERE remoteFolderId = ? AND remoteUID < ? no longer present in remote range.
16704 [2021-03-30 12:01:06.075] [background] [info] -- 0 matches.
16704 [2021-03-30 12:01:06.075] [background] [warning] [SLOW] Transaction=unlinkMessagesMatchingQuery > 80ms (721ms, 0 waiting to aquire)
16704 [2021-03-30 12:01:06.075] [background] [info] Unlinking messages  WHERE remoteFolderId = ? AND remoteUID < ? no longer present in remote range.
16704 [2021-03-30 12:01:06.864] [background] [info] -- 0 matches.
16704 [2021-03-30 12:01:06.864] [background] [warning] [SLOW] Transaction=unlinkMessagesMatchingQuery > 80ms (788ms, 0 waiting to aquire)
16704 [2021-03-30 12:01:06.864] [background] [info] Unlinking messages  WHERE remoteFolderId = ? AND remoteUID < ? no longer present in remote range.
16704 [2021-03-30 12:01:07.602] [background] [info] -- 0 matches.
16704 [2021-03-30 12:01:07.602] [background] [warning] [SLOW] Transaction=unlinkMessagesMatchingQuery > 80ms (737ms, 0 waiting to aquire)
16704 [2021-03-30 12:01:07.602] [background] [info] Unlinking messages  WHERE remoteFolderId = ? AND remoteUID < ? no longer present in remote range.
16704 [2021-03-30 12:01:07.619] [metadata] [info] Will retry in 3 sec.
16704 [2021-03-30 12:01:08.344] [background] [info] -- 0 matches.
16704 [2021-03-30 12:01:08.344] [background] [warning] [SLOW] Transaction=unlinkMessagesMatchingQuery > 80ms (742ms, 0 waiting to aquire)
16704 [2021-03-30 12:01:08.344] [background] [info] Unlinking messages  WHERE remoteFolderId = ? AND remoteUID < ? no longer present in remote range.
16704 [2021-03-30 12:01:09.106] [background] [info] -- 0 matches.
16704 [2021-03-30 12:01:09.107] [background] [warning] [SLOW] Transaction=unlinkMessagesMatchingQuery > 80ms (762ms, 0 waiting to aquire)
16704 [2021-03-30 12:01:09.107] [background] [info] Unlinking messages  WHERE remoteFolderId = ? AND remoteUID < ? no longer present in remote range.
16704 [2021-03-30 12:01:09.881] [background] [info] -- 0 matches.
16704 [2021-03-30 12:01:09.881] [background] [warning] [SLOW] Transaction=unlinkMessagesMatchingQuery > 80ms (774ms, 0 waiting to aquire)
16704 [2021-03-30 12:01:09.881] [background] [info] Unlinking messages  WHERE remoteFolderId = ? AND remoteUID < ? no longer present in remote range.
16704 [2021-03-30 12:01:10.595] [background] [info] -- 0 matches.
16704 [2021-03-30 12:01:10.595] [background] [warning] [SLOW] Transaction=unlinkMessagesMatchingQuery > 80ms (713ms, 0 waiting to aquire)
16704 [2021-03-30 12:01:10.595] [background] [info] Unlinking messages  WHERE remoteFolderId = ? AND remoteUID < ? no longer present in remote range.
16704 [2021-03-30 12:01:11.296] [background] [info] -- 0 matches.
16704 [2021-03-30 12:01:11.296] [background] [warning] [SLOW] Transaction=unlinkMessagesMatchingQuery > 80ms (701ms, 0 waiting to aquire)
16704 [2021-03-30 12:01:11.296] [background] [info] Unlinking messages  WHERE remoteFolderId = ? AND remoteUID < ? no longer present in remote range.
16704 [2021-03-30 12:01:12.088] [background] [info] -- 0 matches.
16704 [2021-03-30 12:01:12.088] [background] [warning] [SLOW] Transaction=unlinkMessagesMatchingQuery > 80ms (791ms, 0 waiting to aquire)
16704 [2021-03-30 12:01:12.088] [background] [info] Unlinking messages  WHERE remoteFolderId = ? AND remoteUID < ? no longer present in remote range.
16704 [2021-03-30 12:01:12.829] [background] [info] -- 0 matches.
16704 [2021-03-30 12:01:12.829] [background] [warning] [SLOW] Transaction=unlinkMessagesMatchingQuery > 80ms (741ms, 0 waiting to aquire)
16704 [2021-03-30 12:01:12.829] [background] [info] Unlinking messages  WHERE remoteFolderId = ? AND remoteUID < ? no longer present in remote range.
16704 [2021-03-30 12:01:13.273] [metadata] [info] Will retry in 5 sec.
16704 [2021-03-30 12:01:13.464] [foreground] [critical] 
***
*** Mailspring Sync 
*** A C++ exception occurred during program execution: 
*** database is locked
***

Is Mailspring perhaps running too many concurrent database writes?

My edgehill.db file is 3.3 GB and the write-ahead log is around 10 MB.

Edit: Using the “Rebuild cache…” option failed with the same error:
image

Just hit this again today after archiving more emails over the weekend. It seems like every time I move a lot of emails around (say more than 1000), I need to remove my account and re-add it to Mailspring for it to behave properly, otherwise the syncing always fails.