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 <em...@donweb.com> on 2018/04/06 18:47:52 UTC

bayes: cannot open bayes databases lock failed: File exists

Hello,

randomly I see these errors

Apr  6 15:13:29 server spamd[25456]: bayes: cannot open bayes databases 
/.spamassassin/bayes_* R/W: lock failed: File exists
Apr  6 15:13:29 server spamd[25144]: bayes: cannot open bayes databases 
/.spamassassin/bayes_* R/W: lock failed: File exists
Apr  6 15:13:29 server spamd[25286]: bayes: cannot open bayes databases 
/.spamassassin/bayes_* R/W: lock failed: File exists
Apr  6 15:13:29 server spamd[25408]: bayes: cannot open bayes databases 
/.spamassassin/bayes_* R/W: lock failed: File exists
Apr  6 15:13:29 server spamd[25459]: bayes: cannot open bayes databases 
/.spamassassin/bayes_* R/W: lock failed: File exists
Apr  6 15:13:29 server spamd[25416]: bayes: cannot open bayes databases 
/.spamassassin/bayes_* R/W: lock failed: File exists

-rw------- 1 nobody nobody   6446360 abr  6 15:14 
/.spamassassin/bayes_journal
-rw------- 1 nobody nobody 732913664 abr  6 15:06 /.spamassassin/bayes_seen
-rw------- 1 nobody nobody  78856192 abr  6 15:09 /.spamassassin/bayes_toks

the permissions of the files are correct

I had thought to import the database of bayes to mysql, is it 
recommended? approximately 30,000 emails are analyzed per hour.

any ideas?

Regards,

-- 


Re: bayes: cannot open bayes databases lock failed: File exists

Posted by Matus UHLAR - fantomas <uh...@fantomas.sk>.
On 09.04.18 16:09, Emanuel Gonzalez wrote:
>Hello, thanks for the reply. I use one database bayes for all email accounts (not sites, sorry for the error)

how? amavis?

>bayes_expiry_max_db_size 150000
>bayes_learn_to_journal 1
>bayes_auto_learn 0

this means you need to train manually

>2- why the bayes is empty?
>
>sa-learn --dump all
>0.000          0          3          0  non-token data: bayes db version
>0.000          0          0          0  non-token data: nspam
>0.000          0          0          0  non-token data: nham
>0.000          0          0          0  non-token data: ntokens
>0.000          0          0          0  non-token data: oldest atime
>0.000          0          0          0  non-token data: newest atime
>0.000          0          0          0  non-token data: last journal sync atime
>0.000          0          0          0  non-token data: last expiry atime
>0.000          0          0          0  non-token data: last expire atime delta
>0.000          0          0          0  non-token data: last expire reduction count
>
>du -sh /.spamassassin/bayes_*
>8,0K    /.spamassassin/bayes_journal
>513M    /.spamassassin/bayes_seen
>4,0M    /.spamassassin/bayes_toks


if you are running amavis, you need to check ~amavis/.spamassassin/
directory, not /.spamassassin.
if you are running spamd unser one user, does the user homedir set to / ?

otherwise, it can be a result of no mail trained, since you have bayes_auto_learn
set to 0


-- 
Matus UHLAR - fantomas, uhlar@fantomas.sk ; http://www.fantomas.sk/
Warning: I wish NOT to receive e-mail advertising to this address.
Varovanie: na tuto adresu chcem NEDOSTAVAT akukolvek reklamnu postu.
Your mouse has moved. Windows NT will now restart for changes to take
to take effect. [OK]

Re: bayes: cannot open bayes databases lock failed: File exists

Posted by Emanuel Gonzalez <em...@live.com.ar>.
Hello, thanks for the reply. I use one database bayes for all email accounts (not sites, sorry for the error)


here i show some spamassassin configuration


local.cf


bayes_expiry_max_db_size 150000
bayes_learn_to_journal 1
bayes_auto_learn 0

include custom_rules
include whitelist
include blacklist
include hostname


I have two questions:


1- How do I configure? I can not find a tutorial, only information about spamassassin and mysql, not spamassassin and redis


2- why the bayes is empty?

sa-learn --dump all
0.000          0          3          0  non-token data: bayes db version
0.000          0          0          0  non-token data: nspam
0.000          0          0          0  non-token data: nham
0.000          0          0          0  non-token data: ntokens
0.000          0          0          0  non-token data: oldest atime
0.000          0          0          0  non-token data: newest atime
0.000          0          0          0  non-token data: last journal sync atime
0.000          0          0          0  non-token data: last expiry atime
0.000          0          0          0  non-token data: last expire atime delta
0.000          0          0          0  non-token data: last expire reduction count

du -sh /.spamassassin/bayes_*
8,0K    /.spamassassin/bayes_journal
513M    /.spamassassin/bayes_seen
4,0M    /.spamassassin/bayes_toks

Regards and thanks for the reply.


________________________________
De: Matus UHLAR - fantomas <uh...@fantomas.sk>
Enviado: lunes, 9 de abril de 2018 13:00:49
Para: users@spamassassin.apache.org
Asunto: Re: bayes: cannot open bayes databases lock failed: File exists

On 09.04.18 11:01, Emanuel Gonzalez wrote:
>I use one bayes database to all sites in my server.

