SpamAssassin constantly crashing, reinstall script fails

Smartypants

Member
May 1, 2015
23
1
3
cPanel Access Level
Root Administrator
Encountering various problems with SpamAssassin on one server recently - it's crashing at LEAST every 2 hours and the "FAILED" notification EMail doesn't provide any useful information as to why, just this message:

Code:
"Died at /usr/local/cpanel/Cpanel/ServiceManager/Services/Spamd.pm line 188.
...propagated at /usr/local/cpanel/Cpanel/ServiceManager/Services/Spamd.pm line 200.

The subprocess “/usr/local/cpanel/scripts/restartsrv_spamd” reported error number 69 when it ended."
I haven't been able find any useful info by Google'ing those error messages.

I also have a training script that runs every 24 hours to train SA on a set of folders containing spam messages - and the cron notification EMails now contain more error message than actual useful output, E.g.:

Code:
"SPAM (learn_spam):
Checking read messages to learn SPAM: Bareword found where operator expected at /usr/local/cpanel/Cpanel/IP/Collapse.pm line 10, near "tr/://dr"
Unquoted string "r" may clash with future reserved word at /usr/local/cpanel/Cpanel/IP/Collapse.pm line 10.
plugin: failed to parse plugin /usr/local/cpanel/Cpanel/Mail/SpamAssassin/Plugin/P0f.pm: syntax error at /usr/local/cpanel/Cpanel/IP/Collapse.pm line 10, near "tr/://dr "
Compilation failed in require at /usr/local/cpanel/Cpanel/IP/Convert.pm line 11.
BEGIN failed--compilation aborted at /usr/local/cpanel/Cpanel/IP/Convert.pm line 11.
Compilation failed in require at /usr/local/cpanel/Cpanel/Net/P0f.pm line 13.
BEGIN failed--compilation aborted at /usr/local/cpanel/Cpanel/Net/P0f.pm line 13.
Compilation failed in require at /usr/local/cpanel/Cpanel/Mail/SpamAssassin/Plugin/P0f.pm line 52.
BEGIN failed--compilation aborted at /usr/local/cpanel/Cpanel/Mail/SpamAssassin/Plugin/P0f.pm line 53.
Compilation failed in require at /usr/local/lib/perl5/site_perl/5.8.8/Mail/SpamAssassin/PluginHandler.pm line 109."
I found a few references via Google to a "/scripts/fixspamassassinfailedupdate" script - but that command fails, so it appears to no longer be included with CPanel. The only option I could find that looks like it might work is forcibly reinstalling SpamAssassin... but even the command to do that fails with a bunch of cryptic error messages that are likely useless to anyone who isn't a Perl dev:

Code:
"Search pattern not terminated at /usr/local/cpanel/Cpanel/LoadFile/ReadFast.pm line 100.
Compilation failed in require at /usr/local/cpanel/Cpanel/LoadFile.pm line 13.
BEGIN failed--compilation aborted at /usr/local/cpanel/Cpanel/LoadFile.pm line 13.
Compilation failed in require at /usr/local/cpanel/Cpanel/CachedCommand.pm line 11.
BEGIN failed--compilation aborted at /usr/local/cpanel/Cpanel/CachedCommand.pm line 11.
Compilation failed in require at /usr/local/cpanel/Cpanel/cPCPAN/Install.pm line 74."
Is there any fix/workaround for this comedy of errors?
 
Last edited by a moderator:

cPanelLauren

Forums Analyst II
Staff member
Nov 14, 2017
8,012
647
263
Houston
cPanel Access Level
DataCenter Provider
Hi @Smartypants

Out of curiosity what's your memory usage at? You can view stats on the last 12 hours with sysstats:

Code:
sar -r
The instructions you were looking at for reinstalling seem to be old, we package SA in an RPM now so simply reinstalling the package should do the trick:

First find which version you're running:

Code:
rpm -qa |grep SpamAssassin
The reinstall:
Code:
yum reinstall packagename
Thanks!
 

Smartypants

Member
May 1, 2015
23
1
3
cPanel Access Level
Root Administrator
Hi @Smartypants

Out of curiosity what's your memory usage at? You can view stats on the last 12 hours with sysstats:

Code:
sar -r
I assume it's the %memused column that's relevant? It's showing a min of 77.51%, and a max of 94.36%.

The instructions you were looking at for reinstalling seem to be old, we package SA in an RPM now so simply reinstalling the package should do the trick:

First find which version you're running:

Code:
rpm -qa |grep SpamAssassin
The reinstall:
Code:
yum reinstall packagename
Thanks!
Not working. Output of the first command:

