Accounts get disconnected after closing Mailspring

Hi Everyone,

Every time I close Mailspring and re-open the program all of my accounts get disconnected. I’m not sure what’s causing this but this did not happen before, seems to be a problem after I’ve updated Mailspring.

All of my email accounts are IMAP and everything is configured correctly. Like I said, everything was working great in the past - seems like the new update is causing this.

Please see the following images.

Screenshot_1

All accounts get disconnected, and I have to Reconnect them every single time I open Mailspring.

Hope there is a solution to this :upside_down_face:

Hey @Ruan-Kuypers thanks for filing this! Is this on Windows or Linux? (Can’t quite tell from the screenshots). If it’s linux, do you know if you installed the app via the debian package or from Snapcraft? It looks like the app must be failing to save your passwords to your system keychain for some reason, will see if we can reproduce this one!

@bengotow Hi there, This is on Windows 10.

I have the same issue on my Ubuntu 20.10, installed with the .deb package. However, only the first of my two GMail accounts gets disconnected.

Here is the Mailsync Log:

Mailspring Version: 1.9.0-7e3448ad
Platform: linux
Account State: sync_error
Account Provider: gmail
IMAP Server: imap.gmail.com
SMTP Server: smtp.gmail.com
--------------------------------------------
6984 [2021-04-15 19:00:35.413] [metadata] [info] Metadata delta stream starting...
6984 [2021-04-15 19:00:38.412] [background] [info] Fetching XOAuth2 access token (gmail) for 8e658ff2
6984 [2021-04-15 19:00:38.524] [background] [info] Marking all folders as `busy`
6984 [2021-04-15 19:00:48.536] [background] [critical] 
***
*** Mailspring Sync 
*** A C++ exception occurred during program execution: 
*** database is locked
***

