On 18. May 2022, at 16.56, Marc F. Clemente <m...@mclemente.net> 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

Reply via email to