On Wed, Feb 22, 2017 at 03:42:07PM +0100, Paul de Weerd wrote:
> I've been paying a bit more attention to what spamdb is logging these
> days and I've noticed the following:
>
> [weerd@despair] $ grep spamd /var/log/messages | tail -n4
> 2017-02-22T12:23:47.518Z despair spamd[93281]: can't delete from spamd db
> (Undefined error: 0)
> 2017-02-22T12:24:47.749Z despair spamd[93281]: can't delete from spamd db
> (Undefined error: 0)
> 2017-02-22T14:00:10.619Z despair spamd[93281]: can't delete from spamd db
> (Undefined error: 0)
> 2017-02-22T14:01:10.860Z despair spamd[93281]: can't delete from spamd db
> (Undefined error: 0)
>
> Cranking the logging up to 11, I see:
>
> 2017-02-22T14:37:19.411Z despair spamd[93281]: queueing deletion of
> 2017-02-22T14:37:19.488Z despair spamd[93281]: can't delete from spamd db
> (Undefined error: 0)
>
> Any idea what could be going on here? Could the spamd database be
> corrupt somehow? Is there a way to check that? I notice that it's
> rather big, for the number of entries in the database:
>
> [weerd@despair] $ spamdb | wc -l
> 553
> [weerd@despair] $ ls -lh /var/db/spamd
> -rw-r--r-- 1 _spamd _spamd 305M Feb 22 15:40 /var/db/spamd
>
> Any pointers?
Berkeley db's are sparse files, it is common that the size is larger
than the disk usage. Check with ls -skl.
As for the delete problem: it's trying to delete weird keys,
consisting of a space. When trying to delete a non-existing key,
->del returns 1 and does not set errno, that seems to happen here.
See grey.c line 454
It's interesting to see of spamdb list the weird keys.
-Otto