You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@spamassassin.apache.org by Massimiliano Marini <ma...@linuxtime.it> on 2008/02/28 11:39:34 UTC

Bayes R/W lock failed

Debian - SA 3.2.4

In my log I'found a lot message like this:

Feb 28 05:42:32 server spamd[9351]: bayes: cannot open bayes
databases /home/spamassassin/.spamassassin/bayes_* R/W: lock failed:
File exists

How can I solve this problem?

local.cf
rewrite_header Subject *****SPAM*****
report_safe 0
required_score 4

use_bayes 1
bayes_auto_learn 1
bayes_auto_expire 0
bayes_learn_to_journal 1
bayes_journal_max_size 0

Could (lock failed) be the cause of: 
X-Spam-Status: No, hits=? required=?

--
Massimiliano Marini - http://www.linuxtime.it/massimilianomarini/
"It's easier to invent the future than to predict it."  -- Alan Kay

Re: Bayes R/W lock failed

Posted by fchan <fc...@molsci.org>.
Hi,
Check your spamassassin bayes directory, in your case it's 
/home/spamassassin/.spamassassin/, for the bayes.lock.* files? I seen 
this you need to temporarily stop spamd then remove the bayes.lock.* 
files there. Then start spamd and it should clear this up.
I think the reason for this if you stop spamd and there is 
bayes.lock.* there, and there shouldn't when it is stopped, when you 
start up and spamd needs to create a bayes.lock.* it get confused 
because there are another one existing and complains to you in the 
log.

I hope this helps.
Frank

>Debian - SA 3.2.4
>
>In my log I'found a lot message like this:
>
>Feb 28 05:42:32 server spamd[9351]: bayes: cannot open bayes
>databases /home/spamassassin/.spamassassin/bayes_* R/W: lock failed:
>File exists
>
>How can I solve this problem?
>
>local.cf
>rewrite_header Subject *****SPAM*****
>report_safe 0
>required_score 4
>
>use_bayes 1
>bayes_auto_learn 1
>bayes_auto_expire 0
>bayes_learn_to_journal 1
>bayes_journal_max_size 0
>
>Could (lock failed) be the cause of:
>X-Spam-Status: No, hits=? required=?
>
>--
>Massimiliano Marini - http://www.linuxtime.it/massimilianomarini/
>"It's easier to invent the future than to predict it."  -- Alan Kay


Re: Bayes R/W lock failed

Posted by Massimiliano Marini <ma...@linuxtime.it>.
> If it's sporadic, that's not a problem. SA tried to get a read-write 
> lock on the bayes DB, presumably for autolearning or autoexpiry, but 
> some other SA instance may have had it.
> 
> Rather than block your mail queue, SA gave up.
> 
> This is only a problem if it happens *every* time SA tries to
> autolearn, in which case your rights aren't set up to allow writing
> of the files, only reading.

When the bayes.lock is created it remains ever, I must delete it
manually and then restart "/etc/init.d/spamd restart".

Before "spamd restart" if I type "netstat -at" I see a lot of spamd
connections.

My dir: /home/spamassassin/.spamassassin
-rw-------  1 spamd spamd 40169472 Feb 28 15:45 auto-whitelist
-rw-------  1 spamd spamd   339832 Feb 28 15:45 bayes_journal
-rw-------  1 spamd spamd 10510336 Feb 28 11:53 bayes_seen
-rw-------  1 spamd spamd 83533824 Feb 28 11:53 bayes_toks

Maybe the file dimensions are too big or whatelse?

> no. That would be caused by a timeout or over-sized message that
> didn't get scanned.

Where I can check the size and timeout of a message?

--
Massimiliano Marini - http://www.linuxtime.it/massimilianomarini/
"It's easier to invent the future than to predict it."  -- Alan Kay

Re: Bayes R/W lock failed

Posted by Matt Kettler <mk...@verizon.net>.
Massimiliano Marini wrote:
> Debian - SA 3.2.4
>
> In my log I'found a lot message like this:
>
> Feb 28 05:42:32 server spamd[9351]: bayes: cannot open bayes
> databases /home/spamassassin/.spamassassin/bayes_* R/W: lock failed:
> File exists
>
> How can I solve this problem?
>   
If it's sporadic, that's not a problem. SA tried to get a read-write 
lock on the bayes DB, presumably for autolearning or autoexpiry, but 
some other SA instance may have had it.

Rather than block your mail queue, SA gave up.

This is only a problem if it happens *every* time SA tries to autolearn, 
in which case your rights aren't set up to allow writing of the files, 
only reading.

> local.cf
> rewrite_header Subject *****SPAM*****
> report_safe 0
> required_score 4
>
> use_bayes 1
> bayes_auto_learn 1
> bayes_auto_expire 0
> bayes_learn_to_journal 1
> bayes_journal_max_size 0
>
> Could (lock failed) be the cause of: 
> X-Spam-Status: No, hits=? required=?
>   
no. That would be caused by a timeout or over-sized message that didn't 
get scanned.