Emergancy..... db4: PANIC: fatal region error

Leon Kolchinsky leonk at construct.haifa.ac.il
Sun Jul 29 09:04:51 EDT 2007


> 
> Also another thing I have noticed..
> 
> The sieve scripts all needed to be reranged.  The hash directory was all
> in
> lower case but tthen it need to be upper case so I changed that by hand
> then
> I noticed cyrus was looking for the scripts all in other directories.
> 
> i.e.
> Scripts for 'adam' should be under 'a' or 'A' but found in 'F' or was it
> 'L'.  I can't see the logic in that.  So I moved the 'adam' directory over
> to 'F' and i check it with websieve and all my rules are there but when
> cyrus receives mail it does not even read the rules and just posts the
> mail
> in my INBOX.  I remember I read something about sieve not being the same..
> I am going to look for that again..
> 
> -Adam

Hi,

This is a bit late response but it may help others with similar to yours
problem.
A while ago I did a conversion to skiplist on my SLES9 and documented it.

So, this is my step-by-step howto for any interested person:

1) First let's check with the help of "file" command the DB type of file we
want to convert (like: # file annotations.db):
We get (on my SLES9 machine):
annotations.db:  Cyrus skiplist DB
deliver.db:      Berkeley DB (Btree, version 9, native byte-order)
mailboxes.db:    Cyrus skiplist DB
tls_sessions.db: Berkeley DB (Btree, version 9, native byte-order)
exampleuser.seen: Cyrus skiplist DB

Now we know that we have to convert only deliver.db and tls_sessions.db from
BDB to skiplist.

2) Some tips on the script below:
We should add these lines to imapd.conf (via script):
duplicate_db: skiplist
tlscache_db: skiplist
annotation_db: skiplist
mboxlist_db: skiplist
ptscache_db: skiplist
quota_db: quotalegacy
seenstate_db: skiplist
subscription_db: flat

We want to remove all data from the db dirs because
there may still be some files from the BerkeleyDB and they can lead to
error messages, which are in fact not real cyrus errors. On such a
migration I usually do this after rsyncing:
rm -rvf /var/lib/imap/db/* /var/lib/imap/db.*/*

3) Just run the script -
The script itself:
------------------
#!/bin/bash
###########################
/etc/init.d/cyrus stop

# Make backup of all cyrus DB at /data/backup/berkeleydb-backup/ directory
cp -pR /var/lib/imap /data/backup/berkeleydb-backup/

cp /data/backup/berkeleydb-backup/imap/deliver.db
/data/backup/berkeleydb-backup/imap/deliver.db.berkeley
cp /data/backup/berkeleydb-backup/imap/tls_sessions.db
/data/backup/berkeleydb-backup/imap/tls_sessions.db.berkeley

# Actual conversion to skiplist format
/usr/lib/cyrus/bin/cvt_cyrusdb
/data/backup/berkeleydb-backup/imap/deliver.db.berkeley berkeley
/data/backup/berkeleydb-backup/imap/deliver.db.skiplist skiplist 
/usr/lib/cyrus/bin/cvt_cyrusdb
/data/backup/berkeleydb-backup/imap/tls_sessions.db.berkeley berkeley
/data/backup/berkeleydb-backup/imap/tls_sessions.db.skiplist skiplist 

# Adding some config options to imapd.conf:
echo -e "duplicate_db: skiplist\ntlscache_db: skiplist\nannotation_db:
skiplist\nmboxlist_db: skiplist\nptscache_db: skiplist\nquota_db:
quotalegacy\nseenstate_db: skiplist\nsubscription_db: flat" >>
/etc/imapd.conf

cp /data/backup/berkeleydb-backup/imap/deliver.db.skiplist
/var/lib/imap/deliver.db
cp /data/backup/berkeleydb-backup/imap/tls_sessions.db.skiplist
/var/lib/imap/tls_sessions.db

rm -rvf /var/lib/imap/db/* /var/lib/imap/db.*/*

# Create skipstamp so that cyrus doesn't complain
touch /var/lib/imap/db/skipstamp

chown -R cyrus:mail /var/lib/imap

/etc/init.d/cyrus start
################################

3) Final check:

Yes, that should be okay. For me it looks like this:
[root at xxx imap]# file /var/lib/imap/*.db
/var/lib/imap/annotations.db:  Cyrus skiplist DB
/var/lib/imap/deliver.db:      Cyrus skiplist DB
/var/lib/imap/mailboxes.db:    Cyrus skiplist DB
/var/lib/imap/tls_sessions.db: Cyrus skiplist DB

[root at xxx imap]# file /var/lib/imap/user/*/*.seen
.
.
/var/lib/imap/user/z/zlann.seen:     Cyrus skiplist DB
/var/lib/imap/user/z/zviar.seen:     Cyrus skiplist DB
/var/lib/imap/user/z/zvikos.seen:    Cyrus skiplist DB

[root at xxx imap]# file /var/lib/imap/quota/*/user.*
.
.
/var/lib/imap/quota/z/user.zlann:     ASCII text
/var/lib/imap/quota/z/user.zviar:     ASCII text
/var/lib/imap/quota/z/user.zvikos:    ASCII text



Best Regards,
Leon Kolchinsky



More information about the Info-cyrus mailing list