Sean Porter
2004-Nov-23 18:48 UTC
[Dovecot] NFS, test52, maildir, freebsd 4.x and OS X (Panther) Server
I've been working on setting up a Dovecot server with a maildir mailboxes stored over NFS. Initially, everything was working great, and then I started seeing this error as previously discussed on the list in my maillog: (mail_index_expunge): assertion failed: (!t->view->external) Timo, in another thread, suggested to remove line 247 in mail-index-transaction.c in the test52 source, which I blithely ignored as I thought this would remove only the error message from the logfile and not fix the problem. At Mark Lidstone's helpful off-list insistence I did remove the line, recompile, and everything did seem to be working, until I encountered a different error. I started doing some light load testing from multiple clients (essentially, clicking like a rabid monkey on Get Mail in Thunderbird and hitting different mailbox links in Squirrelmail as the same user) and started running into this error in the logs: Nov 22 20:10:46 server dovecot: IMAP(mailuser at example.com): rename(/host/mail/mailboxes/mailuser at example.com/dovecot-uidlist.lock, /host/mail/mailboxes/mailuser at example.com/dovecot-uidlist) failed: Input/output error Nov 22 20:10:46 server dovecot: IMAP(mailuser at example.com): file_dotlock_replace(/host/mail/mailboxes/mailuser at example.com/dovecot- uidlist) failed: Input/output error Oddly, the dovecot-uidlist.lock file was unremovable on the NFS server (OS X Panther Server) with a simple 'rm', so I started digging into things a little further. It seems that the OS X NFS code is based on the FreeBSD 5.x codebase. The server that Dovecot (and my NFS client) lives on is FreeBSD 4.x, which doesn't support NFS locking at all(incidentally, the FreeBSD NFS Server is apparently incompatible with Linux NFS clients as well -- nice!). Per the suggestion in http://www.dovecot.org/doc/nfs.txt I'd already been storing my index files locally, but it appeared that the control files were somehow blowing up, even with NFS-safe dotlocking. All hope was nearly lost when I came across this tidbit in a post from Timo(http://www.dovecot.org/list/dovecot/2003-May/001489.html): - :CONTROL=dir in default_mail_env can specify where to save dovecot-uidlist and .customflags files. Useful for above problems. I then changed my dovecot.conf to retreive the mailboxes from the NFS mount, but store the indexes and the control files locally: default_mail_env = maildir:/host/mail/mailboxes/%u:INDEX=/home/dovecot/%u/indexes: CONTROL=/home/dovecot/%u/control All seems well so far. I know this is a relatively unique setup, but I thought it might help some of the other people that are running into NFS-related issues. Suggestion: perhaps the :CONTROL directive could be added to mail-storages.txt or dovecot-example.conf? A hint may also want to be added to http://www.dovecot.org/doc/nfs.txt. Sean
Timo Sirainen
2004-Nov-29 03:02 UTC
[Dovecot] NFS, test52, maildir, freebsd 4.x and OS X (Panther) Server
On 23.11.2004, at 20:48, Sean Porter wrote:> I started doing some light load testing from multiple clients > (essentially, clicking like a rabid monkey on Get Mail in Thunderbird > and hitting different mailbox links in Squirrelmail as the same user) > and started running into this error in the logs: > > Nov 22 20:10:46 server dovecot: IMAP(mailuser at example.com): > rename(/host/mail/mailboxes/mailuser at example.com/dovecot-uidlist.lock, > /host/mail/mailboxes/mailuser at example.com/dovecot-uidlist) failed: > Input/output error > Nov 22 20:10:46 server dovecot: IMAP(mailuser at example.com): > file_dotlock_replace(/host/mail/mailboxes/mailuser at example.com/ > dovecot-uidlist) failed: Input/output errorThat is a bit strange. I know NFS server can give ESTALE errors ("Stale NFS file handle") which Dovecot doesn't yet handle everywhere, but I didn't know it would ever give EIO. Maybe I should handle them the same way as ESTALE? .. I don't know really. Some NFS expert needed here :) Anyway, the problem has something to do with trying to rename a file over another (which just appeared itself) and either NFS server or NFS client gets somehow confused.> Suggestion: perhaps the :CONTROL directive could be added to > mail-storages.txt or dovecot-example.conf? A hint may also want to be > added to http://www.dovecot.org/doc/nfs.txt.I try to get rid of everything in doc/ and move them to Wiki (which get then moved to doc/). Wiki could use some NFS page of course. test53 should finally be fully functional in it, other than those ESTALE problems which can cause errors when multiple sessions are open to same mailbox. -------------- next part -------------- A non-text attachment was scrubbed... Name: PGP.sig Type: application/pgp-signature Size: 186 bytes Desc: This is a digitally signed message part URL: <http://dovecot.org/pipermail/dovecot/attachments/20041129/e59cc17e/attachment-0001.bin>