git installation files - README.db
Matthias Andree
matthias.andree at gmx.de
Wed Oct 13 20:20:26 CEST 2021
Am 11.10.21 um 01:03 schrieb hput:
> I have a corrupted wordlist.db according to output from bf_compact
>
> bf_compact ~/.bogofilter-corrupted-211009-211752/ wordlist.db
> Can't open wordlist './wordlist.db'
> wordlist.db corrupted, aborting.
>
> The README.db file in git sources at
> ...../bogofilter-git/bogofilter/doc/README.db section 3.2.2
>
> ,----
> | [...]
> |3.2.2 Catastrophic recovery
> |
> | If regular recovery fails after severe damage to hardware, filesystem,
> | database files, you can attempt to run catastrophic recovery. If log
> | files have been damaged, catastrophic recovery may not work.
> |
> | This may need *all* log files from the backup and is therefore not
> | available if log files have been pruned.
> |
> | To run catastrophic recovery, replace the log files from your archives,
> | then run:
> | bogoutil --db-recover-harder ~/.bogofilter
> |
> | If this fails, read on.
> | [...]
> `----
>
> The above section and further along in same file there is mention of:
>
> `*all* log files'
>
> What log files are they talking about? Is there a log specific to
> bogofilter?
The log.0123456789 files you get in the ~/.bogofilter directory. If you
don't then you weren't using the "transactional" store, and the error is
only recoverable from good backups of the wordlist.db file. Example:
> -rw-rw-r--. 1 mandree mandree 0 May 28 2018 lockfile-d
> -rw-rw-r--. 1 mandree mandree 20480 Oct 21 2020 wordlist.db
> -rw-rw-r--. 1 mandree mandree 434176 Oct 7 19:10 __db.001
> -rw-rw-r--. 1 mandree mandree 73728 Oct 7 19:10 __db.003
> -rw-rw-r--. 1 mandree mandree 311296 Oct 7 19:10 __db.002
> -rw-rw-r--. 1 mandree mandree 1048576 Oct 7 19:10 log.0000000001
> -rw-rw-r--. 1 mandree mandree 1024 Oct 7 19:10 lockfile-p
>
> I have none at /var/log. And there is no mention of `bogofilter' in
>
> /var/log/syslog going back as far Jul 15
>
> bf_compact tells me wordlist.db is corrupted as shown at the top.
>
> bogoutil --db-recover-harder ~/.bogofilter-corrupted-211009-211752/
>
> Shows no response at all.
Then ~/.bogofilter-corrupted-211009-211752/wordlist.db should have been
recovered---assuming it was using a transactional database. Else there
is no way to recover and it will silently succeed. I may want to print a
hint in that case that the database was not transactional.
You can run bogoutil with additional options -vvxd - this will print
some database debugging, and if the probing... line prints T_DISABLED
that means "no transactions", T_ENABLED means "transactions".
> ,----
> | bogoutil -v --db-verify ~/.bogofilter-corrupted-211009-211752/wordlist.db
> |
> | BDB1081 Page 2205: btree or recno page is of inappropriate type 13
> | BDB1087 Page 2205: Btree level incorrect: got 0, expected 1
> | /home/reader/.bogofilter-corrupted-211009-211752/wordlist.db:
> | BDB0090 DB_VERIFY_BAD: Database veri fication failed
> | bogoutil[918560]: database wordlist.db does not verify: BDB0090
> | DB_VERIFY_BAD: Database verification failed
> `----
That's interesting. Is the database transactional?
If yes, which version of BerkeleyDB are you using?
More information about the bogofilter
mailing list