You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@spamassassin.apache.org by Bernard <be...@rosset.me> on 2022/02/04 17:38:20 UTC
Errors running SpamAssassin
I got SpamAssassin on my server for a long time, and from time to time
it was reporting errors now and then from the daily scheduled task.
However, for the past week, the error is now constant.
I get the following error by email:
/etc/cron.daily/spamassassin:
chmod: cannot access 'body_0.bs': No such file or directory
make: *** [Makefile:465: body_0.bs] Error 1
command 'make PREFIX=/tmp/.spamassassin22314pi2fCtmp/ignored
INSTALLSITEARCH=/var/lib/spamassassin/compiled/5.032/3.004006
>>/tmp/.spamassassin22314pi2fCtmp/log' failed: exit 2
Looking at the contents of /tmp/.spamassassin22314pi2fCtmp/log:
Generating a Unix-style Makefile
Writing Makefile for Mail::SpamAssassin::CompiledRegexps::body_0
Writing MYMETA.yml and MYMETA.json
cp body_0.pm blib/lib/Mail/SpamAssassin/CompiledRegexps/body_0.pm
Running Mkbootstrap for body_0 ()
chmod 644 "body_0.bs"
/var/lib/spamassassin seems to contain a lot of outdated stuff:
drwxr-xr-x 3 debian-spamd debian-spamd 4096 Jun 18 2017 3.004000
drwxr-xr-x 3 debian-spamd debian-spamd 4096 Nov 10 2018 3.004001
drwxr-xr-x 3 debian-spamd debian-spamd 4096 Oct 16 04:47 3.004002
drwxr-xr-x 3 debian-spamd debian-spamd 4096 Feb 4 07:08 3.004006
drwxr-xr-x 3 debian-spamd debian-spamd 4096 Oct 16 17:32 compiled
drwx------ 3 debian-spamd debian-spamd 4096 Feb 2 14:26 sa-update-keys
I never really understood what I was doing with SpamAssassin...
Bernard
Re: Errors running SpamAssassin
Posted by Bernard <be...@rosset.me>.
>> I'd run "sh -x /etc/cron.daily/spamassassin"
>> to see what command in that file failed. I assume it is the sa-compile
>> command.
I got some more results.
Here are the steps I made:
1. Remove everything from /var/lib/spamassassin
2. Reinstall spamassassin package
3. Recreate /var/lib/spamassassin/compiled directory with
debian-spamd:debian-spamd ownership
4. Run sudo sh -x /etc/cron.daily/spamassassin
Here is the output I collected:
+ CRON=0
+ test -f /etc/default/spamassassin
+ . /etc/default/spamassassin
+ SPAMD_HOME=/run/spamd/
+ OPTIONS=--create-prefs --max-children 5 --helper-home-dir /run/spamd/
--listen /run/spamd/spamd.sock --username debian-spamd -s spamd
--allow-tell --timeout-child=30
+ PIDFILE=/run/spamd/spamd.pid
+ NICE=--nicelevel 15
+ CRON=1
+ test -x /usr/bin/sa-update
+ test -x /etc/init.d/spamassassin
+ command -v gpg
+ [ 1 = 0 ]
+ [ ! -t 0 ]
+ umask 022
+ env -i LANG=en_GB.UTF-8
PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
http_proxy= start-stop-daemon --chuid debian-spamd:debian-spamd --start
--exec /usr/bin/sa-update -- --gpghomedir
/var/lib/spamassassin/sa-update-keys
+ env -i LANG=en_GB.UTF-8
PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
start-stop-daemon --chuid debian-spamd:debian-spamd --start --exec
/usr/bin/spamassassin -- --lint
+ do_compile
+ [ -x /usr/bin/re2c -a -x /usr/bin/sa-compile ]
+ env -i LANG=en_GB.UTF-8
PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
start-stop-daemon --chuid debian-spamd:debian-spamd --start --exec
/usr/bin/sa-compile -- --quiet
chmod: cannot access 'body_0.bs': No such file or directory
make: *** [Makefile:465: body_0.bs] Error 1
command 'make PREFIX=/tmp/.spamassassin11033rJy6vLtmp/ignored
INSTALLSITEARCH=/var/lib/spamassassin/compiled/5.032/3.004006
>>/tmp/.spamassassin11033rJy6vLtmp/log' failed: exit 2
+ runuser -u debian-spamd -- chmod -R go-w,go+rX
/var/lib/spamassassin/compiled
+ reload
+ which invoke-rc.d
+ invoke-rc.d --quiet spamassassin status
+ invoke-rc.d spamassassin reload
+ [ -d /etc/spamassassin/sa-update-hooks.d ]
+ run-parts --lsbsysinit /etc/spamassassin/sa-update-hooks.d
The error in the middle is the one reported daily through the run of the
cron job.
Might there be something wrong with my environment? Else, what could be
wrong/needs checking?
Bernard
Re: Errors running SpamAssassin
Posted by Bernard <be...@rosset.me>.
Thanks for your help Ian,
> I'd run "sh -x /etc/cron.daily/spamassassin"
> to see what command in that file failed. I assume it is the sa-compile command.
Running /etc/cron.daily/spamassassin manually, either with "-x" provided
to the shell or simply by running it, letting the shebang do the job,
doesn't yield any error.
It seems the environment might not exactly be the same when running
through the cron job, but I can't put my finger on it.
Bernard
Re: Errors running SpamAssassin
Posted by Ian Kelling <ia...@fsf.org>.
Bernard <be...@rosset.me> writes:
> I got SpamAssassin on my server for a long time, and from time to time
> it was reporting errors now and then from the daily scheduled task.
>
> However, for the past week, the error is now constant.
>
> I get the following error by email:
> /etc/cron.daily/spamassassin:
> chmod: cannot access 'body_0.bs': No such file or directory
> make: *** [Makefile:465: body_0.bs] Error 1
> command 'make PREFIX=/tmp/.spamassassin22314pi2fCtmp/ignored
> INSTALLSITEARCH=/var/lib/spamassassin/compiled/5.032/3.004006
>>>/tmp/.spamassassin22314pi2fCtmp/log' failed: exit 2
>
> Looking at the contents of /tmp/.spamassassin22314pi2fCtmp/log:
> Generating a Unix-style Makefile
> Writing Makefile for Mail::SpamAssassin::CompiledRegexps::body_0
> Writing MYMETA.yml and MYMETA.json
> cp body_0.pm blib/lib/Mail/SpamAssassin/CompiledRegexps/body_0.pm
> Running Mkbootstrap for body_0 ()
> chmod 644 "body_0.bs"
>
> /var/lib/spamassassin seems to contain a lot of outdated stuff:
> drwxr-xr-x 3 debian-spamd debian-spamd 4096 Jun 18 2017 3.004000
> drwxr-xr-x 3 debian-spamd debian-spamd 4096 Nov 10 2018 3.004001
> drwxr-xr-x 3 debian-spamd debian-spamd 4096 Oct 16 04:47 3.004002
> drwxr-xr-x 3 debian-spamd debian-spamd 4096 Feb 4 07:08 3.004006
> drwxr-xr-x 3 debian-spamd debian-spamd 4096 Oct 16 17:32 compiled
> drwx------ 3 debian-spamd debian-spamd 4096 Feb 2 14:26 sa-update-keys
>
> I never really understood what I was doing with SpamAssassin...
>
> Bernard
I don't know the answer, but here's some steps I'd take to try to figure
it out.
I'd run "sh -x /etc/cron.daily/spamassassin"
to see what command in that file failed. I assume it is the sa-compile command.
If that didn't lead me to figuring it out, I'd probably make a fresh
chroot of your os with debootstrap, then chroot in, install
spamassassin, and see if it also fails there. If so, I'd definitely
report it as a bug.
- Ian
Re: Errors running SpamAssassin
Posted by Bernard <be...@rosset.me>.
> What version are you running, what os version, etc.
Debian (Bullseye) 11 like platform:
SpamAssassin version 3.4.6
running on Perl version 5.32.1
Package: spamassassin
Version: 3.4.6-1
[...]
Maintainer: Noah Meyerhans <no...@debian.org>
[...]
Homepage: https://spamassassin.apache.org/
Bernard
Re: Errors running SpamAssassin
Posted by Ian Kelling <ia...@fsf.org>.
Bernard <be...@rosset.me> writes:
> I never really understood what I was doing with SpamAssassin...
What version are you running, what os version, etc.