On 10/02/2023 17:15 EET Sohin Vyacheslav slawa@vivaldi.net wrote:
Hi All,
In mail.log exists an error messages "Error: Corrupted index cache file /data/mail/vhosts/domain.com/user@domain.com/Maildir/dovecot.index.cache: invalid record size" for some accounts.
I tried these steps to fix it:
- Running commands
doveadm -D -v index -u user@domain.com INBOX
# doveadm -v force-resync -u user@domain.com INBOX
after this I saw that the following files are updated in ../Maildir/: dovecot.index.cache dovecot.index.log dovecot-uidlist
But after some time error messages occurred again.
Added NFS mount option 'nordirplus' to /etc/fstab with remount /data partition, add 'mmap_disable = yes' and 'mail_fsync = always' to 10-mail.conf as advised on https://doc.dovecot.org/configuration_manual/nfs/ (because /data partition mounted via NFS);
Renaming 3 files with/without Dovecot service pre-stop.
mv dovecot.index old.dovecot.index
# mv dovecot.index.cache old.dovecot.index.cache # mv dovecot.index.log old.dovecot.index.log
Unfortunately, all done steps didn't fix issue. What is the proper way to fix corrupted index cache errors?
dovecot package: 1:2.2.33.2-1ubuntu4.8 (Ubuntu-18.04).
p.s. for some of email accounts also exists error messages "Error: Broken file ../Maildir/dovecot-uidlist line ###: Invalid data:" besides mentioned cache error.
-- Best wishes Sohin Vyacheslav
It sounds like your NFS is somehow managing to break the files, this can happen easily if same user is accessed by two backends concurrently.
Aki