[Dovecot] Correct usage of NFS mounted Maildirs
Dovecot 1.0RC15 running on Fedora Core 5 kernel 2.6.18-1.2257.fc5smp. A SLES10 server (kernel 2.6.16.21-0.8-smp) has the home directories on an ext3 partition mounted with options (rw,acl,user_xattr,usrquota) which is then exposed as an NFS mount with server side options (rw,no_root_squash,no_acl,async). The home directories include Maildirs to which postfix delivers. The Fedora Core 5 dovecot&postfix machine then mounts this NFS mount with options (rw,hard,intr)
Dovecot variables: mmap_disable=yes lock_method=dotlock default_mail_env = maildir:~/Maildir:INDEX=/usr/local/dovecot/indexes/%u (only one dovecot server and wanted to see if local indices helped)
I didn't turn off the attribute caching of NFS since I only have one dovecot server, I think the wiki said it was safe to leave on in this case.
With this configuration, I am seeing a lot of NFS Stale Filehandle errors, even after moving the index files to a local disk. Here's an excerpt from the log:
dovecot: Dec 22 11:23:06 Info: Dovecot v1.0.rc15 starting up dovecot: Dec 22 11:23:22 Info: imap-login: Login: user=<nfsuser1>, method=plain, rip=138.26.64.50, lip=138.26.64.5 dovecot: Dec 22 11:23:24 Info: imap-login: Login: user=<nfsuser1>, method=plain, rip=138.26.64.50, lip=138.26.64.5 dovecot: Dec 22 11:24:48 Info: imap-login: Login: user=<nfsuser1>, method=plain, rip=138.26.64.50, lip=138.26.64.5 dovecot: Dec 22 11:26:43 Error: IMAP(nfsuser1): inotify_add_watch(/nethome/facstaff/nfsuser1/Maildir/.Trash/new) failed: Stale NFS file handle dovecot: Dec 22 11:26:43 Error: IMAP(nfsuser1): inotify_add_watch(/nethome/facstaff/nfsuser1/Maildir/new) failed: Stale NFS file handle
To be honest, I'm not 100% sure this is a dovecot problem, because I also see that I am getting stale filehandles when postfix tries to deliver the mail to the Maildir, but I'm curious as to whether this is because of something dovecot did because I have it misconfigured.
Does anything about my dovecot config provide any clues as to what I might have done wrong? The NFS mounts are completely stable everywhere except within the Maildirs. From the shell, I can run a loop to call 'ls' 1000 times outside of a Maildir and it works fine. Inside a Maildir, I will get Stale NFS Filehandle errors before long. Does this sound like it could have something to do with my Dovecot config, given that it is happening even after I moved indices to the local disk (still getting stale filehandle errors on files like dovecot-keywords). I performed the following procedure:
- shut down dovecot
- did a rm-rf Maildir on my test account
- unmounted the NFS mount /nethome/facstaff
- remounted the NFS mount /nethome/facstaff
- set the index files to be local in dovecot.conf and created that directory (/usr/local/dovecot/index/)
- sent a few test mails to the user (to recreate the Maildir)
- started dovecot
- logged in (via Thunderbird) to account through dovecot.
- read test message
- deleted test message
- opened shell to dovecot server
- cd'ed into user's Maildir
- ran 'ls' a few times. Got Stale Filehandle errors after a few.
- back in Thunderbird, tried to read/move/delete other test mails, got the above errors in the log.
If it's not a dovecot issue I know it's off-topic, but has anyone else seen similar? I might be imagining this, but I think the problem started when I moved from SLES9 to SLES10 for my fileserver (newer kernel, newer version of NFS, perhaps an incompatibility here?)
Thanks, Fran
On Fri, 2006-12-22 at 11:39 -0600, Fran Fabrizio wrote:
inotify_add_watch(/nethome/facstaff/nfsuser1/Maildir/.Trash/new) failed: Stale NFS file handle
So they're all from inotify_add_watch()? Inotify doesn't work with NFS, so you could fix this by disabling inotify completely (configure --with-notify=none).
I think I'll also change the code so that it just silently ignores this problem and disables inotify.
participants (2)
-
Fran Fabrizio
-
Timo Sirainen