Menu

#53 Error: Sent is locked

1.3.0
cannot-reproduce
nobody
None
unknown
5
2020-07-29
2019-12-08
No

When synchronizing a mailbox for the first time (in the context of migrating emails from one mail server to another I consistently get the following error:

Error: channel :my-name-remote:Sent-:my-name-local:Sent is locked

It downloads everything from my remote Inbox as intended (the mail server I am syncronizing from) but only part of the mail in my remote Sent folder gets to be downloaded. If I delete the local Sent folder and run mbsync again, it eventually downloads everything from the remote Sent folder.

Here is the log for the first run of mbsync (mbsync -Va):

Reading configuration file /home/my-name/.mbsyncrc
C: 0/1  B: 0/0  M: +0/0 *0/0 #0/0  S: +0/0 *0/0 #0/0
Channel my-name
Opening master store my-name-remote...
Resolving 127.0.0.1... ok
Connecting to 127.0.0.1 (127.0.0.1:1143)... 
Opening slave store my-name-local...
Connection is now encrypted
Logging in...
Authenticating with SASL mechanism PLAIN...
C: 0/1  B: 0/2  M: +0/0 *0/0 #0/0  S: +0/0 *0/0 #0/0
Opening master box INBOX...
Opening slave box INBOX...
Maildir notice: no UIDVALIDITY, creating new.
Loading master...
Loading slave...
slave: 0 messages, 0 recent
master: 363 messages, 0 recent
Synchronizing...
C: 0/1  B: 1/2  M: +0/0 *0/0 #0/0  S: +363/363 *0/0 #0/0
Error: channel :my-name-remote:Sent-:my-name-local:Sent is locked
C: 1/1  B: 2/2  M: +0/0 *0/0 #0/0  S: +363/363 *0/0 #0/0

And the log for the second run:

Reading configuration file /home/my-name/.mbsyncrc
C: 0/1  B: 0/0  M: +0/0 *0/0 #0/0  S: +0/0 *0/0 #0/0
Channel my-name
Opening master store my-name-remote...
Resolving 127.0.0.1... ok
Connecting to 127.0.0.1 (127.0.0.1:1143)... 
Opening slave store my-name-local...
Connection is now encrypted
Logging in...
Authenticating with SASL mechanism PLAIN...
C: 0/1  B: 0/2  M: +0/0 *0/0 #0/0  S: +0/0 *0/0 #0/0
Opening master box INBOX...
Opening slave box INBOX...
Loading master...
Loading slave...
slave: 364 messages, 1 recent
master: 364 messages, 0 recent
Synchronizing...
C: 0/1  B: 1/2  M: +0/0 *0/0 #0/0  S: +0/0 *0/0 #0/0
Opening master box Sent...
Opening slave box Sent...
Creating slave Sent...
Maildir notice: no UIDVALIDITY, creating new.
Loading master...
Loading slave...
slave: 0 messages, 0 recent
master: 176 messages, 0 recent
Synchronizing...
C: 1/1  B: 2/2  M: +0/0 *0/0 #0/0  S: +176/176 *0/0 #0/0

Then, if I run msync once more (after uptdating .mbsyncrc with the credentials for the new mail server), all mails on the local computer get to be uploaded to the new mail server but I still get the same weird error (please see line before the last one below):

Reading configuration file /home/my-name/.mbsyncrc
C: 0/1  B: 0/0  M: +0/0 *0/0 #0/0  S: +0/0 *0/0 #0/0
Channel my-name
Opening master store my-name-remote...
Resolving mail.my-domain.com... ok
Connecting to mail.my-domain.com (12.345.67.89:993)... 
Opening slave store my-name-local...
Connection is now encrypted
Logging in...
Authenticating with SASL mechanism PLAIN...
C: 0/1  B: 0/2  M: +0/0 *0/0 #0/0  S: +0/0 *0/0 #0/0
Opening master box INBOX...
Opening slave box INBOX...
Maildir notice: no UIDVALIDITY, creating new.
Loading master...
Loading slave...
slave: 363 messages, 0 recent
master: 2 messages, 0 recent
Synchronizing...
C: 0/1  B: 1/2  M: +363/363 *0/0 #0/0  S: +2/2 *0/0 #0/0
Error: channel :my-name-remote:Sent-:my-name-local:Sent is locked
C: 1/1  B: 2/2  M: +363/363 *0/0 #0/0  S: +2/2 *0/0 #0/0

Discussion

  • Oswald Buddenhagen

    the configuration file and the output from mbsync -l -a -D would be interesting.

     
  • Nuno Pedrosa

    Nuno Pedrosa - 2019-12-08

    Hi, thanks for getting back so quickly!

    Here's the output from mbsync -l -a -D:

    Reading configuration file /home/my-name/.mbsyncrc
    Channel my-name
    Opening master store my-name-remote...
    M: [ 1] Enter connect_store
    Resolving mail.my-domain.com... ok
    Connecting to mail.my-domain.com (12.345.67.89:993)... 
    M: [ 1] Leave connect_store
    Opening slave store my-name-local...
    S: [ 2] Enter connect_store
    S: [ 2] Callback enter connect_store, sts=0
    pattern 'Sent' (effective 'Sent'): Path, no INBOX
    pattern 'INBOX' (effective 'INBOX'): no Path, INBOX
    S: [ 3] Enter list_store, flags=3
    S: [ 3] Callback enter list_store
      Sent
      drafts
      INBOX
    S: [ 3] Callback leave list_store
    S: [ 3] Leave list_store
    S: [ 2] Callback leave connect_store
    S: [ 2] Leave connect_store
    Connection is now encrypted
    M: * OK [CAPABILITY IMAP4rev1 SASL-IR LOGIN-REFERRALS ID ENABLE IDLE LITERAL+ AUTH=PLAIN AUTH=LOGIN] Dovecot ready.
    Logging in...
    Authenticating with SASL mechanism PLAIN...
    M: >>> 1 AUTHENTICATE PLAIN <authdata>
    M: 1 OK [CAPABILITY IMAP4rev1 SASL-IR LOGIN-REFERRALS ID ENABLE IDLE SORT SORT=DISPLAY THREAD=REFERENCES THREAD=REFS THREAD=ORDEREDSUBJECT MULTIAPPEND URL-PARTIAL CATENATE UNSELECT CHILDREN NAMESPACE UIDPLUS LIST-EXTENDED I18NLEVEL=1 CONDSTORE QRESYNC ESEARCH ESORT SEARCHRES WITHIN CONTEXT=SEARCH LIST-STATUS BINARY MOVE SNIPPET=FUZZY PREVIEW=FUZZY LITERAL+ NOTIFY METADATA SPECIAL-USE COMPRESS=DEFLATE QUOTA ACL RIGHTS=texk] Logged in
    M: >>> 2 COMPRESS DEFLATE
    M: 2 OK Begin compression (0.001 + 0.000 secs).
    M: >>> 3 NAMESPACE
    M: * NAMESPACE (("" "/")) (("Shared/" "/")) NIL
    M: 3 OK Namespace completed (0.001 + 0.000 secs).
    M: [ 1] Callback enter connect_store, sts=0
    pattern 'Sent' (effective 'Sent'): Path, no INBOX
    pattern 'INBOX' (effective 'INBOX'): no Path, INBOX
    M: [ 4] Enter list_store, flags=3
    M: >>> 4 LIST "" "*"
    M: [ 4] Leave list_store
    M: [ 1] Callback leave connect_store
    M: * LIST (\HasNoChildren \Archive) "/" Archive
    M: * LIST (\HasNoChildren \Marked \Junk) "/" Junk
    M: * LIST (\HasChildren \UnMarked \Trash) "/" Trash
    M: * LIST (\HasNoChildren) "/" Trash/Archive6
    M: * LIST (\HasNoChildren \UnMarked) "/" Trash/Archive5
    M: * LIST (\HasNoChildren \UnMarked) "/" Trash/Archive4
    M: * LIST (\HasNoChildren \UnMarked) "/" Trash/Archive3
    M: * LIST (\HasNoChildren \UnMarked) "/" Trash/Archive2
    M: * LIST (\HasNoChildren \UnMarked) "/" Trash/Archive1
    M: * LIST (\HasNoChildren \UnMarked) "/" Trash/Archive
    M: * LIST (\HasNoChildren \UnMarked \Drafts) "/" Drafts
    M: * LIST (\HasNoChildren \UnMarked \Sent) "/" Sent
    M: * LIST (\HasNoChildren) "/" INBOX
    M: 4 OK List completed (0.004 + 0.000 + 0.004 secs).
    M: [ 4] Callback enter list_store
      INBOX
      Sent
      Drafts
      Trash/Archive
      Trash/Archive1
      Trash/Archive2
      Trash/Archive3
      Trash/Archive4
      Trash/Archive5
      Trash/Archive6
      Trash
      Junk
      Archive
    INBOX
    Sent
    M: [ 5] Enter cancel_cmds
    M: [ 5] Callback enter cancel_cmds
    M: Enter free_store
    M: Leave free_store
    M: [ 5] Callback leave cancel_cmds
    M: [ 5] Leave cancel_cmds
    S: [ 6] Enter cancel_cmds
    S: [ 6] Callback enter cancel_cmds
    S: Enter free_store
    S: Leave free_store
    S: [ 6] Callback leave cancel_cmds
    S: [ 6] Leave cancel_cmds
    M: >>> 5 LOGOUT
    M: [ 4] Callback leave list_store
    M: * BYE Logging out
    M: 5 OK Logout completed (0.001 + 0.000 secs).
    

    My current configuration:

    IMAPAccount my-name
    Host mail.my-domain.com
    Port 993
    User mailcowuser
    Pass mailcowuserpassword
    SSLType IMAPS
    SSLVersions TLSv1.2
    Timeout 300
    
    IMAPStore my-name-remote
    Account my-name
    
    MaildirStore my-name-local
    Path ~/path/to/MAIL/
    Inbox ~/path/to/MAIL/Inbox
    SubFolders Verbatim
    Flatten .
    
    Channel my-name
    Master :my-name-remote:
    Slave :my-name-local:
    Patterns INBOX Sent
    Create Both
    Expunge Both
    SyncState *
    

    And my configuration file when downloading all my mail from ProtonMail Bridge:

    IMAPAccount my-name
    Host 127.0.0.1
    Port 1143
    User prontonmailuser
    Pass protonmailbridgepassword
    SSLType STARTTLS
    Timeout 300
    
    IMAPStore my-name-remote
    Account my-name
    
    MaildirStore my-name-local
    Path ~/path/to/MAIL/
    Inbox ~/path/to/MAIL/Inbox
    SubFolders Verbatim
    Flatten .
    
    Channel my-name
    Master :my-name-remote:
    Slave :my-name-local:
    Patterns INBOX Sent
    Create Both
    Expunge Both
    SyncState *
    
     

    Last edit: Nuno Pedrosa 2019-12-08
  • Oswald Buddenhagen

    ok, that all looks quite reasonable.
    are you positive that you're not accidentally starting two processes at the same time?
    try strace'ing it. if the error doesn't magically disappear under observation, then the trace should be helpful.

     
  • Oswald Buddenhagen

    • status: reported --> cannot-reproduce
     
  • Oswald Buddenhagen

    no info forthcoming.

    this is pure guesswork, but you probably used ^Z instead of ^C to "cancel" the first download when it didn't complete (you didn't describe what actually happened, so i assume it just hung).

     

Log in to post a comment.

MongoDB Logo MongoDB