Code:
cpanel-perl-526-Mail-SpamAssassin-3.004002-1.cp1170.x86_64
And attempting to run "yum reinstall cpanel-perl-526-Mail-SpamAssassin-3.004002-1.cp1170.x86_64" produces an error message:

Code:
Installed package cpanel-perl-526-Mail-SpamAssassin-3.004002-1.cp1170.x86_64 not available.
Error: Nothing to do
 

cPanelLauren

Forums Analyst II
Staff member
Nov 14, 2017
8,012
647
263
Houston
cPanel Access Level
DataCenter Provider
Actually that's telling you that the package you have is no longer available. Which makes sense considering it seems to be in an older perl version. What happens when you attempt to update SpamAssassin?

The way I would do this is different than simply running yum.


1. I would run the following:
Code:
rpm -e --nodeps cpanel-perl-526-Mail-SpamAssassin-3.004002-1.cp1170.x86_64
2. Then run
Code:
/scripts/check_cpanel_rpms --fix
which should find that SpamAssassin is missing from the system and reinstall + resolve any dependencies

Thanks!
 

Smartypants

Member
May 1, 2015
23
1
3
cPanel Access Level
Root Administrator
Actually that's telling you that the package you have is no longer available. Which makes sense considering it seems to be in an older perl version.
"Old" as in older than it should be? Is that something that should/can be addressed?

What happens when you attempt to update SpamAssassin?
Running "yum update cpanel-perl-526-Mail-SpamAssassin-3.004002-1.cp1170.x86_64" produces:

Code:
No Packages marked for Update
The way I would do this is different than simply running yum.
Yes, I would normally try to do that with rpm as well - I tried it with yum because I was following the instructions you posted.

1. I would run the following:
Code:
rpm -e --nodeps cpanel-perl-526-Mail-SpamAssassin-3.004002-1.cp1170.x86_64
2. Then run
Code:
/scripts/check_cpanel_rpms --fix
which should find that SpamAssassin is missing from the system and reinstall + resolve any dependencies

Thanks!
This seems to have worked - no crashes in the 2-3 hours since following those steps. I'll follow-up in a day or two if it starts crashing again, or to confirm that the issue is resolved if not. Thanks!
 

cPanelLauren

Forums Analyst II
Staff member
Nov 14, 2017
8,012
647
263
Houston
cPanel Access Level
DataCenter Provider
Yes, I would normally try to do that with rpm as well - I tried it with yum because I was following the instructions you posted.
You wouldn't really want to update a package with check_cpanel_rpms - the reason for me having you check/reinstall with yum was to ensure that in the event there was an update available it was handled and to see if the package existed. To install a differently named cPanel package the best way is to use check_cpanel_rpms which is why I had you do that later.

This seems to have worked - no crashes in the 2-3 hours since following those steps. I'll follow-up in a day or two if it starts crashing again, or to confirm that the issue is resolved if not. Thanks!
I'm glad the updated version is working for you and I'm happy to have been able to help. Let us know how it goes and if you have any further issues.


Thanks!
 

Smartypants

Member
May 1, 2015
23
1
3
cPanel Access Level
Root Administrator
Update: it was fine for a few hours, but it started crashing again around 3 Eastern.

Also, I noticed that the check_cpanel_rpms command reinstalled the same version of SpamAssassin - was it supposed to install an updated version?

I followed the instructions at Apache SpamAssassin - Version 68 Documentation - cPanel Documentation to check my SpamAssassin version on the server where the issue is occurring, and compared it against another server where SpamAssassin is running without any problems - but both show:

Code:
SpamAssassin version 3.4.2
  running on Perl version 5.26.0
Though on the server where the issue is occurring, it looks like there's a different versions of SpamAssassin installed at the system level - if I just run "spamassassin --version," then it reports:

Code:
SpamAssassin version 3.4.1
  running on Perl version 5.8.8
Is it possible that the separate copies/versions of SpamAssassin are causing the issue?
 

cPanelLauren

Forums Analyst II
Staff member
Nov 14, 2017
8,012
647
263
Houston
cPanel Access Level
DataCenter Provider
Hi @Smartypants

I actually believe the issue might be related to the Perl version on the server, you don't have two installations of SA what you have is two separate Perl versions and SA seems to be trying to run on both. Can you please open a ticket using the link in my signature? Once open please reply with the Ticket ID here so that we can update this thread with the resolution once the ticket is resolved.


Thanks!
 

Smartypants

Member
May 1, 2015
23
1
3
cPanel Access Level
Root Administrator
I actually believe the issue might be related to the Perl version on the server, you don't have two installations of SA what you have is two separate Perl versions and SA seems to be trying to run on both. Can you please open a ticket using the link in my signature? Once open please reply with the Ticket ID here so that we can update this thread with the resolution once the ticket is resolved.
Ticket opened: 11359617