Aborted dsync backup and resulting fallout

Andreas Thienemann andreas at bawue.net
Wed Oct 11 11:22:55 EEST 2017


Hi,

I am in the middle of setting up a dovecot imap server to replace an aging 
cyrus imapd.

The new server is using mdbox storage for better filesystem performance 
and is running dovecot-2.2.32.

To migrate email over and keep UIDs etc. intact I used the backup feature 
of doveadm. During testing this generally worked fine. So thanks for that 
functionality, it really makes migration much easier.

I did another sync yesterday which was unintentionally aborted in the 
middle which left some corrupted files around.

Not a problem generally, that's what doveadm force-resync should fix.
It did move a m.2 to m.2.broken mailbox file, so that is good.
But it seemed to have issues with the m.3 file, which was an empty file of 
0 bytes.

Even running force-resync a repeatedly always showed the same message:

# doveadm force-resync -u cd INBOX
doveadm(cd): Warning: fscking index file 
/var/spool/imap/user/cd/storage/dovecot.map.index
doveadm(cd): Warning: mdbox 
/var/spool/imap/user/cd/storage: rebuilding indexes
doveadm(cd): Error: Corrupted dbox file 
/var/spool/imap/user/cd/storage/m.3 (around offset=0): EOF while reading 
file header
doveadm(cd): Error: mdbox rebuild: Failed to fix file
/var/spool/imap/user/cd/storage/m.3

This looks like incorrect behavior. If the file header on a file expected 
to be a mailbox header is absent, I would expect it to be either 
best-effort parsed and the header added or at least be moved out of the 
way as e.g. m.3.broken.


After fixing the m.3 storage manually I encountered another kind of error 
running dsync again:

dsync(cd): Error: lucene index 
/var/spool/imap/user/cd/lucene-indexes: 
IndexReader::open() failed (#1): IndexInput read past EOF

Lucene index broken should be easily fixed by running doveadm fts rescan. 
Is that correct?


The other error thought had to do with the single instance store for 
attachments.

There were a bunch of errors about a broken pipe and three errors stating 
success instead:

dsync(cd): Error: fs-sis: Couldn't read hash file 
/var/spool/imap/attachments/c3/0c/hashes/c30cb535927c8bcecb0d45d374624942d0f4e56e: 
Broken pipe
dsync(cd): Error: fs-sis: Couldn't read hash file 
/var/spool/imap/attachments/0f/0b/hashes/0f0b5351e09ebb487660f23c9b617568093b93d1: 
Broken pipe
dsync(cd): Error: fs-sis: Couldn't read hash file 
/var/spool/imap/attachments/10/f9/hashes/10f9a4ffd14a5c31f9938c9d8a3ce3f2095fab36: 
Success
dsync(cd): Error: fs-sis: Couldn't read hash file 
/var/spool/imap/attachments/9b/9a/hashes/9b9a449477882dfca86e80157616cadbb21bb3b8: 
Success
dsync(cd): Error: fs-sis: Couldn't read hash file 
/var/spool/imap/attachments/df/69/hashes/df698a8bda301a7a474ae2b11414c6f532f4461e: 
Broken pipe

As with the m.3 storage file, all these files had 0 byte size. What is the 
best way of fixing these up? Delete and be done?

Thanks,
  Andreas


More information about the dovecot mailing list