1. Store
  2. Apps
  3. Hardware
  4. Support
  5. Solutions

ClearFoundation

Forums
Welcome, Guest
mail in queue and cyrusdb error in maillog
(1 viewing) 1 Guest
Go to bottomPage: 1
TOPIC: mail in queue and cyrusdb error in maillog
*
#43238
mail in queue and cyrusdb error in maillog 10 Months, 3 Weeks ago  
Dear ClearOS forum,
We are useing ClearOS 5.2 for about 1 year now, and it worked pretty good so far.
But last week mail was no longer delivered. It remained in the queue, and the maillog showed a cyrusdb error.
To resolve we changed the DB_CONFIG file like this:
cat > /var/lib/imap/db/DB_CONFIG
set_cachesize 0 2097152 1
set_lg_regionmax 1048576
^D

We recovered the database and restarted the mail service.
However, not it occurred again. This is what I find in the maillog:

Jul 2 17:09:59 office lmtp[25058]: DBERROR db4: Logging region out of memory; you may need to increase its size
Jul 2 17:09:59 office lmtp[25058]: DBERROR: opening /var/lib/imap/deliver.db: Cannot allocate memory
Jul 2 17:09:59 office lmtp[25058]: DBERROR: opening /var/lib/imap/deliver.db: cyrusdb error
Jul 2 17:09:59 office lmtp[25058]: FATAL: lmtpd: unable to init duplicate delivery database
Jul 2 17:09:59 office master[18147]: service lmtp pid 25058 in READY state: terminated abnormally
Jul 2 17:09:59 office lmtp[25059]: DBERROR db4: Logging region out of memory; you may need to increase its size
Jul 2 17:09:59 office lmtp[25059]: DBERROR: opening /var/lib/imap/deliver.db: Cannot allocate memory
Jul 2 17:09:59 office lmtp[25059]: DBERROR: opening /var/lib/imap/deliver.db: cyrusdb error
Jul 2 17:09:59 office lmtp[25059]: FATAL: lmtpd: unable to init duplicate delivery database
Jul 2 17:09:59 office master[18147]: service lmtp pid 25059 in READY state: terminated abnormally
Jul 2 17:09:59 office lmtp[25060]: DBERROR db4: Logging region out of memory; you may need to increase its size
Jul 2 17:09:59 office lmtp[25060]: DBERROR: opening /var/lib/imap/deliver.db: Cannot allocate memory
Jul 2 17:09:59 office lmtp[25060]: DBERROR: opening /var/lib/imap/deliver.db: cyrusdb error
Jul 2 17:09:59 office lmtp[25060]: FATAL: lmtpd: unable to init duplicate delivery database
Jul 2 17:09:59 office master[18147]: service lmtp pid 25060 in READY state: terminated abnormally
Jul 2 17:09:59 office lmtp[25061]: DBERROR db4: Logging region out of memory; you may need to increase its size
Jul 2 17:09:59 office lmtp[25061]: DBERROR: opening /var/lib/imap/deliver.db: Cannot allocate memory
Jul 2 17:09:59 office lmtp[25061]: DBERROR: opening /var/lib/imap/deliver.db: cyrusdb error
Jul 2 17:09:59 office lmtp[25061]: FATAL: lmtpd: unable to init duplicate delivery database
Jul 2 17:09:59 office master[18147]: service lmtp pid 25061 in READY state: terminated abnormally


It keeps on repeating the above, until my maillog file is many Gigabytes large!!
Besides this it does not deliver mail.
I recovered by setting /var/lib/imap/db/DB_CONFIG
set_cachesize 0 150000000 1
set_lg_regionmax 262144
set_lg_bsize 2097152
set_flags DB_LOG_AUTOREMOVE
set_tmp_dir /dev/shm
set_lk_detect DB_LOCK_DEFAULT

recovered the database and restart of the complete server.
Now the maillog is not reporting above error anymore, but for how long?
Has anyone an idea if my fix is OK, and if I actually fixed the problem here?

Please help,
Emiel
Emiel Duivenvoorden
Fresh Boarder
Posts: 4
graphgraph
User Offline Click here to see the profile of this user
Last Edit: 2012/07/03 12:43 By eduif.
The administrator has disabled public write access.
 
#43630
Re:mail in queue and cyrusdb error in maillog 10 Months, 1 Week ago  
Still I have mail problems.
After 1 week again the mail was not delivered.
The queue was loaded with several pages of mail.
People trying to send mail got errors.
The mail log continually reports DBERROR on the cyrus database.
I hope someone can help!!

Jul 13 06:19:59 office master[25489]: service lmtp pid 20669 in READY state: terminated abnormally
Jul 13 06:19:59 office lmtp[20670]: DBERROR db4: Logging region out of memory; you may need to increase its size
Jul 13 06:19:59 office lmtp[20670]: DBERROR: opening /var/lib/imap/deliver.db: Cannot allocate memory
Jul 13 06:19:59 office lmtp[20670]: DBERROR: opening /var/lib/imap/deliver.db: cyrusdb error
Jul 13 06:19:59 office lmtp[20670]: FATAL: lmtpd: unable to init duplicate delivery database
Jul 13 06:19:59 office master[25489]: service lmtp pid 20670 in READY state: terminated abnormally
Jul 13 06:19:59 office lmtp[20671]: DBERROR db4: Logging region out of memory; you may need to increase its size


