Debian Bug report logs - #1011238
dsync panic

version graph

Package: dovecot-core; Maintainer for dovecot-core is Dovecot Maintainers <[email protected]>; Source for dovecot-core is src:dovecot (PTS, buildd, popcon).

Reported by: "Marc F. Clemente" <[email protected]>

Date: Wed, 18 May 2022 15:33:05 UTC

Severity: normal

Found in version dovecot/1:2.3.18+dfsg1-1

Reply or subscribe to this bug.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to [email protected], Dovecot Maintainers <[email protected]>:
Bug#1011238; Package dovecot-core. (Wed, 18 May 2022 15:33:07 GMT) (full text, mbox, link).


Acknowledgement sent to "Marc F. Clemente" <[email protected]>:
New Bug report received and forwarded. Copy sent to Dovecot Maintainers <[email protected]>. (Wed, 18 May 2022 15:33:07 GMT) (full text, mbox, link).


Message #5 received at [email protected] (full text, mbox, reply):

From: "Marc F. Clemente" <[email protected]>
To: [email protected]
Subject: dsync panic
Date: Wed, 18 May 2022 09:56:28 -0500
Package: dovecot-core
Version: 1:2.3.18+dfsg1-1+b2

I am trying to convert my email storage from mbox to maildir.  I have 
used this command:

dsync -D -v -u marc mirror mbox:/home/marc/mail:INBOX=/var/mail/marc

It mostly works, and I have been able to convert multiple users.  I get 
a lot of debug output about what it's doing, until it crashes like this:

May 18 09:21:20 dsync(marc): Debug: Mailbox Sent: UID 10691: Expunge 
requested
May 18 09:21:20 dsync(marc): Debug: Mailbox Sent: UID 10647: Opened mail 
because: prefetch
May 18 09:21:20 dsync(marc): Debug: brain S: import mail uid 0 guid 
cfb601bf53fe34fbaf6a25475a662866
May 18 09:21:20 dsync(marc): Debug: brain S: Import Sent: Import mail 
body for GUID=cfb601bf53fe34fbaf6a25475a662866 UID=0
May 18 09:21:20 dsync(marc): Panic: file mbox-lock.c: line 796 
(mbox_lock): assertion failed: (lock_type == F_RDLCK || 
mbox->mbox_lock_type != F_RDLCK)
May 18 09:21:20 dsync(marc): Error: Raw backtrace: #0 
test_subprocess_fork[0x7f04b4c778d0] -> #1 
backtrace_append[0x7f04b4c77b30] -> #2 backtrace_get[0x7f04b4c77c90] -> 
#3 execvp_const[0x7f04b4c84ba0] -> #4 
default_fatal_handler[0x7f04b4c84c70] -> #5 i_panic[0x7f04b4bda0a1] -> 
#6 [unw_get_proc_name() failed: -10] -> #7 
mbox_save_begin[0x7f04b4deefc0] -> #8 mailbox_save_begin[0x7f04b4dbb2c0] 
-> #9 mail_storage_copy[0x7f04b4daee30] -> #10 
mailbox_save_begin[0x7f04b4dbb410] -> #11 mailbox_copy[0x7f04b4dbb610] 
-> #12 dsync_mailbox_import_change[0x55b05aea7f90] -> #13 
dsync_mailbox_import_mail[0x55b05aea8480] -> #14 
dsync_brain_sync_mails[0x55b05ae9cc90] -> #15 
dsync_brain_sync_mails[0x55b05ae9d5f0] -> #16 
dsync_brain_run[0x55b05ae9ddb0] -> #17 who_lookup[0x55b05ae82cb0] -> #18 
who_lookup[0x55b05ae83cd0] -> #19 
doveadm_cmd_ver2_to_mail_cmd_wrapper[0x55b05ae84ea0] -> #20 
doveadm_cmd_run_ver2[0x55b05ae8f870] -> #21 
doveadm_cmd_try_run_ver2[0x55b05ae8fdb0] -> #22 main[0x55b05ae70ee0] -> 
#23 __libc_start_main[0x7f04b4831730] -> #24 _start[0x55b05ae71350]
Abort
Exit 134

If I find the offending message and delete it or move it to another 
folder, then I can keep going until it crashes somewhere else.

I notice some mention of lock in the error message.  The filesystem is 
ext4.  The only programs accessing the maildir are dovecot and exim4. 
Exim is not the problem because the errors happen even when exim is not 
running.  In /etc/dovecot/conf.d/10-mail.conf all the lock settings are 
commented out.

