Panic: file mail-user.c: line 185 (mail_user_deinit): assertion failed: ((*user)->refcount == 1)
Hi everyone,
When I'm running a force-resync on my mailbox, it crashes. Unfortunately, after the crash, it left multiple new FTS mailboxes.
Command:
doveadm -D force-resync -u user@domain.ext '*'
Error message:
doveadm: Debug: Mailbox INBOX/fts-flatcurve/current.1756202040958990: Mailbox opened doveadm: Error: Mailbox INBOX: FTS optimize failed doveadm: Error: cmd force-resync: Forcing a resync on mailbox INBOX failed: FTS optimize failed doveadm: Panic: file mail-user.c: line 185 (mail_user_deinit): assertion failed: ((*user)->refcount == 1) doveadm: Error: Raw backtrace: #0 fatal_handler_real[0x7f7fcd996190] -> #1 default_fatal_handler[0x7f7fcd996260] -> #2 i_panic[0x7f7fcd8b5407] -> #3 mail_user_deinit.cold[0x7f7fcdc5720e] -> #4 doveadm_mail_next_user[0x55b93b0c16b0] -> #5 doveadm_cmd_ver2_to_mail_cmd_wrapper[0x55b93b0c33d0] -> #6 doveadm_cmdline_run[0x55b93b0d76e0] -> #7 doveadm_cmdline_try_run[0x55b93b0d7ee0] -> #8 main[0x55b93b0b0d10] -> #9 __libc_start_call_main[0x7f7fcd50827e] -> #10 __libc_start_main_alias_2[0x7f7fcd50833e] -> #11 _start[0x55b93b0b1320]
Backtrace:
#0 __pthread_kill_implementation(threadid=<optimized out>, signo=signo@entry=6, no_tid=no_tid@entry=0) at pthread_kill.c:44 #1 0x00007f7fcd57ae33in __pthread_kill_internal(threadid=<optimized out>, signo=6) at pthread_kill.c:89 #2 0x00007f7fcd51f7b6in __GI_raise(sig=sig@entry=6) at ../sysdeps/posix/raise.c:26 #3 0x00007f7fcd50634bin __GI_abort() at abort.c:77 #4 0x00007f7fcd8b5575in default_fatal_finish(type=LOG_TYPE_PANIC, status=0) at ../lib/failures.c:461 #5 fatal_handler_real(ctx=<optimized out>, format=<optimized out>, args=<optimized out>) at ../lib/failures.c:473 #6 0x00007f7fcd996283in default_fatal_handler(ctx=<optimized out>, format=<optimized out>, args=<optimized out>) at ../lib/failures.c:481 #7 0x00007f7fcd8b54d7in i_panic(format=format@entry=0x7f7fcdd3eac8 "file %s: line %d (%s): assertion failed: (%s)") at ../lib/failures.c:526 #8 0x00007f7fcdc57237in mail_user_deinit(user=<optimized out>) at /usr/src/debug/dovecot-2.4.2/src/lib-storage/mail-user.c:185 #9 mail_user_deinit(user=<optimized out>) at /usr/src/debug/dovecot-2.4.2/src/lib-storage/mail-user.c:183 #10 0x000055b93b0c18f2in doveadm_mail_next_user(ctx=0x55b93ed9dfb8, error_r=<optimized out>) at /usr/src/debug/dovecot-2.4.2/src/doveadm/doveadm-mail.c:505 #11 0x000055b93b0c35e7in doveadm_mail_cmd_exec(ctx=0x55b93ed9dfb8, wildcard_user=0x0) at /usr/src/debug/dovecot-2.4.2/src/doveadm/doveadm-mail.c:705 #12 doveadm_cmd_ver2_to_mail_cmd_wrapper(cctx=<optimized out>) at /usr/src/debug/dovecot-2.4.2/src/doveadm/doveadm-mail.c:1034 #13 0x000055b93b0d7dd7in doveadm_cmdline_run(argc=<optimized out>, argv=0x55b93ed69840, cctx=cctx@entry=0x55b93ed90fa8) at /usr/src/debug/dovecot-2.4.2/src/doveadm/doveadm-cmd-parse.c:451 #14 0x000055b93b0d7f8cin doveadm_cmdline_try_run(cmd_name=cmd_name@entry=0x55b93ed6987c "force-resync", argc=<optimized out>, argv=<optimized out>, cctx=cctx@entry=0x55b93ed90fa8) at /usr/src/debug/dovecot-2.4.2/src/doveadm/doveadm-cmd.c:160 #15 0x000055b93b0b101din main(argc=<optimized out>, argv=<optimized out>) at /usr/src/debug/dovecot-2.4.2/src/doveadm/doveadm.c:406
Unfortunately, this interrupted run left many new mailboxes in place:
$ doveadm mailbox list -u user@domain.ext Junk Drafts Drafts/fts-flatcurve Drafts/fts-flatcurve/current.1756201209435330 Drafts/fts-flatcurve/index.5092 Trash Trash/fts-flatcurve Trash/fts-flatcurve/current.1756242793225435 Trash/fts-flatcurve/index.5401 Trash/Junk Trash/Junk/fts-flatcurve Trash/Junk/fts-flatcurve/index.6279 Trash/Junk/fts-flatcurve/current.1756366793619309
Interestingly, a short ago I deleted the Junk mailbox with "doveadm mailbox delete -e Junk". Trash/Junk was never a thing.
Version: 2.4.2
In case FTS config is useful:
mail_plugins { fts = yes fts_flatcurve = yes quota = yes virtual = yes }
fts flatcurve { substring_search = yes }
fts_autoindex = yes
language en { default = yes } language de { } language_tokenizers = generic email-address
Ákos
Hi everyone,
When I'm running a force-resync on my mailbox, it crashes. Unfortunately, after the crash, it left multiple new FTS mailboxes.
Command:
doveadm -D force-resync -u [1]user@domain.ext '*'
Error message:
doveadm: Debug: Mailbox INBOX/fts-flatcurve/current.1756202040958990: Mailbox opened doveadm: Error: Mailbox INBOX: FTS optimize failed doveadm: Error: cmd force-resync: Forcing a resync on mailbox INBOX failed: FTS optimize failed doveadm: Panic: file mail-user.c: line 185 (mail_user_deinit): assertion failed: ((*user)->refcount == 1) doveadm: Error: Raw backtrace: #0 fatal_handler_real[0x7f7fcd996190] -> #1 default_fatal_handler[0x7f7fcd996260] -> #2 i_panic[0x7f7fcd8b5407] -> #3 mail_user_deinit.cold[0x7f7fcdc5720e] -> #4 doveadm_mail_next_user[0x55b93b0c16b0] -> #5 doveadm_cmd_ver2_to_mail_cmd_wrapper[0x55b93b0c33d0] -> #6 doveadm_cmdline_run[0x55b93b0d76e0] -> #7 doveadm_cmdline_try_run[0x55b93b0d7ee0] -> #8 main[0x55b93b0b0d10] -> #9 __libc_start_call_main[0x7f7fcd50827e] -> #10 __libc_start_main_alias_2[0x7f7fcd50833e] -> #11 _start[0x55b93b0b1320]
Backtrace:
#0 __pthread_kill_implementation (threadid=<optimized out>, signo=signo@entry=6, no_tid=no_tid@entry=0) at pthread_kill.c:44 #1 0x00007f7fcd57ae33 in __pthread_kill_internal (threadid=<optimized out>, signo=6) at pthread_kill.c:89 #2 0x00007f7fcd51f7b6 in __GI_raise (sig=sig@entry=6) at ../sysdeps/posix/raise.c:26 #3 0x00007f7fcd50634b in __GI_abort () at abort.c:77 #4 0x00007f7fcd8b5575 in default_fatal_finish (type=LOG_TYPE_PANIC, status=0) at ../lib/failures.c:461 #5 fatal_handler_real (ctx=<optimized out>, format=<optimized out>, args=<optimized out>) at ../lib/failures.c:473 #6 0x00007f7fcd996283 in default_fatal_handler (ctx=<optimized out>, format=<optimized out>, args=<optimized out>) at ../lib/failures.c:481 #7 0x00007f7fcd8b54d7 in i_panic (format=format@entry=0x7f7fcdd3eac8 "file %s: line %d (%s): assertion failed: (%s)") at ../lib/failures.c:526 #8 0x00007f7fcdc57237 in mail_user_deinit (user=<optimized out>) at /usr/src/debug/dovecot-2.4.2/src/lib-storage/mail-user.c:185 #9 mail_user_deinit (user=<optimized out>) at /usr/src/debug/dovecot-2.4.2/src/lib-storage/mail-user.c:183 #10 0x000055b93b0c18f2 in doveadm_mail_next_user (ctx=0x55b93ed9dfb8, error_r=<optimized out>) at /usr/src/debug/dovecot-2.4.2/src/doveadm/doveadm-mail.c:505 #11 0x000055b93b0c35e7 in doveadm_mail_cmd_exec (ctx=0x55b93ed9dfb8, wildcard_user=0x0) at /usr/src/debug/dovecot-2.4.2/src/doveadm/doveadm-mail.c:705 #12 doveadm_cmd_ver2_to_mail_cmd_wrapper (cctx=<optimized out>) at /usr/src/debug/dovecot-2.4.2/src/doveadm/doveadm-mail.c:1034 #13 0x000055b93b0d7dd7 in doveadm_cmdline_run (argc=<optimized out>, argv=0x55b93ed69840, cctx=cctx@entry=0x55b93ed90fa8) at /usr/src/debug/dovecot-2.4.2/src/doveadm/doveadm-cmd-parse.c:451 #14 0x000055b93b0d7f8c in doveadm_cmdline_try_run (cmd_name=cmd_name@entry=0x55b93ed6987c "force-resync", argc=<optimized out>, argv=<optimized out>, cctx=cctx@entry=0x55b93ed90fa8) at /usr/src/debug/dovecot-2.4.2/src/doveadm/doveadm-cmd.c:160 #15 0x000055b93b0b101d in main (argc=<optimized out>, argv=<optimized out>) at /usr/src/debug/dovecot-2.4.2/src/doveadm/doveadm.c:406 Unfortunately, this interrupted run left many new mailboxes in place:
$ doveadm mailbox list -u [2]user@domain.ext Junk Drafts Drafts/fts-flatcurve Drafts/fts-flatcurve/current.1756201209435330 Drafts/fts-flatcurve/index.5092 Trash Trash/fts-flatcurve Trash/fts-flatcurve/current.1756242793225435 Trash/fts-flatcurve/index.5401 Trash/Junk Trash/Junk/fts-flatcurve Trash/Junk/fts-flatcurve/index.6279 Trash/Junk/fts-flatcurve/current.1756366793619309
Interestingly, a short ago I deleted the Junk mailbox with "doveadm mailbox delete -e Junk". Trash/Junk was never a thing.
Version: 2.4.2
In case FTS config is useful:
mail_plugins { fts = yes fts_flatcurve = yes quota = yes virtual = yes }
fts flatcurve { substring_search = yes }
fts_autoindex = yes
language en { default = yes } language de { } language_tokenizers = generic email-address
Akos
References
Visible links
- mailto:user@domain.ext
- mailto:user@domain.ext
Try to cd to the maildir main directory e.g. cd /home/szots/mail and run the force-resync command from there. It might work.
Zak.
Try to cd to the maildir main directory e.g. cd /home/szots/mail and run the force-resync command from there. It might work.
Zak.
Try to cd to the maildir main directory e.g. cd /home/szots/mail and run the force-resync command from there. It might work.
Unfortunately, it didn't work. However, when I commented out FTS, it allowed the resync to finish:
mail_plugins { # fts = yes # fts_flatcurve = yes }
It's seems it's something around full-text search implementation.
Even in disabled FTS state, force-resync brings back fts-flatcurve mailboxes. I remove them with "doveadm mailbox delete", then a new force-resync, and they're back there.
Ákos
Something is broken with maintaining the index properly.
There's a "Sent" mailbox that I don't use any more (instead, I use one with a localised name). I had moved all my messages out before.
- Deleted it with "doveadm mailbox delete -e Sent -u my_user". The directory got removed from the filesystem (from under mail/mailboxes).
- I still see it in the index. There's a directory under index/inbox/mailboxes/Sent.
- Removed all other old and flatcurve directories with "mailbox delete"
- After a force-resync they happily reappear.
Altogether I have 6 mailboxes. Just yesterday, on the very same account, dovecot index log registered 64 directory and mailbox deletions:
doveadm dump /var/spool/mail/user/index/inbox/dovecot.mailbox.log | grep -c delete- 64
No other actions were registered. This means that after every force-resync & deletion run Dovecot properly registered the request to delete the mailboxes but did not execute the action on the index. Otherwise it wouldn't be possible to delete a few directories 64 times.
Relevant config section:
mail_driver = mdbox mail_path = %{home}/mail mail_index_path = %{home}/index/inbox
Ákos
Something is broken with maintaining the index properly.
There's a "Sent" mailbox that I don't use any more (instead, I use one with a localised name). I had moved all my messages out before.
1. Deleted it with "doveadm mailbox delete -e Sent -u my_user". The
directory got removed from the filesystem (from under mail/mailboxes).
2. I still see it in the index. There's a directory under
index/inbox/mailboxes/Sent.
3. Removed all other old and flatcurve directories with "mailbox delete"
4. After a force-resync they happily reappear.
Altogether I have 6 mailboxes. Just yesterday, on the very same account, dovecot index log registered 64 directory and mailbox deletions:
doveadm dump /var/spool/mail/user/index/inbox/dovecot.mailbox.log | grep -c delete- 64
No other actions were registered. This means that after every force-resync & deletion run Dovecot properly registered the request to delete the mailboxes but did not execute the action on the index. Otherwise it wouldn't be possible to delete a few directories 64 times.
Relevant config section:
mail_driver = mdbox mail_path = %{home}/mail mail_index_path = %{home}/index/inbox
Akos
participants (2)
-
Szőts Ákos
-
Zakaria