db errors with cyrus imapd
During some random work, cyrus started to act like it was in some distress:
Mar 21 10:46:06 jupiter pop3s[11604]: DBERROR db4: Database handles open during environment close
Things got worse:
Mar 21 12:12:22 jupiter lmtpunix[23062]: DBERROR db4: operation not permitted during recovery.
Mar 21 12:12:22 jupiter lmtpunix[23062]: DBERROR: opening /opt/cyrus/imap/deliver.db: Invalid argument
Mar 21 12:12:22 jupiter lmtpunix[23062]: DBERROR: opening /opt/cyrus/imap/deliver.db: cyrusdb error
After trying many things, I found a solution which worked:
- stop cyrus
- delete the deliver.db, tls_sessions.db, and db/* files
- start cyrus
Cyrus then rebuilt the missing files.
Ref:
http://00f.net/blogs/index.php/2004/12/04/dberror_db4_panic_recovery