Any suggestions?  Is there any additional information needed?

Marc



Information forwarded to [email protected], Dovecot Maintainers <[email protected]>:
Bug#1011238; Package dovecot-core. (Wed, 18 May 2022 15:51:03 GMT) (full text, mbox, link).


Acknowledgement sent to Timo Sirainen <[email protected]>:
Extra info received and forwarded to list. Copy sent to Dovecot Maintainers <[email protected]>. (Wed, 18 May 2022 15:51:03 GMT) (full text, mbox, link).


Message #10 received at [email protected] (full text, mbox, reply):

From: Timo Sirainen <[email protected]>
To: "Marc F. Clemente" <[email protected]>, [email protected]
Subject: Re: Bug#1011238: dsync panic
Date: Wed, 18 May 2022 17:38:37 +0200
On 18. May 2022, at 16.56, Marc F. Clemente <[email protected]> wrote:
> 
> dsync -D -v -u marc mirror mbox:/home/marc/mail:INBOX=/var/mail/marc
> 
> It mostly works, and I have been able to convert multiple users.  I get a lot of debug output about what it's doing, until it crashes like this:
> 
> May 18 09:21:20 dsync(marc): Debug: Mailbox Sent: UID 10691: Expunge requested
> May 18 09:21:20 dsync(marc): Debug: Mailbox Sent: UID 10647: Opened mail because: prefetch
> May 18 09:21:20 dsync(marc): Debug: brain S: import mail uid 0 guid cfb601bf53fe34fbaf6a25475a662866
> May 18 09:21:20 dsync(marc): Debug: brain S: Import Sent: Import mail body for GUID=cfb601bf53fe34fbaf6a25475a662866 UID=0
> May 18 09:21:20 dsync(marc): Panic: file mbox-lock.c: line 796 (mbox_lock): assertion failed: (lock_type == F_RDLCK || mbox->mbox_lock_type != F_RDLCK)
> May 18 09:21:20 dsync(marc): Error: Raw backtrace: #0 test_subprocess_fork[0x7f04b4c778d0] -> #1 backtrace_append[0x7f04b4c77b30] -> #2 backtrace_get[0x7f04b4c77c90] -> #3 execvp_const[0x7f04b4c84ba0] -> #4 default_fatal_handler[0x7f04b4c84c70] -> #5 i_panic[0x7f04b4bda0a1] -> #6 [unw_get_proc_name() failed: -10] -> #7 mbox_save_begin[0x7f04b4deefc0] -> #8 mailbox_save_begin[0x7f04b4dbb2c0] -> #9 mail_storage_copy[0x7f04b4daee30] -> #10 mailbox_save_begin[0x7f04b4dbb410] -> #11 mailbox_copy[0x7f04b4dbb610] -> #12 dsync_mailbox_import_change[0x55b05aea7f90] -> #13 dsync_mailbox_import_mail[0x55b05aea8480] -> #14 dsync_brain_sync_mails[0x55b05ae9cc90] -> #15 dsync_brain_sync_mails[0x55b05ae9d5f0] -> #16 dsync_brain_run[0x55b05ae9ddb0] -> #17 who_lookup[0x55b05ae82cb0] -> #18 who_lookup[0x55b05ae83cd0] -> #19 doveadm_cmd_ver2_to_mail_cmd_wrapper[0x55b05ae84ea0] -> #20 doveadm_cmd_run_ver2[0x55b05ae8f870] -> #21 doveadm_cmd_try_run_ver2[0x55b05ae8fdb0] -> #22 main[0x55b05ae70ee0] -> #23 __libc_start_main[0x7f04b4831730] -> #24 _start[0x55b05ae71350]
> Abort

I think it happens when the same mail (or actually a mail with identical headers) exists in the same mbox file multiple times. Seems like there is no easy workaround on mbox side and fixing the code is likely difficult too. But I think you could solve this by migrating via imapc: https://doc.dovecot.org/admin_manual/migrating_mailboxes/#migrating-mailboxes-over-imap




Information forwarded to [email protected], Dovecot Maintainers <[email protected]>:
Bug#1011238; Package dovecot-core. (Thu, 19 May 2022 19:33:02 GMT) (full text, mbox, link).


Acknowledgement sent to "Marc F. Clemente" <[email protected]>:
Extra info received and forwarded to list. Copy sent to Dovecot Maintainers <[email protected]>. (Thu, 19 May 2022 19:33:02 GMT) (full text, mbox, link).


