sa-learn errors

Started by ozric, September 20, 2004, 08:32:58 PM

Previous topic - Next topic

ozric

I'm having a problem with the learning aspect of Spamassassin, sa-learn.

Running toaster 3.45 on FreeBSD 4.10.

When my cron job (toaster-watcher.pl) runs to learn spam/ham I get an error email something like this:
ERROR: the Bayes learn function returned an error, please re-run with -D for more information
Learned from 0 message(s) (1 message(s) examinded).

I have a .Spam folder with about 350 junk messages & a ham (Inbox) folder with 2,000.

I get the same error if I try to run it manually.

Here it is with the -D switch:

debug: Score set 0 chosen.debug: running in taint mode? yesdebug: Running in taint mode, removing unsafe env vars, and resetting PATHdebug: PATH included '/sbin', keeping.debug: PATH included '/bin', keeping.debug: PATH included '/usr/sbin', keeping.debug: PATH included '/usr/bin', keeping.debug: PATH included '/usr/games', keeping.debug: PATH included '/usr/local/sbin', keeping.debug: PATH included '/usr/local/bin', keeping.debug: PATH included '/usr/X11R6/bin', keeping.debug: PATH included '/home/dillweed/bin', which doesn't exist, dropping.debug: Final PATH set to: /sbin:/bin:/usr/sbin:/usr/bin:/usr/games:/usr/local/sbin:/usr/local/bin:/usr/X11R6/bindebug: using "/usr/local/share/spamassassin" for default rules dirdebug: using "/usr/local/etc/mail/spamassassin" for site rules dirdebug: using "/root/.spamassassin/user_prefs" for user prefs filedebug: bayes: 88268 tie-ing to DB file R/O /usr/local/etc/mail/spamassassin/bayes_toksdebug: bayes: 88268 tie-ing to DB file R/O /usr/local/etc/mail/spamassassin/bayes_seendebug: bayes: found bayes db version 0debug: bayes: Not available for scanning, only 0 spam(s) in Bayes DB < 200debug: bayes: 88268 untie-ingdebug: bayes: 88268 untie-ing db_toksdebug: bayes: 88268 untie-ing db_seendebug: Score set 0 chosen.debug: Initialising learnerdebug: Initialising learnerdebug: Syncing Bayes journal and expiring old tokens...debug: lock: 88268 created /usr/local/etc/mail/spamassassin/bayes.lock.ozric.jtackett.com.88268debug: lock: 88268 trying to get lock on /usr/local/etc/mail/spamassassin/bayes with 0 retriesdebug: lock: 88268 link to /usr/local/etc/mail/spamassassin/bayes.lock: link okdebug: bayes: 88268 tie-ing to DB file R/W /usr/local/etc/mail/spamassassin/bayes_toksdebug: bayes: 88268 tie-ing to DB file R/W /usr/local/etc/mail/spamassassin/bayes_seendebug: bayes: found bayes db version 0debug: bayes: detected bayes db format 0, upgradingdebug: bayes: upgrading database format from v0 to v2debug: bayes: 88268 untie-ingdebug: bayes: 88268 untie-ing db_toksdebug: bayes: 88268 untie-ing db_seendebug: bayes: files locked, now unlocking lockdebug: unlock: 88268 unlink /usr/local/etc/mail/spamassassin/bayes.lockdebug: Syncing complete.


I have to hit control-c to break out, it just sits there and it says this:
^Cdebug: bayes: 88268 untie-ingLearned from 0 message(s) (0 message(s) examined).debug: bayes: 88268 untie-inginterrupted at /usr/local/lib/perl5/site_perl/5.8.5/Mail/SpamAssassin/CmdLearn.pm line 251.



It happened with a blank local.cf file, I don't mind using the defaults.  I added these lines and moved files but still nothing:
use_bayes                       1bayes_path                      /usr/local/etc/mail/spamassassin/bayesbayes_file_mode                 0777


The files look pretty large for nothing to be happening:
[ozric:/usr/local/etc/mail/spamassassin]# ls -latotal 18618drwxr-xr-x  2 root  wheel      512B Sep 20 22:26 ./drwxr-xr-x  3 root  wheel      512B Sep 19 19:11 ../-rw-rw-rw-  1 root  wheel       16K Sep 19 20:01 auto-whitelist.db-rw-rw-rw-  1 root  wheel      128K Sep 20 22:26 bayes_seen-rw-rw-rw-  1 root  wheel       17M Sep 20 22:26 bayes_toks-rw-rw-rw-  1 root  wheel      112K Sep 19 20:01 bayes_toks.new-rw-r--r--  1 root  wheel      503B Sep 19 23:19 local.cf-rw-r--r--  1 root  wheel      302B Sep 19 22:58 local.cf.sample-rw-rw-rw-  1 root  wheel        1K Sep 19 20:01 user_prefs


Spamd is running as root.  The documentation is kinda scattered on Spamassassin's site.

Can anyone give me a clue what to do?

Thanks!

ozric

Does anyone know about this and why I can't sa-learn any spam or ham?

Thanks for your time.

ozric

Then I guess I'll reply.

On my toaster (which I had shelved for weeks because of other priorities) I upgraded to SpamAssassin version 2.64 from 2.63.  Since I wasn't using the toaster before the upgrade I didn't know if spamassassin was working.  Now, after I upgraded SA & Perl mods and want to start using it, I noticed the error.

After sifting the internet and documentation, I discovered the --import command in the sa-learn Man file.  I tried it out and obviously I need the upgrade because learning ham/spam works now.  Maybe this will help other lost souls.

sa-learn  --importupgrading to DB_File, please be patient: /usr/local/etc/mail/spamassassin/old_bayes_seenDB_File: copied 428 entries.upgrading to DB_File, please be patient: /usr/local/etc/mail/spamassassin/old_bayes_toksDB_File: copied 235811 entries


This is from teaching it SPAM:
Learned from 265 message(s) (487 message(s) examined).

However, I get this result from about 2,000 ham messages:
Learned from 59 message(s) (988 message(s) examined).
Out of memory during "large" request for 8392704 bytes, total sbrk() is 534018048 bytes at /usr/local/lib/perl5/site_perl/5.8.5/Mail/SpamAssassin/PerMsgStatus.pm line 1207

Don't know about the error, but it still shows that the ham was learned by looking in my sa-learn --dump magic

I have 512MB of swap and 320MB of RAM.  Maybe I'll try to increase the swap and see what happens.