On Tue, 2008-09-30 at 02:08 -0400, Steven Winikoff wrote: > Sep 30 00:09:56 alcor dovecot: pop3[5006] XXXX, NNN.NNN.NN.NNN: Corrupted > transaction log file /home/XXXX/.imap/INBOX/dovecot.index.log: record size > too small (type=0x40, offset=12224, size=0) .. > I've been working around the problem by deleting the contents of > ~user/.imap for affected users, but I'd really prefer to fix it > properly. :-) Any suggestions would be gratefully received.
I think this should get fixed by itself? Although the first login fails, the next one should succeed. Can you reproduce this by running imaptest (on a test account)? http://imapwiki.org/ImapTest Could you apply the attached patch and when it happens for some user send the saved dovecot.index.broken and dovecot.index.log.broken files to me? Those files don't contain anything sensitive about the user's mails. It'll also log a raw backtrace which might show something useful, so I'd like to see that too (that's only useful if it shows function names, so debug symbols shouldn't be stripped from the Dovecot binaries). I'm not really sure how that error message could happen unless the log file's contents changed while it was being read. You could also see if setting mmap_disable=yes makes any difference.
diff -r 645ea17b4950 src/lib-index/mail-transaction-log-file.c --- a/src/lib-index/mail-transaction-log-file.c Sun Oct 05 14:22:28 2008 +0300 +++ b/src/lib-index/mail-transaction-log-file.c Sun Oct 05 14:48:13 2008 +0300 @@ -8,6 +8,8 @@ #include "read-full.h" #include "write-full.h" #include "mmap-util.h" +#include "backtrace-string.h" +#include "file-copy.h" #include "mail-index-private.h" #include "mail-transaction-log-private.h" @@ -19,6 +21,12 @@ const char *fmt, ...) { va_list va; + const char *dest, *backtrace; + + dest = t_strdup_printf("%s.broken", file->log->index->filepath); + file_copy(file->log->index->filepath, dest, FALSE); + dest = t_strdup_printf("%s.broken", file->filepath); + file_copy(file->filepath, dest, FALSE); file->corrupted = TRUE; file->hdr.indexid = 0; @@ -38,6 +46,8 @@ mail_index_set_error(file->log->index, "Corrupted transaction log file %s: %s", file->filepath, t_strdup_vprintf(fmt, va)); + if (backtrace_get(&backtrace) == 0) + i_error("log corruption raw backtrace: %s", backtrace); } T_END; va_end(va); }
signature.asc
Description: This is a digitally signed message part