I did do extra testing and 'solving' after the above posting (but this does not help):
I fixed the database with help of this webpage:
i8n1.blogspot.nl/2010/03/cyrus-imap-logg...n-out-of-memory.html
But also this did not help.
After posting the report of 2 july, I noticed that the cyrusdb has 2 locations:
/var/lib/imap/db
and
/var/lib/imap

Since the described fix was for the first location, I repeated the database fix for the second location.
Created DB_CONFIG listed here:
Code:

[root@office ~]# cat /var/lib/imap/DB_CONFIG
set_cachesize           0 150000000 1
set_lg_regionmax        1048576
set_lg_bsize            2097152
set_flags               DB_LOG_AUTOREMOVE
set_tmp_dir             /dev/shm
set_lk_detect           DB_LOCK_DEFAULT



Then stopped mail server, fixed database and started mail server:

Code:

/etc/init.d/cyrus-imapd stop
db_recover -h /var/lib/imap
/etc/init.d/cyrus-imapd start
/etc/init.d/cyrus-imapd restart



The extra 'restart' was needed because the start showed a failure on importing the database. The restart was OK.

To check the database actually has the settings I did this command:

Code:

[root@office ~]# db_stat -l -h /var/lib/imap
0x40988 Log magic number
10      Log version number
2MB     Log record cache size
0660    Log file mode
10Mb    Current log file size
0       Log bytes written
0       Log bytes written since last checkpoint
0       Total log file writes
0       Total log file write due to overflow
0       Total log file flushes
1       Current log file number
28      Current log file offset
1       On-disk log file number
28      On-disk log file offset
0       Maximum commits in a log flush
0       Minimum commits in a log flush
3MB     Log region size
0       The number of region locks that required waiting (0%)



This listing is of today, after the stop / start of the mail server.
Mail is delivered OK at this time, although this may stop at any time

The db_stat -m is not possible:
Code:

[root@office ~]# db_stat -m -h /var/lib/imap
db_stat: DB_ENV->open: /var/lib/imap: No such file or directory


I'm not sure what that means. The db should be there, and should be OK???

Please help!!
Emiel Duivenvoorden
Fresh Boarder
Posts: 4
graphgraph
User Offline Click here to see the profile of this user
The administrator has disabled public write access.
 
#50480
Re:mail in queue and cyrusdb error in maillog 3 Months ago  
I had this issue today after an unscheduled reboot (i.e. power outage) I found a post that suggested stopping cyrus-imapd and then moving

/var/lib/imap/tls_sessions.db*
/var/lib/imap/deliver.db*

once I did that it all seemed to work again.
Baggypants12000
Junior Boarder
Posts: 23
graphgraph
User Offline Click here to see the profile of this user
The administrator has disabled public write access.
 
#50491
Re:mail in queue and cyrusdb error in maillog 3 Months ago  
Fixed: The clearos mail system works for quite a while without the database error returning.
As it seems there is a delivery database for every account, and I just had to repair the one that was broken...
We had 1 account that acts as a backup, collecting all mail. After repairing the database of this account the problem was fixed:

So first check the maillog:

$ grep ERROR /var/log/maillog
...
Jul 31 15:05:02 office imap[2164]: IOERROR: mapping cache file for user.email-archive: Cannot allocate memory
...

Then goto account directory:

$ cd /var/spool/imap/e/user/email-archive
$ /etc/rc.d/init.d/cyrus-imapd stop
$ cd /var/spool/imap/e/user/e-mail-archive
$ mv cyrus.cache cyrus.cache.bak
$ /usr/lib/cyrus-imapd/reconstruct -rf email-archive
$ /etc/rc.d/init.d/cyrus-imapd start

Check maillog again:

$ tail /var/log/maillog
...
Jul 31 15:05:02 office imap[2164]: IOERROR: mapping cache file for user.email-archive: Cannot allocate memory
...

So it is not fixed yet...

$ cd /var/spool/imap/e/user/email-archive/
$ /usr/lib/cyrus-imapd/reconstruct -r -f user/email-archive

This takes a while ....

$ grep email-archive /var/log/maillog
...
Jul 31 19:25:01 office imap[2890]: login: ###.nl [127.0.0.1] email-archive PLAIN User logged in
...

Login ok again

$ rm cyrus.cache.bak
... y


I also checked this page for help:
tagebuch.localwurst.de/2008/11/11/cyrus-...-to-mmap-cache-file/
Emiel Duivenvoorden
Fresh Boarder
Posts: 4
graphgraph
User Offline Click here to see the profile of this user
The administrator has disabled public write access.
 
Go to topPage: 1
  get the latest posts directly to your desktop