Bug 5482 - cannot open bayes databases
Summary: cannot open bayes databases
Status: RESOLVED INVALID
Alias: None
Product: Spamassassin
Classification: Unclassified
Component: Rules (show other bugs)
Version: SVN Trunk (Latest Devel Version)
Hardware: PC FreeBSD
: P5 major
Target Milestone: Undefined
Assignee: SpamAssassin Developer Mailing List
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-05-25 06:23 UTC by Mike
Modified: 2013-01-20 17:30 UTC (History)
3 users (show)



Attachment Type Modified Status Actions Submitter/CLA Status

Note You need to log in before you can comment on or make changes to this bug.
Description Mike 2007-05-25 06:23:26 UTC
spamassassin server - 3gb ram, intel quad core 2.4 cpu,freebsd 6.2 

Every day the bayesian database gets corrupted. We see the following in the log
file. We only use sqlite for scores. 

bayes: cannot open bayes databases /usr/local/share/spamassassin/bayes_* R/W:
lock failed: Interrupted system call

When we see the following in the logfile memory is at 1gig +. However after
restarting spamassassin there are memory usage goes right back to 400mb.
Something is corrupting the database.
I have to stop spamassassin, rm bayes* and restart spamassassin. 

Thanks.
Comment 1 Simon Matter 2007-06-12 23:58:28 UTC
I see the same problem since 3.2.0, now also with 3.2.1. We are using SA with
spampd with maxchildren set to 25. This has worked fine for years until 3.2.0.

The only real difference I see is that after wiping bayes_*, SA didn't start
using bayes_journal, which always was used before.

I have now set "bayes_learn_to_journal 1", let's see how it works.
Comment 2 abins 2007-08-16 19:00:34 UTC
I have the same problem on 3.2.2 on Linux platform (Fedora Core 3). The log 
file shows:

bayes: cannot open bayes databases /tmp/.spamassassin/bayes_* R/W:
lock failed: Interrupted system call

now I try the setting below and see how it works.

bayes_auto_expire 0
bayes_learn_to_journal 1
bayes_journal_max_size 0

http://rivviepop.wordpress.com/2006/09/09/spamassassin-bayes-and-berkeley-db/
Comment 3 Simon Matter 2007-08-16 22:26:16 UTC
Using "bayes_learn_to_journal 1" made it work for me. I guess using

bayes_auto_expire 0
bayes_journal_max_size 0

makes you end up in other problems with the size of you bayes.
Comment 4 John Stimson 2010-06-07 11:41:45 UTC
I am getting messages of the form: 

bayes: cannot open bayes databases /usr/local/share/sa-bayes/name_* R/W: lock failed: Interrupted system call

From October 20, 2008 through February, 2010, I was getting that message about once per month.

Starting on March 14, 2010, after upgrading to the then-current version of spamassassin, I started getting that message about every 20 minutes, and every time I invoked sa-learn to learn a new spam message, it timed out with a similar error about not being able to open the bayes database.  I have upgraded one more time since then, and still get the same message and cannot use sa-learn.

I have started using "spamc -L spam" to learn spam, which seems to work, although sometimes it reports that it has already learned a message that I know it has never seen before.

My local.cf file contains the following:
lock_method flock

required_score  3.00
#spam_level_char o
rewrite_header Subject "****SPAMLEVEL: _SCORE_ ****"
dns_available yes
skip_rbl_checks 0
#use_razor1 0
use_pyzor 0
auto_whitelist_path /var/spool/spamassassin/auto-whitelist
auto_whitelist_file_mode 0666
bayes_auto_learn 1
bayes_learn_to_journal 1

bayes_path /usr/local/share/sa-bayes/name
bayes_file_mode 666
Comment 5 John Stimson 2010-06-07 11:43:47 UTC
> bayes_learn_to_journal 1

Note: this line was added to my local.cf file today, after reading the prior reports in this bug.
Comment 7 Kevin A. McGrail 2013-01-20 17:30:27 UTC
Considered a configuration issue.