View previous topic :: View next topic |
Author |
Message |
nbensa l33t
Joined: 10 Jul 2002 Posts: 799 Location: Buenos Aires, Argentina
|
Posted: Tue Sep 19, 2006 2:20 am Post subject: Any cyrus-imap guru out there? I broken my imap db... |
|
|
I was upgrading my server today and after a reboot, cyrus wouldn't start. So I checked the logs:
Code: | Sep 18 23:05:42 zeddmore master[11385]: setrlimit: Unable to set file descriptors limit to -1: Operation not permitted
Sep 18 23:05:42 zeddmore master[11385]: retrying with 1024 (current max)
Sep 18 23:05:42 zeddmore master[11385]: process started
Sep 18 23:05:42 zeddmore master[11389]: about to exec /usr/lib/cyrus/ctl_cyrusdb
Sep 18 23:05:42 zeddmore ctl_cyrusdb[11389]: DBERROR: db4
Sep 18 23:05:42 zeddmore ctl_cyrusdb[11389]: recovering cyrus databases
Sep 18 23:05:42 zeddmore ctl_cyrusdb[11389]: skiplist: recovered /var/imap/mailboxes.db (106 records, 13796 bytes) in 0 seconds
Sep 18 23:05:42 zeddmore ctl_cyrusdb[11389]: skiplist: recovered /var/imap/annotations.db (0 records, 144 bytes) in 0 seconds
Sep 18 23:05:42 zeddmore ctl_cyrusdb[11389]: DBERROR: db4
Sep 18 23:05:42 zeddmore ctl_cyrusdb[11389]: DBERROR: db4
Sep 18 23:05:42 zeddmore ctl_cyrusdb[11389]: DBERROR: critical database situation
Sep 18 23:05:42 zeddmore master[11385]: process 11389 exited, status 75
Sep 18 23:05:42 zeddmore master[11385]: ready for work
Sep 18 23:05:42 zeddmore master[11413]: about to exec /usr/lib/cyrus/tls_prune
Sep 18 23:05:42 zeddmore master[11414]: about to exec /usr/lib/cyrus/ctl_deliver
Sep 18 23:05:42 zeddmore cyr_expire[11414]: DBERROR : db4
Sep 18 23:05:42 zeddmore cyr_expire[11414]: DBERROR: critical database situation
Sep 18 23:05:42 zeddmore master[11415]: about to exec /usr/lib/cyrus/ctl_cyrusdb
Sep 18 23:05:42 zeddmore ctl_cyrusdb[11415]: DBERROR: db4
Sep 18 23:05:42 zeddmore ctl_cyrusdb[11415]: DBERROR: critical database situation
Sep 18 23:05:42 zeddmore master[11385]: process 11414 exited, status 75
Sep 18 23:05:42 zeddmore master[11385]: process 11415 exited, status 75
Sep 18 23:05:42 zeddmore tls_prune[11413]: DBERROR : db4
Sep 18 23:05:42 zeddmore tls_prune[11413]: DBERROR: critical database situation
Sep 18 23:05:42 zeddmore master[11385]: process 11413 exited, status 75
Sep 18 23:05:52 zeddmore master[11385]: exiting on SIGTERM/SIGINT
|
Between the upgraded packages I can remember openssl and affected packages depending on it. This included removing lib{ssl,crypto}*0.9.7. If you need emerge.log, I can post it.
I really have no idea how to recover from this or if it is possible at all so I'll be wide-open to any suggestions you may have
Many thanks in advance,
Norberto |
|
Back to top |
|
|
Janne Pikkarainen Veteran
Joined: 29 Jul 2003 Posts: 1143 Location: Helsinki, Finland
|
Posted: Tue Sep 19, 2006 2:21 pm Post subject: |
|
|
First, BACKUP YOUR CURRENT /var/imap.
Then
1. Figure out what is your current version of BerkeleyDB installed: for example with emerge -pv db
2. Stop Cyrus.
3. cd /var/imap/db
4. dbX.Y_recover (where X is the major and Y the minor version of BerkeleyDB version: for example for BDB 4.1 you would run db4.1_recover)
5. Pray for help.
6. Start Cyrus.
7. See if it works. _________________ Yes, I'm the man. Now it's your turn to decide if I meant "Yes, I'm the male." or "Yes, I am the Unix Manual Page.". |
|
Back to top |
|
|
nbensa l33t
Joined: 10 Jul 2002 Posts: 799 Location: Buenos Aires, Argentina
|
Posted: Wed Sep 20, 2006 1:42 am Post subject: |
|
|
Thanks Janne. I've tried that before but it didn't fix anything. Finally, I did: Code: | rm /var/imap/*.db
rm /var/imap/db*/*
|
... and everything is working |
|
Back to top |
|
|
cyclohexan n00b
Joined: 11 Nov 2004 Posts: 50 Location: Germany
|
Posted: Tue May 08, 2007 9:45 pm Post subject: |
|
|
Hi,
I had the same problem.
db4.3_recover didn't work, but after deleting the db files and restarting cyrus, the db4 error in the logfile disappeared. (Thank you, nbensa.)
However, my mail client cannot login to the user's IMAP mailbox any more. (Authentication failed.)
I don't remember the password, because it was stored in my mail client, but it should work however.
1. What could be the reason why the authentication fails?
2. How can I change a user's Cyrus-IMAP-password? |
|
Back to top |
|
|
nbensa l33t
Joined: 10 Jul 2002 Posts: 799 Location: Buenos Aires, Argentina
|
Posted: Tue May 08, 2007 10:43 pm Post subject: |
|
|
saslpasswd2 |
|
Back to top |
|
|
cyclohexan n00b
Joined: 11 Nov 2004 Posts: 50 Location: Germany
|
Posted: Tue May 08, 2007 11:25 pm Post subject: |
|
|
Thanks.
saslpasswd2 showed no users. Perhaps the information is lost while deleting the db files?
So I created a new password for the user jan using saslpasswd2 jan.
Now my mail client (Thunderbird) says: Code: | The current command did not succeed. The mail server responded: Mailbox does not exist. |
The last 2 lines of /var/log/everything/current say:
Code: | May 9 01:14:35 [imap] auxpropfunc error invalid parameter supplied_
May 9 01:14:50 [imap] login: localhost [127.0.0.1] jan plaintext User logged in |
ls -la /var/spool/imap/j/jan/ says:
Code: | total 12
drwx------ 2 cyrus mail 144 Sep 3 2005 .
drwxr-x--- 4 cyrus mail 144 May 7 19:15 ..
-rw------- 1 cyrus mail 4 Sep 3 2005 cyrus.cache
-rw------- 1 cyrus mail 146 Sep 3 2005 cyrus.header
-rw------- 1 cyrus mail 76 Sep 3 2005 cyrus.index |
This directory had been full of mail files before. (Fortunately I saved them to another directory.)
Any ideas? |
|
Back to top |
|
|
nbensa l33t
Joined: 10 Jul 2002 Posts: 799 Location: Buenos Aires, Argentina
|
Posted: Tue May 08, 2007 11:38 pm Post subject: |
|
|
hmmm.... Show me |
|
Back to top |
|
|
cyclohexan n00b
Joined: 11 Nov 2004 Posts: 50 Location: Germany
|
Posted: Wed May 09, 2007 6:30 am Post subject: |
|
|
ls -l /etc/sasl2 says:
Code: | total 388
-rw-r----- 1 root mail 393273 May 9 01:01 sasldb2 |
|
|
Back to top |
|
|
nbensa l33t
Joined: 10 Jul 2002 Posts: 799 Location: Buenos Aires, Argentina
|
Posted: Wed May 09, 2007 11:34 am Post subject: |
|
|
Is your cyrus user member of mail group? |
|
Back to top |
|
|
nbensa l33t
Joined: 10 Jul 2002 Posts: 799 Location: Buenos Aires, Argentina
|
Posted: Wed May 09, 2007 11:37 am Post subject: |
|
|
Sorry. On a second read, your cyrus is working, just no emails there. Can you restore your /var/spool/imap/j/jan directory?
BTW, mine is /var/spool/imap/n/user/nbensa ... Is yours a typo? |
|
Back to top |
|
|
cyclohexan n00b
Joined: 11 Nov 2004 Posts: 50 Location: Germany
|
Posted: Wed May 09, 2007 4:14 pm Post subject: |
|
|
Oh, my fault. In /var/spool/imap/j/user/jan/ my mails are still stored.
Is it not normal that the dir /var/spool/imap/j/jan/ exists? Perhaps I created it accidentally while playing with cyradm...
No, my user is not in the mail group. Is that necessary? |
|
Back to top |
|
|
cyclohexan n00b
Joined: 11 Nov 2004 Posts: 50 Location: Germany
|
Posted: Wed May 09, 2007 9:35 pm Post subject: |
|
|
OK, I solved my problem the following way:
1. I installed dovecot
2. I wrote a script to convert the cyrus maildir into a dovecot maildir
3. I said bye bye to cyrus
The second step was necessary, because neither cyrus2courier nor cyrus2maildir.py worked for me.
If anyone is interested in the script, just let me know.
Anyway, thanks for your help, nbensa. |
|
Back to top |
|
|
luispa Guru
Joined: 17 Mar 2006 Posts: 359 Location: España
|
Posted: Thu May 10, 2007 8:01 am Post subject: |
|
|
nbensa wrote: | Thanks Janne. I've tried that before but it didn't fix anything. Finally, I did: Code: | rm /var/imap/*.db
rm /var/imap/db*/*
|
... and everything is working |
Same problem here, doing the above also solved the problem
Luis |
|
Back to top |
|
|
aZZe l33t
Joined: 20 Feb 2003 Posts: 965 Location: Dinslaken, Germany
|
Posted: Sun May 20, 2007 2:51 pm Post subject: |
|
|
Hi!
I had exactly the same problem. I also deleted the dp files in /var/imap. But now I have also the problem that my mail client tells me the mailbox doesn't exist. When I use cyradm I still see my mailbox with its quota etc. So how do I tell the database that the mailbox still exists? _________________ ASUS 4A785TD-V EVO with AMD Phenom(tm) II X4 965
4GB RAM DDR3-1333
ATI Radeon HD4870 |
|
Back to top |
|
|
|