Message #15 received at [email protected] (full text, mbox, reply):

From: "Marc F. Clemente" <[email protected]>
To: [email protected]
Subject: Re: Bug#1011238: dsync panic
Date: Thu, 19 May 2022 14:02:33 -0500

On 5/18/22 10:38 AM, Timo Sirainen wrote:
> On 18. May 2022, at 16.56, Marc F. Clemente <[email protected]> wrote:
>>
>> dsync -D -v -u marc mirror mbox:/home/marc/mail:INBOX=/var/mail/marc
>>
>> It mostly works, and I have been able to convert multiple users.  I get a lot of debug output about what it's doing, until it crashes like this:
>>
>> May 18 09:21:20 dsync(marc): Debug: Mailbox Sent: UID 10691: Expunge requested
>> May 18 09:21:20 dsync(marc): Debug: Mailbox Sent: UID 10647: Opened mail because: prefetch
>> May 18 09:21:20 dsync(marc): Debug: brain S: import mail uid 0 guid cfb601bf53fe34fbaf6a25475a662866
>> May 18 09:21:20 dsync(marc): Debug: brain S: Import Sent: Import mail body for GUID=cfb601bf53fe34fbaf6a25475a662866 UID=0
>> May 18 09:21:20 dsync(marc): Panic: file mbox-lock.c: line 796 (mbox_lock): assertion failed: (lock_type == F_RDLCK || mbox->mbox_lock_type != F_RDLCK)
>> May 18 09:21:20 dsync(marc): Error: Raw backtrace: #0 test_subprocess_fork[0x7f04b4c778d0] -> #1 backtrace_append[0x7f04b4c77b30] -> #2 backtrace_get[0x7f04b4c77c90] -> #3 execvp_const[0x7f04b4c84ba0] -> #4 default_fatal_handler[0x7f04b4c84c70] -> #5 i_panic[0x7f04b4bda0a1] -> #6 [unw_get_proc_name() failed: -10] -> #7 mbox_save_begin[0x7f04b4deefc0] -> #8 mailbox_save_begin[0x7f04b4dbb2c0] -> #9 mail_storage_copy[0x7f04b4daee30] -> #10 mailbox_save_begin[0x7f04b4dbb410] -> #11 mailbox_copy[0x7f04b4dbb610] -> #12 dsync_mailbox_import_change[0x55b05aea7f90] -> #13 dsync_mailbox_import_mail[0x55b05aea8480] -> #14 dsync_brain_sync_mails[0x55b05ae9cc90] -> #15 dsync_brain_sync_mails[0x55b05ae9d5f0] -> #16 dsync_brain_run[0x55b05ae9ddb0] -> #17 who_lookup[0x55b05ae82cb0] -> #18 who_lookup[0x55b05ae83cd0] -> #19 doveadm_cmd_ver2_to_mail_cmd_wrapper[0x55b05ae84ea0] -> #20 doveadm_cmd_run_ver2[0x55b05ae8f870] -> #21 doveadm_cmd_try_run_ver2[0x55b05ae8fdb0] -> #22 main[0x55b05ae70ee0] -> #23 __libc_start_main[0x7f04b4831730] -> #24 _start[0x55b05ae71350]
>> Abort
> 
> I think it happens when the same mail (or actually a mail with identical headers) exists in the same mbox file multiple times. Seems like there is no easy workaround on mbox side and fixing the code is likely difficult too. But I think you could solve this by migrating via imapc: https://doc.dovecot.org/admin_manual/migrating_mailboxes/#migrating-mailboxes-over-imap

Thank you for the advice.  Your link pointed me to more links. 
Eventually, I figured out that to migrate from mbox to maildir, I should 
have probably used "dsync mirror -1" to do a one-way sync.  It also made 
the errors go away.

I am not sure what exactly triggers the error.  Maybe it is duplicate 
headers.  Maybe it's duplicate UID's.  Maybe it's something else. 
Unfortunately, I doubt that I have the time or the knowledge to 
troubleshoot it properly.

Also, "doveadm import" was useful for migrating a few troublesome mbox 
files.

Marc

Send a report that this bug log contains spam.


Debian bug tracking system administrator <[email protected]>. Last modified: Tue May 13 16:04:10 2025; Machine Name: bembo

Debian Bug tracking system

Debbugs is free software and licensed under the terms of the GNU General Public License version 2. The current version can be obtained from https://bugs.debian.org/debbugs-source/.

Copyright © 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson, 2005-2017 Don Armstrong, and many other contributors.