6984 [2021-04-15 19:00:48.563] [background] [critical] *** Stack trace (line numbers are approximate):
*** ??:?        exceptions::logCurrentExceptionWithStackTrace()
*** ??:?        runBackgroundSyncWorker()
*** main.cpp:?  main::{lambda()#3}::operator()() const
*** main.cpp:?  _Bind_simple::operator()()
*** main.cpp:?  thread::_Impl::_M_run()
*** thread.o:?  execute_native_thread_routine()
***

7000 [2021-04-15 19:00:48.758] [main] [info] Identity created at 1607110723 - using ID Schema 1
7000 [2021-04-15 19:00:48.759] [main] [info] ------------- Starting Sync (XXX@gmail.com) ---------------
7000 [2021-04-15 19:00:48.764] [metadata] [info] Metadata delta stream starting...
7000 [2021-04-15 19:00:51.764] [background] [info] Fetching XOAuth2 access token (gmail) for 8e658ff2
7000 [2021-04-15 19:00:51.888] [background] [info] Marking all folders as `busy`
7000 [2021-04-15 19:01:01.903] [background] [critical] 
***
*** Mailspring Sync 
*** A C++ exception occurred during program execution: 
*** database is locked
***

7000 [2021-04-15 19:01:01.930] [background] [critical] *** Stack trace (line numbers are approximate):
*** ??:?        exceptions::logCurrentExceptionWithStackTrace()
*** ??:?        runBackgroundSyncWorker()
*** main.cpp:?  main::{lambda()#3}::operator()() const
*** main.cpp:?  _Bind_simple::operator()()
*** main.cpp:?  thread::_Impl::_M_run()
*** thread.o:?  execute_native_thread_routine()
***

7016 [2021-04-15 19:01:02.124] [main] [info] Identity created at 1607110723 - using ID Schema 1
7016 [2021-04-15 19:01:02.125] [main] [info] ------------- Starting Sync (XXX@gmail.com) ---------------
7016 [2021-04-15 19:01:02.131] [metadata] [info] Metadata delta stream starting...
7016 [2021-04-15 19:01:05.131] [background] [info] Fetching XOAuth2 access token (gmail) for 8e658ff2
7016 [2021-04-15 19:01:05.255] [background] [info] Marking all folders as `busy`
7016 [2021-04-15 19:01:15.269] [background] [critical] 
***
*** Mailspring Sync 
*** A C++ exception occurred during program execution: 
*** database is locked
***

7016 [2021-04-15 19:01:15.296] [background] [critical] *** Stack trace (line numbers are approximate):
*** ??:?        exceptions::logCurrentExceptionWithStackTrace()
*** ??:?        runBackgroundSyncWorker()
*** main.cpp:?  main::{lambda()#3}::operator()() const
*** main.cpp:?  _Bind_simple::operator()()
*** main.cpp:?  thread::_Impl::_M_run()
*** thread.o:?  execute_native_thread_routine()
***

Gah! I see what happened here - it looks like we upgraded sqlite to support the newer versions of Electron, and it’s complied without HAS_USLEEP, which makes the database lock super quickly when multiple mailsync processes connect to it. It looks like works ok until you link ~4 accounts and then things start timing out.

This is super awful for power users, will get this fixed now and see if we can add a build step that checks the sqlite build…

2 Likes

Hi,
For me, same problem as the OP. I use 3 accounts on Mailspring on kde Neon (ubuntu 20.04 base).
But my Gmail account can’t reconnect.

Log

Mailspring Version: 1.9.0-87660767
Platform: linux
Account State: invalid
Account Provider: gmail
IMAP Server: imap.gmail.com
SMTP Server: smtp.gmail.com

14976 [2021-04-16 09:12:52.413] [main] [info] ------------- Starting Sync (xxx@gmail.com) ---------------
14976 [2021-04-16 09:12:52.420] [background] [info] Fetching XOAuth2 access token (gmail) for efa2e010
14976 [2021-04-16 09:12:53.500] [background] [info] Marking all folders as busy
14976 [2021-04-16 09:12:53.505] [background] [info] Syncing folder list…
14976 [2021-04-16 09:12:54.559] [metadata] [critical]


*** Mailspring Sync
*** An exception occurred during program execution:
*** {“debuginfo”:“https://id.getmailspring.com/deltas/efa2e010/head RETURNED {“statusCode”:401,“error”:“Unauthorized”,“message”:“Bad username or password”,“attributes”:{“error”:“Bad username or password”}}”,“key”:“Invalid Response Code: 401”,“retryable”:false,“what”:“std::exception”}


14976 [2021-04-16 09:12:54.559] [metadata] [critical] *** Stack trace (line numbers are approximate):
*** ??:? ValidateRequestResp(CURLcode, void*, string)
*** ??:? PerformRequest(void*)
*** ??:? PerformJSONRequest(void*)
*** ??:? PerformIdentityRequest(string, string, nlohmann::basic_json const&)
*** ??:? MetadataWorker::fetchDeltaCursor()
*** ??:? MetadataWorker::run()
*** main.cpp:? main::{lambda()#5}::operator()() const
*** main.cpp:? _Bind_simple::operator()()
*** main.cpp:? thread::_Impl::_M_run()
*** thread.o:? execute_native_thread_routine()


14999 [2021-04-16 09:12:54.604] [main] [info] Identity created at 1579876885 - using ID Schema 1
14999 [2021-04-16 09:12:54.605] [main] [info] ------------- Starting Sync (sebastien.hendrick.hermann@gmail.com) ---------------
14999 [2021-04-16 09:12:54.613] [background] [info] Fetching XOAuth2 access token (gmail) for efa2e010
14999 [2021-04-16 09:12:55.408] [background] [info] Marking all folders as busy
14999 [2021-04-16 09:12:55.409] [background] [info] Syncing folder list…
14999 [2021-04-16 09:12:55.787] [metadata] [critical]


*** Mailspring Sync
*** An exception occurred during program execution:
*** {“debuginfo”:“https://id.getmailspring.com/deltas/efa2e010/head RETURNED {“statusCode”:401,“error”:“Unauthorized”,“message”:“Bad username or password”,“attributes”:{“error”:“Bad username or password”}}”,“key”:“Invalid Response Code: 401”,“retryable”:false,“what”:“std::exception”}


14999 [2021-04-16 09:12:55.788] [metadata] [critical] *** Stack trace (line numbers are approximate):
*** ??:? ValidateRequestResp(CURLcode, void*, string)
*** ??:? PerformRequest(void*)
*** ??:? PerformJSONRequest(void*)
*** ??:? PerformIdentityRequest(string, string, nlohmann::basic_json const&)
*** ??:? MetadataWorker::fetchDeltaCursor()
*** ??:? MetadataWorker::run()
*** main.cpp:? main::{lambda()#5}::operator()() const
*** main.cpp:? _Bind_simple::operator()()
*** main.cpp:? thread::_Impl::_M_run()
*** thread.o:? execute_native_thread_routine()


Blockquote
Mailspring Version: 1.9.0-87660767
Platform: linux
Account State: invalid
Account Provider: gmail
IMAP Server: imap.gmail.com
SMTP Server: smtp.gmail.com


14976 [2021-04-16 09:12:52.413] [main] [info] ------------- Starting Sync (sebastien.hendrick.hermann@gmail.com) ---------------
14976 [2021-04-16 09:12:52.420] [background] [info] Fetching XOAuth2 access token (gmail) for efa2e010
14976 [2021-04-16 09:12:53.500] [background] [info] Marking all folders as busy
14976 [2021-04-16 09:12:53.505] [background] [info] Syncing folder list…
14976 [2021-04-16 09:12:54.559] [metadata] [critical]


*** Mailspring Sync
*** An exception occurred during program execution:
*** {“debuginfo”:“https://id.getmailspring.com/deltas/efa2e010/head RETURNED {“statusCode”:401,“error”:“Unauthorized”,“message”:“Bad username or password”,“attributes”:{“error”:“Bad username or password”}}”,“key”:“Invalid Response Code: 401”,“retryable”:false,“what”:“std::exception”}


14976 [2021-04-16 09:12:54.559] [metadata] [critical] *** Stack trace (line numbers are approximate):
*** ??:? ValidateRequestResp(CURLcode, void*, string)
*** ??:? PerformRequest(void*)
*** ??:? PerformJSONRequest(void*)
*** ??:? PerformIdentityRequest(string, string, nlohmann::basic_json const&)
*** ??:? MetadataWorker::fetchDeltaCursor()
*** ??:? MetadataWorker::run()
*** main.cpp:? main::{lambda()#5}::operator()() const
*** main.cpp:? _Bind_simple::operator()()
*** main.cpp:? thread::_Impl::_M_run()
*** thread.o:? execute_native_thread_routine()


14999 [2021-04-16 09:12:54.604] [main] [info] Identity created at 1579876885 - using ID Schema 1
14999 [2021-04-16 09:12:54.605] [main] [info] ------------- Starting Sync (xxx@gmail.com) ---------------
14999 [2021-04-16 09:12:54.613] [background] [info] Fetching XOAuth2 access token (gmail) for efa2e010
14999 [2021-04-16 09:12:55.408] [background] [info] Marking all folders as busy
14999 [2021-04-16 09:12:55.409] [background] [info] Syncing folder list…
14999 [2021-04-16 09:12:55.787] [metadata] [critical]


*** Mailspring Sync
*** An exception occurred during program execution:
*** {“debuginfo”:“https://id.getmailspring.com/deltas/efa2e010/head RETURNED {“statusCode”:401,“error”:“Unauthorized”,“message”:“Bad username or password”,“attributes”:{“error”:“Bad username or password”}}”,“key”:“Invalid Response Code: 401”,“retryable”:false,“what”:“std::exception”}


14999 [2021-04-16 09:12:55.788] [metadata] [critical] *** Stack trace (line numbers are approximate):
*** ??:? ValidateRequestResp(CURLcode, void*, string)
*** ??:? PerformRequest(void*)
*** ??:? PerformJSONRequest(void*)
*** ??:? PerformIdentityRequest(string, string, nlohmann::basic_json const&)
*** ??:? MetadataWorker::fetchDeltaCursor()
*** ??:? MetadataWorker::run()
*** main.cpp:? main::{lambda()#5}::operator()() const
*** main.cpp:? _Bind_simple::operator()()
*** main.cpp:? thread::_Impl::_M_run()
*** thread.o:? execute_native_thread_routine()


My log looks a bit different.

Mailspring Version: 1.9.0-87660767
Platform: win32
Account State: sync_error
Account Provider: imap
IMAP Server: mail.customserver.com
SMTP Server: mail.customserver.com
--------------------------------------------
2836 [2021-04-15 16:14:08.216] [background] [info] syncFolderChangesViaCondstore - INBOX.Mailspring.Snoozed: modseq 1 to 1, uidnext 1 to 1
2836 [2021-04-15 16:14:08.219] [background] [info] syncFolderChangesViaCondstore - INBOX.Sometime: modseq 5 to 5, uidnext 5 to 5
2836 [2021-04-15 16:14:08.222] [background] [info] syncFolderChangesViaCondstore - INBOX.Follow Up: modseq 5 to 5, uidnext 3 to 3
2836 [2021-04-15 16:14:08.225] [background] [info] syncFolderChangesViaCondstore - INBOX.Marketing: modseq 3 to 3, uidnext 3 to 3
2836 [2021-04-15 16:14:08.228] [background] [info] syncFolderChangesViaCondstore - INBOX.Clients: modseq 1 to 1, uidnext 1 to 1
2836 [2021-04-15 16:14:08.231] [background] [info] syncFolderChangesViaCondstore - INBOX.Clients.PRIVATE: modseq 25 to 25, uidnext 17 to 17
2836 [2021-04-15 16:14:08.234] [background] [info] syncFolderChangesViaCondstore - INBOX.Clients.PRIVATE: modseq 68 to 68, uidnext 41 to 41
2836 [2021-04-15 16:14:08.234] [background] [info] Sync loop deleting unlinked messages with phase 1.
2836 [2021-04-15 16:14:08.234] [background] [info] Sync loop complete.
2836 [2021-04-15 16:14:47.259] [foreground] [info] Idle exited with code 1
2836 [2021-04-15 16:14:47.313] [foreground] [info] syncFolderChangesViaCondstore - INBOX: modseq 3449 to 3449, uidnext 1434 to 1434
2836 [2021-04-15 16:14:47.313] [foreground] [info] Idling on folder INBOX
2836 [2021-04-15 16:15:32.551] [foreground] [info] Idle exited with code 0
2836 [2021-04-15 16:15:32.554] [foreground] [info] syncFolderChangesViaCondstore - INBOX: modseq 3449 to 3450, uidnext 1434 to 1435
2836 [2021-04-15 16:15:32.574] [foreground] [info] syncFolderChangesViaCondstore - Changes since HMODSEQ 3449: 1 changed, 0 vanished
2836 [2021-04-15 16:15:32.639] [foreground] [info] Idling on folder INBOX
2836 [2021-04-15 16:15:39.067] [main] [info] [local-976ef08c-ba5c] Running ChangeUnreadTask performLocal:
2836 [2021-04-15 16:15:39.077] [main] [info] [local-976ef08c-ba5c] -- Succeeded. Changing status to `remote`
2836 [2021-04-15 16:15:39.390] [foreground] [info] Idle exited with code 0
2836 [2021-04-15 16:15:39.390] [foreground] [info] [local-976ef08c-ba5c] Running ChangeUnreadTask performRemote:
2836 [2021-04-15 16:15:39.398] [foreground] [info] [local-976ef08c-ba5c] -- Succeeded. Changing status to `complete`
2836 [2021-04-15 16:15:39.402] [foreground] [info] syncFolderChangesViaCondstore - INBOX: modseq 3450 to 3451, uidnext 1435 to 1435
2836 [2021-04-15 16:15:39.405] [foreground] [info] syncFolderChangesViaCondstore - Changes since HMODSEQ 3450: 1 changed, 0 vanished
2836 [2021-04-15 16:15:39.406] [foreground] [info] Idling on folder INBOX
2836 [2021-04-15 16:16:00.476] [metadata] [info] Metadata delta stream closed.
2836 [2021-04-15 16:16:00.477] [metadata] [info] Metadata delta stream starting...

This happens with all 4 of my accounts.

My other accounts give authentication errors

Mailspring Version: 1.9.0-87660767
Platform: win32
Account State: invalid
Account Provider: imap
IMAP Server: mail.privateserver.com
SMTP Server: mail.privateserver.com
--------------------------------------------
***

13812 [2021-04-16 08:53:58.263] [main] [info] Identity created at 1593175754 - using ID Schema 1
13812 [2021-04-16 08:53:58.265] [main] [info] ------------- Starting Sync (hello@privatedomain.com) ---------------
13812 [2021-04-16 08:53:58.268] [background] [info] Marking all folders as `busy`
13812 [2021-04-16 08:53:58.269] [metadata] [info] Metadata delta stream starting...
13812 [2021-04-16 08:53:58.270] [background] [info] Syncing folder list...
13812 [2021-04-16 08:54:04.161] [background] [critical] 
***
*** Mailspring Sync 
*** An exception occurred during program execution: 
*** {"debuginfo":"syncFoldersAndLabels - fetchAllFolders","key":"ErrorAuthentication","retryable":false,"what":"Unknown exception"}
***

14036 [2021-04-16 08:54:09.654] [main] [info] Identity created at 1593175754 - using ID Schema 1
14036 [2021-04-16 08:54:09.656] [main] [info] ------------- Starting Sync (hello@privatedomain.com) ---------------
14036 [2021-04-16 08:54:09.660] [background] [info] Marking all folders as `busy`
14036 [2021-04-16 08:54:09.661] [metadata] [info] Metadata delta stream starting...
14036 [2021-04-16 08:54:09.662] [background] [info] Syncing folder list...
14036 [2021-04-16 08:54:16.290] [background] [critical] 
***
*** Mailspring Sync 
*** An exception occurred during program execution: 
*** {"debuginfo":"syncFoldersAndLabels - fetchAllFolders","key":"ErrorAuthentication","retryable":false,"what":"Unknown exception"}
***

5928 [2021-04-16 08:54:18.484] [main] [info] Identity created at 1593175754 - using ID Schema 1
5928 [2021-04-16 08:54:18.485] [main] [info] ------------- Starting Sync (hello@privatedomain.com) ---------------
5928 [2021-04-16 08:54:18.491] [background] [info] Marking all folders as `busy`
5928 [2021-04-16 08:54:18.491] [metadata] [info] Metadata delta stream starting...
5928 [2021-04-16 08:54:18.493] [background] [info] Syncing folder list...
5928 [2021-04-16 08:54:20.233] [background] [critical] 
***
*** Mailspring Sync 
*** An exception occurred during program execution: 
*** {"debuginfo":"syncFoldersAndLabels - fetchAllFolders","key":"ErrorAuthentication","retryable":false,"what":"Unknown exception"}
***

11488 [2021-04-16 08:54:47.690] [main] [info] Identity created at 1593175754 - using ID Schema 1
11488 [2021-04-16 08:54:47.691] [main] [info] ------------- Starting Sync (hello@privatedomain.com) ---------------
11488 [2021-04-16 08:54:47.695] [background] [info] Marking all folders as `busy`
11488 [2021-04-16 08:54:47.695] [metadata] [info] Metadata delta stream starting...
11488 [2021-04-16 08:54:47.697] [background] [info] Syncing folder list...
11488 [2021-04-16 08:54:49.963] [background] [critical] 
***
*** Mailspring Sync 
*** An exception occurred during program execution: 
*** {"debuginfo":"syncFoldersAndLabels - fetchAllFolders","key":"ErrorAuthentication","retryable":false,"what":"Unknown exception"}
***

Hi, after updating to 1.9.1, same problem : disconnecting after closing.
Log :

Log 1

Mailspring Version: 1.9.1-30ef802f
Platform: linux
Account State: invalid
Account Provider: imap
IMAP Server: mail.zaclys.net
SMTP Server: mail.zaclys.net
*** ??:? PerformRequest(void*)
*** ??:? PerformJSONRequest(void*)
*** ??:? PerformIdentityRequest(string, string, nlohmann::basic_json const&)
*** ??:? MetadataWorker::fetchDeltaCursor()
*** ??:? MetadataWorker::run()
*** main.cpp:? main::{lambda()#5}::operator()() const
*** main.cpp:? _Bind_simple::operator()()
*** main.cpp:? thread::_Impl::_M_run()
*** thread.o:? execute_native_thread_routine()


1949 [2021-04-17 10:45:33.441] [main] [info] Identity created at 1579876885 - using ID Schema 1
1949 [2021-04-17 10:45:33.442] [main] [info] ------------- Starting Sync (xxx@zaclys.net) ---------------
1949 [2021-04-17 10:45:34.685] [metadata] [critical]


*** Mailspring Sync
*** An exception occurred during program execution:
*** {“debuginfo”:“https://id.getmailspring.com/deltas/a02842ac/head RETURNED {“statusCode”:401,“error”:“Unauthorized”,“message”:“Bad username or password”,“attributes”:{“error”:“Bad username or password”}}”,“key”:“Invalid Response Code: 401”,“retryable”:false,“what”:“std::exception”}


1949 [2021-04-17 10:45:34.686] [metadata] [critical] *** Stack trace (line numbers are approximate):
*** ??:? ValidateRequestResp(CURLcode, void*, string)
*** ??:? PerformRequest(void*)
*** ??:? PerformJSONRequest(void*)
*** ??:? PerformIdentityRequest(string, string, nlohmann::basic_json const&)
*** ??:? MetadataWorker::fetchDeltaCursor()
*** ??:? MetadataWorker::run()
*** main.cpp:? main::{lambda()#5}::operator()() const
*** main.cpp:? _Bind_simple::operator()()
*** main.cpp:? thread::_Impl::_M_run()
*** thread.o:? execute_native_thread_routine()


1977 [2021-04-17 10:45:34.700] [main] [info] Identity created at 1579876885 - using ID Schema 1
1977 [2021-04-17 10:45:34.701] [main] [info] ------------- Starting Sync (xxx@zaclys.net) ---------------
1977 [2021-04-17 10:45:35.891] [metadata] [critical]


*** Mailspring Sync
*** An exception occurred during program execution:
*** {“debuginfo”:“https://id.getmailspring.com/deltas/a02842ac/head RETURNED {“statusCode”:401,“error”:“Unauthorized”,“message”:“Bad username or password”,“attributes”:{“error”:“Bad username or password”}}”,“key”:“Invalid Response Code: 401”,“retryable”:false,“what”:“std::exception”}


1977 [2021-04-17 10:45:35.891] [metadata] [critical] *** Stack trace (line numbers are approximate):
*** ??:? ValidateRequestResp(CURLcode, void*, string)
*** ??:? PerformRequest(void*)
*** ??:? PerformJSONRequest(void*)
*** ??:? PerformIdentityRequest(string, string, nlohmann::basic_json const&)
*** ??:? MetadataWorker::fetchDeltaCursor()
*** ??:? MetadataWorker::run()
*** main.cpp:? main::{lambda()#5}::operator()() const
*** main.cpp:? _Bind_simple::operator()()
*** main.cpp:? thread::_Impl::_M_run()
*** thread.o:? execute_native_thread_routine()



I can not connect to my Gmail account (appened also with 1.9.0). I tried to remove and add again the account without success.
Log :

Log2

Mailspring Version: 1.9.1-30ef802f
Platform: linux
Account State: invalid
Account Provider: gmail
IMAP Server: imap.gmail.com
SMTP Server: smtp.gmail.com

*** main.cpp:? _Bind_simple::operator()()
*** main.cpp:? thread::_Impl::_M_run()
*** thread.o:? execute_native_thread_routine()


12519 [2021-04-17 11:46:54.646] [main] [info] Identity created at 1579876885 - using ID Schema 1
12519 [2021-04-17 11:46:54.647] [main] [info] ------------- Starting Sync (xxx@gmail.com) ---------------
12519 [2021-04-17 11:46:54.651] [metadata] [info] Metadata delta stream starting…
12519 [2021-04-17 11:46:54.654] [background] [info] Fetching XOAuth2 access token (gmail) for efa2e010
12519 [2021-04-17 11:46:55.675] [background] [info] Marking all folders as busy
12519 [2021-04-17 11:46:55.676] [background] [info] Syncing folder list…
12519 [2021-04-17 11:46:56.078] [metadata] [info] Metadata delta stream closed.
12519 [2021-04-17 11:46:56.119] [metadata] [critical]


*** Mailspring Sync
*** An exception occurred during program execution:
*** {“debuginfo”:"https://id.getmailspring.com/deltas/efa2e010/streaming?p=linux&ih=imap.gmail.com&cursor=0 RETURNED ",“key”:“Invalid Response Code: 401”,“retryable”:false,“what”:“std::exception”}


12519 [2021-04-17 11:46:56.119] [metadata] [critical] *** Stack trace (line numbers are approximate):
*** ??:? ValidateRequestResp(CURLcode, void*, string)
*** ??:? MetadataWorker::fetchDeltasBlocking()
*** ??:? MetadataWorker::run()
*** main.cpp:? main::{lambda()#5}::operator()() const
*** main.cpp:? _Bind_simple::operator()()
*** main.cpp:? thread::_Impl::_M_run()
*** thread.o:? execute_native_thread_routine()


12544 [2021-04-17 11:46:56.137] [main] [info] Identity created at 1579876885 - using ID Schema 1
12544 [2021-04-17 11:46:56.137] [main] [info] ------------- Starting Sync (xxx@gmail.com) ---------------
12544 [2021-04-17 11:46:56.142] [metadata] [info] Metadata delta stream starting…
12544 [2021-04-17 11:46:56.143] [background] [info] Fetching XOAuth2 access token (gmail) for efa2e010
12544 [2021-04-17 11:46:57.312] [background] [info] Marking all folders as busy
12544 [2021-04-17 11:46:57.313] [background] [info] Syncing folder list…
12544 [2021-04-17 11:46:57.616] [metadata] [info] Metadata delta stream closed.
12544 [2021-04-17 11:46:57.727] [metadata] [critical]


*** Mailspring Sync
*** An exception occurred during program execution:
*** {“debuginfo”:"https://id.getmailspring.com/deltas/efa2e010/streaming?p=linux&ih=imap.gmail.com&cursor=0 RETURNED ",“key”:“Invalid Response Code: 401”,“retryable”:false,“what”:“std::exception”}


12544 [2021-04-17 11:46:57.727] [metadata] [critical] *** Stack trace (line numbers are approximate):
*** ??:? ValidateRequestResp(CURLcode, void*, string)
*** ??:? MetadataWorker::fetchDeltasBlocking()
*** ??:? MetadataWorker::run()
*** main.cpp:? main::{lambda()#5}::operator()() const
*** main.cpp:? _Bind_simple::operator()()
*** main.cpp:? thread::_Impl::_M_run()
*** thread.o:? execute_native_thread_routine()


1 Like

@bengotow

Sorry to say - but the new update did not fix the problem :frowning_face:

My accounts are still being disconnected after I close Mailspring. Is there any way I can help by giving log files or something?

Unfortunately, I also still have the same issue. Here is a new log for it:

5235 [2021-04-18 09:53:03.755] [main] [info] ------------- Starting Sync (XXXXX@gmail.com) ---------------
5235 [2021-04-18 09:53:03.765] [metadata] [info] Metadata delta stream starting...
5235 [2021-04-18 09:53:04.267] [metadata] [info] Received metadata V5 for (message - DLFxR6fiWq2sFBJofXxNibXavgUdGJ88vXeuyfumK)
5235 [2021-04-18 09:53:04.267] [metadata] [info]  -- Saved on to local model.
5235 [2021-04-18 09:53:05.150] [metadata] [warning] [SLOW] Transaction=applyMetadataJSON > 80ms (937ms, 53 waiting to aquire)
5235 [2021-04-18 09:53:05.151] [metadata] [info] Received metadata V5 for (message - DLFxR6fiWq2sFBJofXxNibXavgUdGJ88vXeuyfumK)
5235 [2021-04-18 09:53:05.151] [metadata] [info]  -- Ignored. Local model has >= version.
5235 [2021-04-18 09:53:05.152] [metadata] [info] Received metadata V5 for (message - DLFxR6fiWq2sFBJofXxNibXavgUdGJ88vXeuyfumK)
5235 [2021-04-18 09:53:05.152] [metadata] [info]  -- Ignored. Local model has >= version.
5235 [2021-04-18 09:53:06.760] [background] [info] Fetching XOAuth2 access token (gmail) for 8e658ff2
5235 [2021-04-18 09:53:06.883] [background] [info] Marking all folders as `busy`
5235 [2021-04-18 09:53:06.885] [background] [info] Syncing folder list...
5235 [2021-04-18 09:53:08.291] [background] [info] Syncing folder list...
5235 [2021-04-18 09:53:08.577] [background] [info] syncFolderUIDRange for [Gmail]/Alle Nachrichten, UIDs: 129123 - 129131, Heavy: true
5235 [2021-04-18 09:53:09.311] [background] [info] - remote=1, local=0
5235 [2021-04-18 09:53:09.593] [foreground] [info] syncFolderChangesViaCondstore - [Gmail]/Alle Nachrichten: modseq 10019570 to 10020669, uidnext 129123 to 129131
5235 [2021-04-18 09:53:10.266] [foreground] [info] syncFolderChangesViaCondstore - Changes since HMODSEQ 10019570: 10 changed, 0 vanished
5235 [2021-04-18 09:53:10.412] [background] [warning] [SLOW] Transaction=insertMessage > 80ms (1101ms, 0 waiting to aquire)
5235 [2021-04-18 09:53:10.788] [background] [warning] [SLOW] Transaction=retrievedMessageBody > 80ms (214ms, 0 waiting to aquire)
5235 [2021-04-18 09:53:11.057] [background] [info] syncFolderUIDRange for [Gmail]/Alle Nachrichten, UIDs: 127619 - 129131, Heavy: false
5235 [2021-04-18 09:53:13.049] [background] [info] - remote=400, local=401
5235 [2021-04-18 09:53:13.051] [background] [info] Unlinking messages  WHERE remoteFolderId = ? AND remoteUID IN (?) no longer present in remote range.
5235 [2021-04-18 09:53:18.762] [metadataExpiration] [info] Scanning for expired metadata
5235 [2021-04-18 09:53:18.763] [metadataExpiration] [info] -- Will wake for next expiration in 7200sec
5235 [2021-04-18 09:53:23.069] [background] [critical] 
***
*** Mailspring Sync 
*** A C++ exception occurred during program execution: 
*** database is locked
***

5235 [2021-04-18 09:53:23.101] [background] [critical] *** Stack trace (line numbers are approximate):
*** ??:?        exceptions::logCurrentExceptionWithStackTrace()
*** ??:?        runBackgroundSyncWorker()
*** main.cpp:?  main::{lambda()#3}::operator()() const
*** main.cpp:?  _Bind_simple::operator()()
*** main.cpp:?  thread::_Impl::_M_run()
*** thread.o:?  execute_native_thread_routine()
***

Still not working on 1.9.1. I’m trying to work with 16 accounts. And got such errors on all of them:

Platform: darwin
Account State: sync_error
Account Provider: gmail
IMAP Server: imap.gmail.com
SMTP Server: smtp.gmail.com
--------------------------------------------
*** in mailsync  main::$_6::operator()() const
*** in mailsync  void* __thread_proxy(void*)
*** in mailsync  thread_start()
***

3557 [2021-04-22 11:27:46.365] [main] [info] Identity created at 1617688417 - using ID Schema 1
3557 [2021-04-22 11:27:46.366] [main] [info] ------------- Starting Sync (***@gmail.com) ---------------
3557 [2021-04-22 11:27:46.373] [metadata] [info] Metadata delta stream starting...
3557 [2021-04-22 11:27:48.374] [background] [info] Fetching XOAuth2 access token (gmail) for 582007e3
3557 [2021-04-22 11:27:48.988] [background] [info] Marking all folders as `busy`
3557 [2021-04-22 11:27:59.247] [background] [critical] 
***
*** Mailspring Sync 
*** A C++ exception occurred during program execution: 
*** database is locked
***

3557 [2021-04-22 11:27:59.299] [background] [critical] *** Stack trace (line numbers are approximate):
*** in mailsync  exceptions::logCurrentExceptionWithStackTrace()
*** in mailsync  runBackgroundSyncWorker()
*** in mailsync  main::$_6::operator()() const
*** in mailsync  void* __thread_proxy(void*)
*** in mailsync  thread_start()
***

3756 [2021-04-22 11:27:59.481] [main] [info] Identity created at 1617688417 - using ID Schema 1
3756 [2021-04-22 11:27:59.482] [main] [info] ------------- Starting Sync (***@gmail.com) ---------------
3756 [2021-04-22 11:27:59.488] [metadata] [info] Metadata delta stream starting...
3756 [2021-04-22 11:28:01.493] [background] [info] Fetching XOAuth2 access token (gmail) for 582007e3
3756 [2021-04-22 11:28:01.598] [background] [info] Marking all folders as `busy`
3756 [2021-04-22 11:28:01.711] [background] [warning] [SLOW] Transaction=markAllFoldersBusy > 80ms (112ms, 111 waiting to aquire)
3756 [2021-04-22 11:28:01.711] [background] [info] Syncing folder list...
3756 [2021-04-22 11:28:13.287] [background] [warning] [SLOW] Transaction=syncFoldersAndLabels > 80ms (9955ms, 9954 waiting to aquire)
3756 [2021-04-22 11:28:13.287] [background] [info] Syncing folder list...
3756 [2021-04-22 11:28:14.483] [metadataExpiration] [info] Scanning for expired metadata
3756 [2021-04-22 11:28:14.483] [metadataExpiration] [info] -- Will wake for next expiration in 7200sec
3756 [2021-04-22 11:28:14.846] [foreground] [info] syncFolderChangesViaCondstore - [Gmail]/All Mail: modseq 9968281 to 9969277, uidnext 225186 to 225202
3756 [2021-04-22 11:28:15.869] [foreground] [info] syncFolderChangesViaCondstore - Changes since HMODSEQ 9968281: 27 changed, 0 vanished
3756 [2021-04-22 11:28:23.639] [background] [critical] 
***
*** Mailspring Sync 
*** A C++ exception occurred during program execution: 
*** database is locked
***

3756 [2021-04-22 11:28:23.709] [background] [critical] *** Stack trace (line numbers are approximate):
*** in mailsync  exceptions::logCurrentExceptionWithStackTrace()
*** in mailsync  runBackgroundSyncWorker()
*** in mailsync  main::$_6::operator()() const
*** in mailsync  void* __thread_proxy(void*)
*** in mailsync  thread_start()
***

@bengotow I hope you haven’t forgotten about us :sob:

1 Like

He hasn’t. Remember - Ben, like the rest of us, does this in addition to full time work. You might not have noticed, but there are a lot of bugs and feature requests demanding attention…and very little development time to work on them.

As a rule, asking for updates, status, or timeframe won’t hurry things along. That’s why the Code of Conduct includes the following:

  • Don’t “bump” conversations or tag individuals/groups with the sole purposes of speeding up response times.

If you want to help get a bug resolved or feature implemented quicker, here’s some things you can do, depending on your available time and skills:

  1. Vote. This raises the priority in planning. Anyone can do this.
  2. Help diagnose. Checking logs, testing out scenarios, or even digging around in the code if you’re up to the challenge all help move towards a resolution.
  3. Coordinate with other reporters. If you see similar bug reports, possible duplicates, or other posts with hints, helping get those individuals involved in diagnostics helps a lot!
  4. Attempting a PR. If you know anything about coding — even a little — you can check out the Mailspring source code from GitHub and try to fix the bug or implement the feature yourself. Even if you aren’t successful, or the fix isn’t ideal, the attempt still helps us!

And, of course, you can help just by being involved in the community: helping answer questions, triage bugs, and discuss features takes pressure off the developers, so they have time to focus on writing awesome code.

Hey folks! Thanks for reporting this and attaching the logs, it looks like there may be a few separate things going on here -

  • The “database is locked” issues seem to be specific to the new releases. We shipped 1.9.1 which added SQLite’s HAVE_USLEEP flag to reduce lock contention, but it looks like we might still have an issue there. @Phylu any chance you’re running from source and need to re-run npm install to get the rebuilt version of SQLite? Will see if I can reproduce today.

  • @kikoulol4485 , it looks like Mailspring is actually failing to log in to our backend services - any chance you deleted your Mailspring ID but are still logged in under Preferences > Subscription in the app? If you want to opt out of the Mailspring ID, you’ll need to click “Log Out” on that tab. If you didn’t mean to do any of the above, logging out and logging back in on Preferences > Subscription should fix it!

  • @Ruan-Kuypers - it looks like Mailspring is actually failing to log in to that account you pictured in the logs - we’re getting an authentication error from your IMAP service. I don’t think we’ve seen that before - it seems like Mailspring must be unable to write to your Windows Credential Vault or it’s being reset repeatedly. Can you try opening Credential Manager from the task bar search field and then looking for “Mailspring/Mailspring Keys” under Generic Credentials? If it’s not there that will help narrow down the problem!

Thanks for the heads-up !
I didn’t deleted my mailspring account. I’ve switch to snap package, and then the issue disappeared. So you must be right, mailspring ID related.

@bengotow - Hey! Yes, I have “Mailspring/Mailspring Keys” under my Generic Credentials. What now?

Screenshot_1

The “database is locked” issue happened on my installation from the .deb package. But somehow, it disappeared by itself. For a few days, I have no more problems here.

@bengotow Just an update, Yesterday I opened Mailspring and all my accounts loaded without any problems. This morning I opened Mailspring and the errors still occur. :grimacing:

I recently started having this same issue when I added a 4th email account. Every time I reopen Mailspring, it fails to connect and requires me to re-enter my IMAP/SMTP passwords (they seem to not be saved). I am on windows, and I do see “Mailspring/Mailspring Keys” in Windows Credential Manager, but it has not been modified since 2021-02-02 (well before I added my 4th account). I have not deleted my Mailspring ID or anything like that.

Mailspring Version: 1.9.1-30ef802f
Platform: win32
Account State: sync_error
Account Provider: imap
IMAP Server: mail.gandi.net
SMTP Server: mail.gandi.net
--------------------------------------------
3808 [2021-05-06 12:57:19.001] [background] [info] syncFolderChangesViaCondstore - Drafts: modseq 5 to 5, uidnext 2 to 2
3808 [2021-05-06 12:57:19.186] [background] [info] syncFolderChangesViaCondstore - Archive: modseq 1 to 1, uidnext 1 to 1
3808 [2021-05-06 12:57:19.369] [background] [info] syncFolderChangesViaCondstore - Deleted Messages: modseq 2 to 2, uidnext 2 to 2
3808 [2021-05-06 12:57:19.554] [background] [info] syncFolderChangesViaCondstore - Spam: modseq 7 to 7, uidnext 3 to 3
3808 [2021-05-06 12:57:19.773] [background] [info] syncFolderChangesViaCondstore - Trash: modseq 5 to 5, uidnext 5 to 5
3808 [2021-05-06 12:57:19.965] [background] [info] syncFolderChangesViaCondstore - Trash/HEY: modseq 1 to 1, uidnext 1 to 1
3808 [2021-05-06 12:57:20.150] [background] [info] syncFolderChangesViaCondstore - Mailspring: modseq 1 to 1, uidnext 1 to 1
3808 [2021-05-06 12:57:20.339] [background] [info] syncFolderChangesViaCondstore - Mailspring/Snoozed: modseq 1 to 1, uidnext 1 to 1
3808 [2021-05-06 12:57:20.339] [background] [info] Sync loop deleting unlinked messages with phase 2.
3808 [2021-05-06 12:57:20.339] [background] [info] Sync loop complete.
3808 [2021-05-06 12:59:03.944] [foreground] [info] Idle exited with code 0
3808 [2021-05-06 12:59:04.125] [foreground] [info] syncFolderChangesViaCondstore - INBOX: modseq 24 to 24, uidnext 10 to 10
3808 [2021-05-06 12:59:04.126] [foreground] [info] Idling on folder INBOX
3808 [2021-05-06 12:59:20.340] [background] [info] Syncing folder list...
3808 [2021-05-06 12:59:20.731] [background] [info] syncFolderChangesViaCondstore - INBOX: modseq 24 to 24, uidnext 10 to 10
3808 [2021-05-06 12:59:20.915] [background] [info] syncFolderChangesViaCondstore - Sent: modseq 3 to 3, uidnext 2 to 2
3808 [2021-05-06 12:59:21.097] [background] [info] syncFolderChangesViaCondstore - Drafts: modseq 5 to 5, uidnext 2 to 2
3808 [2021-05-06 12:59:21.282] [background] [info] syncFolderChangesViaCondstore - Archive: modseq 1 to 1, uidnext 1 to 1
3808 [2021-05-06 12:59:21.476] [background] [info] syncFolderChangesViaCondstore - Deleted Messages: modseq 2 to 2, uidnext 2 to 2
3808 [2021-05-06 12:59:21.662] [background] [info] syncFolderChangesViaCondstore - Spam: modseq 7 to 7, uidnext 3 to 3
3808 [2021-05-06 12:59:21.915] [background] [info] syncFolderChangesViaCondstore - Trash: modseq 5 to 5, uidnext 5 to 5
3808 [2021-05-06 12:59:22.148] [background] [info] syncFolderChangesViaCondstore - Trash/HEY: modseq 1 to 1, uidnext 1 to 1
3808 [2021-05-06 12:59:22.331] [background] [info] syncFolderChangesViaCondstore - Mailspring: modseq 1 to 1, uidnext 1 to 1
3808 [2021-05-06 12:59:22.511] [background] [info] syncFolderChangesViaCondstore - Mailspring/Snoozed: modseq 1 to 1, uidnext 1 to 1
3808 [2021-05-06 12:59:22.512] [background] [info] Sync loop deleting unlinked messages with phase 1.
3808 [2021-05-06 12:59:22.512] [background] [info] Sync loop complete.

@Phylu So your accounts are no longer getting disconnected? What did you do to resolve it?

@bengotow I’ve deleted the credentials and completely deleted Mailspring using CC cleaner. I used a fresh installation and the problem still persists. Even tested it using only 3 accounts instead of 4.