Please whitelist cPanel in your adblocker so that you’re able to see our version release promotions, thanks!

The Community Forums

Interact with an entire community of cPanel & WHM users!

SpamAssassin constantly crashing, reinstall script fails

Discussion in 'E-mail Discussion' started by Smartypants, Jan 19, 2019.

  1. Smartypants

    Smartypants Member

    Joined:
    May 1, 2015
    Messages:
    15
    Likes Received:
    0
    Trophy Points:
    1
    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?
     
    #1 Smartypants, Jan 19, 2019
    Last edited by a moderator: Jan 22, 2019
  2. cPanelLauren

    cPanelLauren Forums Analyst II Staff Member

    Joined:
    Nov 14, 2017
    Messages:
    5,716
    Likes Received:
    436
    Trophy Points:
    233
    Location:
    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!
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  3. Smartypants

    Smartypants Member

    Joined:
    May 1, 2015
    Messages:
    15
    Likes Received:
    0
    Trophy Points:
    1
    cPanel Access Level:
    Root Administrator
    I assume it's the %memused column that's relevant? It's showing a min of 77.51%, and a max of 94.36%.

    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
     
  4. cPanelLauren

    cPanelLauren Forums Analyst II Staff Member

    Joined:
    Nov 14, 2017
    Messages:
    5,716
    Likes Received:
    436
    Trophy Points:
    233
    Location:
    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!
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  5. cPanelLauren

    cPanelLauren Forums Analyst II Staff Member

    Joined:
    Nov 14, 2017
    Messages:
    5,716
    Likes Received:
    436
    Trophy Points:
    233
    Location:
    Houston
    cPanel Access Level:
    DataCenter Provider
    I also missed this initially:

    This is important but it's actually the %commit that I was looking for.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  6. Smartypants

    Smartypants Member

    Joined:
    May 1, 2015
    Messages:
    15
    Likes Received:
    0
    Trophy Points:
    1
    cPanel Access Level:
    Root Administrator
    "Old" as in older than it should be? Is that something that should/can be addressed?

    Running "yum update cpanel-perl-526-Mail-SpamAssassin-3.004002-1.cp1170.x86_64" produces:

    Code:
    No Packages marked for Update
    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.

    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!
     
  7. cPanelLauren

    cPanelLauren Forums Analyst II Staff Member

    Joined:
    Nov 14, 2017
    Messages:
    5,716
    Likes Received:
    436
    Trophy Points:
    233
    Location:
    Houston
    cPanel Access Level:
    DataCenter Provider
    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.

    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!
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  8. Smartypants

    Smartypants Member

    Joined:
    May 1, 2015
    Messages:
    15
    Likes Received:
    0
    Trophy Points:
    1
    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?
     
  9. cPanelLauren

    cPanelLauren Forums Analyst II Staff Member

    Joined:
    Nov 14, 2017
    Messages:
    5,716
    Likes Received:
    436
    Trophy Points:
    233
    Location:
    Houston
    cPanel Access Level:
    DataCenter Provider
    It could definitely be the cause but you showed only one installed previously. Can you run the following now?


    Code:
    rpm -qa |grep SpamAssassin
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  10. Smartypants

    Smartypants Member

    Joined:
    May 1, 2015
    Messages:
    15
    Likes Received:
    0
    Trophy Points:
    1
    cPanel Access Level:
    Root Administrator
    Yes, and that command still produces the same output:

    Code:
    root@srv2 [/scripts]# rpm -qa |grep SpamAssassin
    cpanel-perl-526-Mail-SpamAssassin-3.004002-1.cp1170.x86_64
     
  11. cPanelLauren

    cPanelLauren Forums Analyst II Staff Member

    Joined:
    Nov 14, 2017
    Messages:
    5,716
    Likes Received:
    436
    Trophy Points:
    233
    Location:
    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!
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  12. Smartypants

    Smartypants Member

    Joined:
    May 1, 2015
    Messages:
    15
    Likes Received:
    0
    Trophy Points:
    1
    cPanel Access Level:
    Root Administrator
    Ticket opened: 11359617
     
  13. cPanelLauren

    cPanelLauren Forums Analyst II Staff Member

    Joined:
    Nov 14, 2017
    Messages:
    5,716
    Likes Received:
    436
    Trophy Points:
    233
    Location:
    Houston
    cPanel Access Level:
    DataCenter Provider
    Thanks @Smartypants

    I've noted and am following that ticket. I'll update here with more information when it's available.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
Loading...

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice