You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@spamassassin.apache.org by Emanuel Gonzalez <em...@live.com.ar> on 2018/10/23 18:16:51 UTC

spamd fails to remove bayes.lock file

Hello,

I have a problem with the /.spamassassin/bayes.lock

I see this error:

Oct 23 15:12:14 server spamd[18073]: bayes: cannot open bayes databases /.spamassassin/bayes_* R/W: lock failed: File exists
Oct 23 15:12:14 server spamd[18157]: bayes: cannot open bayes databases /.spamassassin/bayes_* R/W: lock failed: File exists
Oct 23 15:12:14 server spamd[18107]: bayes: cannot open bayes databases /.spamassassin/bayes_* R/W: lock failed: File exists


spamassassin -V
SpamAssassin version 3.4.1
running on Perl version 5.10.1

bayes_expiry_max_db_size 150000
bayes_learn_to_journal 1
bayes_auto_learn 0

# spamassassin

SPAMDOPTIONS="-u nobody -H --round-robin --min-children=30 --max-children=190 --min-spare=5 --max-spare=80 --timeout-child=120 --max-conn-per-child=100 -i -A IP"

# directory perms

ll -d /.spamassassin
drwxrwxrwx 3 nobody nobody 4096 oct 23 15:16 /.spamassassin

####################################################

Any idea how to solve it?

Regards,

Re: spamd fails to remove bayes.lock file

Posted by John Hardin <jh...@impsec.org>.
On Tue, 23 Oct 2018, RW wrote:

> On Tue, 23 Oct 2018 18:16:51 +0000
> Emanuel Gonzalez wrote:
>
>> Hello,
>>
>> I have a problem with the /.spamassassin/bayes.lock
>>
>> I see this error:
>>
>> Oct 23 15:12:14 server spamd[18073]: bayes: cannot open bayes
>> databases /.spamassassin/bayes_* R/W: lock failed: File exists Oct 23
>> 15:12:14 server spamd[18157]: bayes: cannot open bayes
>> databases /.spamassassin/bayes_* R/W: lock failed: File exists Oct 23
>> 15:12:14 server spamd[18107]: bayes: cannot open bayes
>> databases /.spamassassin/bayes_* R/W: lock failed: File exists
>
>> bayes_expiry_max_db_size 150000
>> bayes_learn_to_journal 1
>> bayes_auto_learn 0
>
> you may need to set
>
> bayes_auto_expire 0
>
> and do your expiry from cron using sa-learn

This is best practice, yes.


What are the permissions on the files themselves?

-- 
  John Hardin KA7OHZ                    http://www.impsec.org/~jhardin/
  jhardin@impsec.org    FALaholic #11174     pgpk -a jhardin@impsec.org
  key: 0xB8732E79 -- 2D8C 34F4 6411 F507 136C  AF76 D822 E6E6 B873 2E79
-----------------------------------------------------------------------
   No representation without taxation!
-----------------------------------------------------------------------
  572 days since the first commercial re-flight of an orbital booster (SpaceX)

Re: spamd fails to remove bayes.lock file

Posted by RW <rw...@googlemail.com>.
On Tue, 23 Oct 2018 18:16:51 +0000
Emanuel Gonzalez wrote:

> Hello,
> 
> I have a problem with the /.spamassassin/bayes.lock
> 
> I see this error:
> 
> Oct 23 15:12:14 server spamd[18073]: bayes: cannot open bayes
> databases /.spamassassin/bayes_* R/W: lock failed: File exists Oct 23
> 15:12:14 server spamd[18157]: bayes: cannot open bayes
> databases /.spamassassin/bayes_* R/W: lock failed: File exists Oct 23
> 15:12:14 server spamd[18107]: bayes: cannot open bayes
> databases /.spamassassin/bayes_* R/W: lock failed: File exists

> bayes_expiry_max_db_size 150000
> bayes_learn_to_journal 1
> bayes_auto_learn 0

you may need to set

bayes_auto_expire 0

and do your expiry from cron using sa-learn


I've not seen it myself, but there is a known problem with auto-expiry.
It runs as part of an ordinary scan which can lead to it being
interrupted by a timeout. 

I think the lock files will just time out eventually if the underlying
problem is fixed.