[Dovecot] Indexes recovery failed
Hi Timo,
Was getting the following error repeatedly in my mail client (squirremail)
"error: connection dropped by IMAP server"
Looked at the logs for this user and found the following:
Nov 19 17:11:32 mink dovecot: IMAP(bobuser@maildom.com): broken sync positions in index file /virtual/store2/mail/s/bobuser_maildom.com/Maildir/dovecot.index Nov 19 17:11:32 mink dovecot: IMAP(bobuser@maildom.com): fscking index file /virtual/store2/mail/s/bobuser_maildom.com/Maildir/dovecot.index Nov 19 17:11:32 mink dovecot: IMAP(bobuser@maildom.com): Fixed index file /virtual/store2/mail/s/bobuser_maildom.com/Maildir/dovecot.index: log_file_tail_offset 2273345664 -> 996 Nov 19 17:11:32 mink dovecot: Panic: IMAP(bobuser@maildom.com): file mail-transaction-log.c: line 341 (mail_transaction_log_set_mailbox_sync_pos): assertion failed: (file_offset >= log->head->saved_tail_offset) Nov 19 17:11:32 mink dovecot: IMAP(bobuser@maildom.com): Raw backtrace: imap [0x46c772] -> imap [0x46c7e3] -> imap [0x46be56] -> imap [0x452d6d] -> imap(mail_index_sync_commit+0x42) [0x44e022] -> imap(maildir_sync_index_finish+0xdd) [0x42b59d] -> imap [0x42ada1] -> imap(maildir_storage_sync_init+0x64) [0x42af44] -> imap(mailbox_sync+0x1c) [0x43e96c] -> imap(cmd_select_full+0xce) [0x41a2be] -> imap(cmd_select+0xb) [0x41a44b] -> imap [0x41bb7c] -> imap [0x41bc32] -> imap [0x41c3ff] -> imap(client_input+0x63) [0x41c633] -> imap(io_loop_handler_run+0xf8) [0x472ed8] -> imap(io_loop_run+0x1d) [0x471ffd] -> imap(main+0x3c2) [0x423a92] -> /lib/libc.so.6(__libc_start_main+0xf4) [0x7f29213711c4] -> imap [0x416349]
Looks like dovecot tried to fix the indexes but failed. I manually deleted all the dovecot.index* files and the account started working.
Perhaps dovecot could try the fix but if it still fails just go and delete the indexes itself?
Dovecot version 1.1.6 Using Maildirs Over NFS mount
If you need any more info just let me know.
Regards, Daniel
On Nov 24, 2008, at 11:14 AM, Daniel Watts wrote:
Nov 19 17:11:32 mink dovecot: Panic: IMAP(bobuser@maildom.com): file
mail-transaction-log.c: line 341
(mail_transaction_log_set_mailbox_sync_pos): assertion failed:
(file_offset >= log->head->saved_tail_offset)
I'll see if I can get this fixed, but..
Looks like dovecot tried to fix the indexes but failed. I manually
deleted all the dovecot.index* files and the account started working.
If it happens again, please make a copy of the files before deleting.
It's a lot easier to debug these bugs if I can see the dovecot.index
and dovecot.index.log contents.
Perhaps dovecot could try the fix but if it still fails just go and
delete the indexes itself?
It's not really possible to delete indexes automatically because of a
crash.
Timo,
If it happens again, please make a copy of the files before deleting. It's a lot easier to debug these bugs if I can see the dovecot.index and dovecot.index.log contents.
I will do - have asked my sysadmin to make backups the next time it happens.
Perhaps dovecot could try the fix but if it still fails just go and delete the indexes itself?
It's not really possible to delete indexes automatically because of a crash.
May I ask why? This is bascially what we do manually if we encounter a corrupt, unrepairable index and it seems to work fine with no noticeable negative impact.
Dan
On Nov 24, 2008, at 1:00 PM, Daniel Watts wrote:
Perhaps dovecot could try the fix but if it still fails just go
and delete the indexes itself?It's not really possible to delete indexes automatically because of
a crash.May I ask why? This is bascially what we do manually if we encounter
a corrupt, unrepairable index and it seems to work fine with no
noticeable negative impact.
Perhaps it might work for some situations, but it would need code to:
- locate the log file (difficult if you're logging to syslog)
- parse the log file
- figure out if crash was caused by a broken index file or something
else
All of this just to work around some rare bugs that shouldn't be
happening in the first place. And in some situations it might delete
index files that didn't even need to be deleted.
Of course you could write all of that yourself to a script that's
tailing Dovecot's error log and it would work just as well as anything
Dovecot could internally implement.
participants (2)
-
Daniel Watts
-
Timo Sirainen