DB_LOGC->get: LSN 44/32711: invalid log record header after db-recover

Chris Wilkes cwilkes-bf at ladro.com
Sun Jan 16 20:56:54 CET 2005


On Sat, Jan 15, 2005 at 03:37:41AM +0100, Matthias Andree wrote:
> Chris Wilkes <cwilkes-bf at ladro.com> writes:
> 
> > Which I run and it gives me the same message:
> >   $ bogoutil -v --db-recover "/home/vmail/maildirs/cwilkes/.bogofilter/"
> >   DB_LOGC->get: LSN 44/32711: invalid log record header
> >   ...
> 
> Have log files been removed?

Yes, I had some problems with bf_compact and went through some of the
steps outlined here:
  http://article.gmane.org/gmane.mail.bogofilter.general/9090
I believe I ended up copying the files under a bf_compact.$$ directory,
which inclues the log.* __db.* and wordlist.db files.

> What log files are in place?

There's a whole bunch of old log.* files from Jan 9th, the only recent
ones being:

$ ls -ltr | tail -5
-rw-rw-r--  1 vmail vmail       48 Jan  9 10:07 DB_CONFIG
-rw-rw-r--  1 vmail vmail   984132 Jan 10 05:45 log.0000000043
-rw-rw-r--  1 vmail vmail     1024 Jan 14 17:21 lockfile-p
-rw-rw-r--  1 vmail vmail  8908800 Jan 14 17:50 wordlist.db-BACKUP
-rw-rw-r--  1 vmail vmail  8953856 Jan 14 18:00 wordlist.db

> Can you play a bit with db_stat to see if it prints useful data related
> to this problem?

I'm not sure what I should be looking at:
$ db_stat -d wordlist.db
53162   Btree magic number.
9       Btree version number.
Flags:  little-endian
2       Minimum keys per-page.
4096    Underlying database page size.
3       Number of levels in the tree.
232651  Number of unique keys in the tree.
232651  Number of data items in the tree.
24      Number of tree internal pages.
47848   Number of bytes free in tree internal pages (51% ff).
2161    Number of tree leaf pages.
288190  Number of bytes free in tree leaf pages (97% ff).
0       Number of tree duplicate pages.
0       Number of bytes free in tree duplicate pages (0% ff).
0       Number of tree overflow pages.
0       Number of bytes free in tree overflow pages (0% ff).
0       Number of pages on the free list.

> Can you tar up the whole directory (with your mail system quiet) and
> play around a bit, including catastrophic recovery?

What is the catastropic recovery option?  I only know about dumping the
database tokens to stdout and rebuilding from that and the db_dump
method as described in the FAQ.

> Assuming you haven't had a crash, see if removing the environment
> works. I doubt that, but I'd like some confirmation either way.

$ bogoutil --db-remove-environment ~/.bogofilter
$ bogoutil -v --db-recover "."
DB_LOGC->get: LSN 44/32711: invalid log record header
PANIC: Input/output error
bogoutil: DB_ENV->open, err: DB_RUNRECOVERY: Fatal error, run database
recovery
To recover, run: bogoutil -v --db-recover "."

> Alternatively, dump your database to a temporary file, then remove all
> of the the __db.* and log.* files, the *.db file, then run db_load with
> the permanent filename.

That did the trick!  Thanks.

Chris



More information about the Bogofilter mailing list