You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@spamassassin.apache.org by Eric Dantan Rzewnicki <rz...@rfa.org> on 2005/03/16 00:01:21 UTC

sa-learn hangs

Hello,

I'm using spamassassin 3.0.2 from within MailScanner 4.39.6 on Debian
woody. After upgrading to spamassassin 3.0.2 (installed from source
tarball) I am unable to use sa-learn to train the bayes engine on ham or
spam. Spamassassin is otherwise working fine. Before upgrading I wiped
out my previous bayes database. It has since grown well beyond the 200
minimum ham and spam and Spamassassin is using bayes to score mail.  

sa-learn --dump magic -p /opt/MailScanner/etc/spam.assassin.prefs.conf
works fine and shows that the bayes database is growing as it should
through autolearning.  

spamassassin -D -p <conf_file> --lint doesn't show any problems that I
can see.

if I run: 
sa-learn --showdots --mbox --ham -p /opt/MailScanner/etc/spam.assassin.prefs.conf <ham_box>

sa-learn just hangs. Same happens for --spam.

strace shows it stuck on a read(0,

Any ideas?

I've tried searching the archives and the wiki, but haven't turned up
anything yet. There doesn't seem to be anything about this in the FAQ,
either. I've reported this on the MailScanner list as well, but so far
have not received a response.
-- 
Eric Dantan Rzewnicki  |  Systems Administrator
Technical Operations Division  |  Radio Free Asia
2025 M Street, NW  |  Washington, DC 20036  |  202-530-4900
CONFIDENTIAL COMMUNICATION
This e-mail message is intended only for the use of the addressee and
may contain information that is privileged and confidential. Any 
unauthorized dissemination, distribution, or copying is strictly 
prohibited. If you receive this transmission in error, please contact
network@rfa.org.

Re: sa-learn hangs

Posted by Eric Dantan Rzewnicki <rz...@rfa.org>.
On Thu, Mar 17, 2005 at 12:15:35PM +0100, Paul Boven wrote:
> Hoi Eric,
> Eric Dantan Rzewnicki wrote:
> >if I run: 
> >sa-learn --showdots --mbox --ham -p 
> >/opt/MailScanner/etc/spam.assassin.prefs.conf <ham_box>
> >sa-learn just hangs. Same happens for --spam.
> >strace shows it stuck on a read(0,
> The reason it is stuck on read(0, is that it's expecting input on its 
> STDIN. Try this:
> sa-learn --show-dots --mbox -ham [-p prefs] < <ham_box>
> 
> Where < means it reads stdin from that file. This is equivalent to
> cat <ham_box> | sa-learn --show-dots --mbox --ham [-p prefs]

Hmm. I understand what you're saying, but sa-learn has never worked that
way. AFAIK it takes the mbox as a commandline argument which can include
shell globbing and such.

Anyway, my issue was resolved once I realized that I had an old version
installed earlier in my path than the new sa-learn. I can't test your
suggestion because I don't have the problem version around anymore.

Thanks though,
-- 
Eric Dantan Rzewnicki  |  Systems Administrator
Technical Operations Division  |  Radio Free Asia
2025 M Street, NW  |  Washington, DC 20036  |  202-530-4900
CONFIDENTIAL COMMUNICATION
This e-mail message is intended only for the use of the addressee and
may contain information that is privileged and confidential. Any 
unauthorized dissemination, distribution, or copying is strictly 
prohibited. If you receive this transmission in error, please contact
network@rfa.org.

Re: sa-learn hangs

Posted by Paul Boven <p....@chello.nl>.
Hoi Eric,

Eric Dantan Rzewnicki wrote:

> if I run: 
> sa-learn --showdots --mbox --ham -p /opt/MailScanner/etc/spam.assassin.prefs.conf <ham_box>
> 
> sa-learn just hangs. Same happens for --spam.
> 
> strace shows it stuck on a read(0,

The reason it is stuck on read(0, is that it's expecting input on its 
STDIN. Try this:

sa-learn --show-dots --mbox -ham [-p prefs] < <ham_box>
                                             ^

Where < means it reads stdin from that file. This is equivalent to
cat <ham_box> | sa-learn --show-dots --mbox --ham [-p prefs]

Regards, Paul Boven.

Re: sa-learn hangs -- SOLVED

Posted by Eric Dantan Rzewnicki <rz...@rfa.org>.
On Wed, Mar 16, 2005 at 05:33:16PM -0500, Eric Dantan Rzewnicki wrote:
> On Wed, Mar 16, 2005 at 01:25:53PM -0500, Eric Dantan Rzewnicki wrote:
> > On Tue, Mar 15, 2005 at 06:11:27PM -0500, Matt Kettler wrote:
> > > Eric Dantan Rzewnicki wrote:
> > > >spamassassin -D -p <conf_file> --lint doesn't show any problems that I
> > > >can see.
> > > >if I run: 
> > > >sa-learn --showdots --mbox --ham -p 
> 
> I had an old version of sa-learn in /usr/local/bin. The new sa-learn is
> installed in /usr/bin/. The old one was not removed when I upgraded from
> 2.6x to 3.0.2. The old one was in my PATH first. Everything's fine now.

Is there any other residue I should look for from the upgrade?
-- 
Eric Dantan Rzewnicki  |  Systems Administrator
Technical Operations Division  |  Radio Free Asia
2025 M Street, NW  |  Washington, DC 20036  |  202-530-4900
CONFIDENTIAL COMMUNICATION
This e-mail message is intended only for the use of the addressee and
may contain information that is privileged and confidential. Any 
unauthorized dissemination, distribution, or copying is strictly 
prohibited. If you receive this transmission in error, please contact
network@rfa.org.

Re: sa-learn hangs -- SOLVED

Posted by Eric Dantan Rzewnicki <rz...@rfa.org>.
On Wed, Mar 16, 2005 at 01:25:53PM -0500, Eric Dantan Rzewnicki wrote:
> On Tue, Mar 15, 2005 at 06:11:27PM -0500, Matt Kettler wrote:
> > Eric Dantan Rzewnicki wrote:
> > >spamassassin -D -p <conf_file> --lint doesn't show any problems that I
> > >can see.
> > >if I run: 
> > >sa-learn --showdots --mbox --ham -p 
> > >/opt/MailScanner/etc/spam.assassin.prefs.conf <ham_box>
> > >sa-learn just hangs. Same happens for --spam.
> > >strace shows it stuck on a read(0,
> > >Any ideas?
> > What about sa-learn -D -p <prefspath> --dump magic? does that hang? 
> No hang with debug added to --dump. Same as without -D.
> > If 
> > that works, what about sa-learn -D --rebuild?
> rebuild works fine, too.
> > Do you have an alternate bayes_path set in your spam.assassin.prefs.conf?
> I have these:
> bayes_path /var/spool/MailScanner/spamassassin/bayes
> bayes_file_mode 0660
> > Does the user running sa-learn have rw permissions to it, and rwx to the 
> > directory containing it?
> I'm running sa-learn as root. 
> :/var/spool/MailScanner/spamassassin# ls -la
> total 7788
> drwxr-xr-x    2 postfix  postfix      4096 Mar 16 13:05 .
> drwxr-xr-x    6 root     root         4096 Jan 23  2004 ..
> -rw-------    1 postfix  postfix       390 Mar 16 13:04 bayes.mutex
> -rw-rw----    1 postfix  postfix    320400 Mar 16 13:13 bayes_journal
> -rw-rw----    1 postfix  postfix   2641920 Mar 15 17:52 bayes_seen
> -rw-rw----    1 postfix  postfix   5697536 Mar 16 13:05 bayes_toks

I had an old version of sa-learn in /usr/local/bin. The new sa-learn is
installed in /usr/bin/. The old one was not removed when I upgraded from
2.6x to 3.0.2. The old one was in my PATH first. Everything's fine now.
-- 
Eric Dantan Rzewnicki  |  Systems Administrator
Technical Operations Division  |  Radio Free Asia
2025 M Street, NW  |  Washington, DC 20036  |  202-530-4900
CONFIDENTIAL COMMUNICATION
This e-mail message is intended only for the use of the addressee and
may contain information that is privileged and confidential. Any 
unauthorized dissemination, distribution, or copying is strictly 
prohibited. If you receive this transmission in error, please contact
network@rfa.org.

Re: sa-learn hangs

Posted by Eric Dantan Rzewnicki <rz...@rfa.org>.
On Tue, Mar 15, 2005 at 06:11:27PM -0500, Matt Kettler wrote:
> Eric Dantan Rzewnicki wrote:
> >spamassassin -D -p <conf_file> --lint doesn't show any problems that I
> >can see.
> >if I run: 
> >sa-learn --showdots --mbox --ham -p 
> >/opt/MailScanner/etc/spam.assassin.prefs.conf <ham_box>
> >sa-learn just hangs. Same happens for --spam.
> >strace shows it stuck on a read(0,
> >Any ideas?
> What about sa-learn -D -p <prefspath> --dump magic? does that hang? 

No hang with debug added to --dump. Same as without -D.

> If 
> that works, what about sa-learn -D --rebuild?

rebuild works fine, too.

> Do you have an alternate bayes_path set in your spam.assassin.prefs.conf?

I have these:

bayes_path /var/spool/MailScanner/spamassassin/bayes
bayes_file_mode 0660

> Does the user running sa-learn have rw permissions to it, and rwx to the 
> directory containing it?

I'm running sa-learn as root. 

:/var/spool/MailScanner/spamassassin# ls -la
total 7788
drwxr-xr-x    2 postfix  postfix      4096 Mar 16 13:05 .
drwxr-xr-x    6 root     root         4096 Jan 23  2004 ..
-rw-------    1 postfix  postfix       390 Mar 16 13:04 bayes.mutex
-rw-rw----    1 postfix  postfix    320400 Mar 16 13:13 bayes_journal
-rw-rw----    1 postfix  postfix   2641920 Mar 15 17:52 bayes_seen
-rw-rw----    1 postfix  postfix   5697536 Mar 16 13:05 bayes_toks


-- 
Eric Dantan Rzewnicki  |  Systems Administrator
Technical Operations Division  |  Radio Free Asia
2025 M Street, NW  |  Washington, DC 20036  |  202-530-4900
CONFIDENTIAL COMMUNICATION
This e-mail message is intended only for the use of the addressee and
may contain information that is privileged and confidential. Any 
unauthorized dissemination, distribution, or copying is strictly 
prohibited. If you receive this transmission in error, please contact
network@rfa.org.

Re: sa-learn hangs

Posted by Matt Kettler <mk...@evi-inc.com>.
Eric Dantan Rzewnicki wrote:

>spamassassin -D -p <conf_file> --lint doesn't show any problems that I
>can see.
>
>if I run: 
>sa-learn --showdots --mbox --ham -p /opt/MailScanner/etc/spam.assassin.prefs.conf <ham_box>
>
>sa-learn just hangs. Same happens for --spam.
>
>strace shows it stuck on a read(0,
>
>Any ideas?
>

What about sa-learn -D -p <prefspath> --dump magic? does that hang? If 
that works, what about sa-learn -D --rebuild?

Do you have an alternate bayes_path set in your spam.assassin.prefs.conf?

Does the user running sa-learn have rw permissions to it, and rwx to the 
directory containing it?