sites? afaik spamd and MTAs differ between mailboxes, not sites.

>What would be the best way to avoid my problem?? create a database of bayes
> by email account?  Or create a unique database of bayes for all email
> accounts?

so, do you use one or multipler BAYES databases?


>De: Pedro David Marco <pe...@yahoo.com>
>Enviado: viernes, 6 de abril de 2018 19:01:53
>Para: users@spamassassin.apache.org
>Asunto: Re: bayes: cannot open bayes databases lock failed: File exists
>
>
>>under such load, yes.
>>if you use per-site bayes database, you can try redis - even faster than
>>mysql.
>
>Much much much faster....

--
Matus UHLAR - fantomas, uhlar@fantomas.sk ; http://www.fantomas.sk/
Warning: I wish NOT to receive e-mail advertising to this address.
Varovanie: na tuto adresu chcem NEDOSTAVAT akukolvek reklamnu postu.
Silvester Stallone: Father of the RISC concept.

Re: bayes: cannot open bayes databases lock failed: File exists

Posted by Matus UHLAR - fantomas <uh...@fantomas.sk>.
On 09.04.18 11:01, Emanuel Gonzalez wrote:
>I use one bayes database to all sites in my server.

sites? afaik spamd and MTAs differ between mailboxes, not sites.

>What would be the best way to avoid my problem?? create a database of bayes
> by email account?  Or create a unique database of bayes for all email
> accounts?

so, do you use one or multipler BAYES databases?


>De: Pedro David Marco <pe...@yahoo.com>
>Enviado: viernes, 6 de abril de 2018 19:01:53
>Para: users@spamassassin.apache.org
>Asunto: Re: bayes: cannot open bayes databases lock failed: File exists
>
>
>>under such load, yes.
>>if you use per-site bayes database, you can try redis - even faster than
>>mysql.
>
>Much much much faster....

-- 
Matus UHLAR - fantomas, uhlar@fantomas.sk ; http://www.fantomas.sk/
Warning: I wish NOT to receive e-mail advertising to this address.
Varovanie: na tuto adresu chcem NEDOSTAVAT akukolvek reklamnu postu.
Silvester Stallone: Father of the RISC concept.

Re: bayes: cannot open bayes databases lock failed: File exists

Posted by Emanuel Gonzalez <em...@live.com.ar>.
Hello, thans for the reply.

I use one bayes database to all sites in my server.

What would be the best way to avoid my problem?? create a database of bayes by email account? Or create a unique database of bayes for all email accounts?

Thanks,


________________________________
De: Pedro David Marco <pe...@yahoo.com>
Enviado: viernes, 6 de abril de 2018 19:01:53
Para: users@spamassassin.apache.org
Asunto: Re: bayes: cannot open bayes databases lock failed: File exists


>under such load, yes.
>if you use per-site bayes database, you can try redis - even faster than
>mysql.

Much much much faster....

----
PedroD


Re: bayes: cannot open bayes databases lock failed: File exists

Posted by Pedro David Marco <pe...@yahoo.com>.
 
>under such load, yes.
>if you use per-site bayes database, you can try redis - even faster than>mysql.
Much much much faster....
----PedroD
  

Re: bayes: cannot open bayes databases lock failed: File exists

Posted by Matus UHLAR - fantomas <uh...@fantomas.sk>.
On 06.04.18 15:47, Emanuel wrote:
>randomly I see these errors
>
>Apr  6 15:13:29 server spamd[25456]: bayes: cannot open bayes 
>databases /.spamassassin/bayes_* R/W: lock failed: File exists
>Apr  6 15:13:29 server spamd[25144]: bayes: cannot open bayes 
>databases /.spamassassin/bayes_* R/W: lock failed: File exists
>Apr  6 15:13:29 server spamd[25286]: bayes: cannot open bayes 
>databases /.spamassassin/bayes_* R/W: lock failed: File exists
>Apr  6 15:13:29 server spamd[25408]: bayes: cannot open bayes 
>databases /.spamassassin/bayes_* R/W: lock failed: File exists
>Apr  6 15:13:29 server spamd[25459]: bayes: cannot open bayes 
>databases /.spamassassin/bayes_* R/W: lock failed: File exists
>Apr  6 15:13:29 server spamd[25416]: bayes: cannot open bayes 
>databases /.spamassassin/bayes_* R/W: lock failed: File exists
>
>-rw------- 1 nobody nobody   6446360 abr  6 15:14 
>/.spamassassin/bayes_journal
>-rw------- 1 nobody nobody 732913664 abr  6 15:06 /.spamassassin/bayes_seen
>-rw------- 1 nobody nobody  78856192 abr  6 15:09 /.spamassassin/bayes_toks
>
>the permissions of the files are correct
>
>I had thought to import the database of bayes to mysql, is it 
>recommended? approximately 30,000 emails are analyzed per hour.

under such load, yes.
if you use per-site bayes database, you can try redis - even faster than
mysql.

-- 
Matus UHLAR - fantomas, uhlar@fantomas.sk ; http://www.fantomas.sk/
Warning: I wish NOT to receive e-mail advertising to this address.
Varovanie: na tuto adresu chcem NEDOSTAVAT akukolvek reklamnu postu.
"Where do you want to go to die?" [Microsoft]