Subject: Re: db4 4.3.21 error
To: None <tech-pkg@netbsd.org>
From: Jukka Salmi <j+nbsd@2004.salmi.ch>
List: tech-pkg
Date: 01/27/2005 22:10:21
Jukka Salmi --> tech-pkg (2005-01-24 13:41:00 +0100):
> Martti Kuparinen --> tech-pkg (2004-12-29 10:25:53 +0200):
> > ROOT inside:~> lintpkgsrc -i
> > Scanning Makefiles: 5262 packages
> > Version mismatch: 'db4' 4.2.52nb7 vs 4.3.21
> > ROOT inside:~>
> > 
> > I then updated db4 and cyrus stopped working. Here's a fragment from
> > /var/log/messages:
> > 
> > Dec 29 10:11:01 inside lmtpunix[25171]: DBERROR d^^H^H: db4
> > Dec 29 10:11:01 inside lmtpunix[25171]: DBERROR: critical database situation
> > Dec 29 10:11:01 inside master[15334]: service lmtpunix pid 25171 in 
> > READY state: terminated abnormally
> > Dec 29 10:11:01 inside master[15334]: exiting on SIGTERM/SIGINT
> > 
> > 
> > I went back to 4.2.52nb7 and everything is okay.
> 
> After updating BDB from db4-4.2.52nb7 to db4-4.3.27nb1 I saw the same
> problem here (with cyrus-imapd-2.2.10nb2). I solved it as follows:
> 
> - stop Cyrus master
> - run db_checkpoint and db_recover (using the old 4.2.52 binaries & libs)
> - remove /var/imap/db/__db.* and /var/imap/db/log.*
> - install new db4
> - start Cyrus
> 
> I'm using default DB types, i.e. I did not change any *_db option
> in imapd.conf. This means the only BDBs here are duplicate_db and
> tlscache_db.

For the archives (and because I was asked to do so): here are the
exact commands I used to fix the problem.

Because I had already updated the BDB package whe I noticed the problem
with Cyrus I unpacked the old one to /tmp/db4.old and did

$ PATH=/tmp/db4.old/bin:$PATH
$ LD_LIBRARY_PATH=/tmp/db4.old/lib
$ export LD_LIBRARY_PATH

to use the old db_* tools by default.

After stopping Cyrus I checkpointed the db log and perfomed recovery:

# db4_checkpoint -v -1 -h /var/test/db
db_checkpoint: checkpoint: Thu Jan 27 21:59:13 2005

# db4_recover -v -h /var/test/db
db_recover: Finding last valid log LSN: file: 8 offset 4562006
db_recover: Recovery starting from [8][4561817]
db_recover: Recovery complete at Thu Jan 27 21:59:28 2005
db_recover: Maximum transaction ID 80006892 Recovery checkpoint [8][4562103]

I removed the log file

$ rm /var/imap/db/log.0000000008

reset my environment (PATH, LD_LIBRARY_PATH) and started Cyrus.


HTH, Jukka

-- 
bashian roulette:
$ ((RANDOM%6)) || rm -rf ~