[Solved] SpamAssassin install fails with perl error

NoBaloney2

NoBaloney Internet Svcs.
Joined
Jun 17, 2007
Messages
498
Location
California
SpamAssassin has always been the biggest problem I've had with DirectAdmin installs, and this time is no exception.

Referring to some old threads first, but only for historical reference:

installing spamassassin through custombuild fails
Feb 07, 2013

That time it was a dependency problem, but that eventually got resolved (thanks, zEitEr, for your helpful link to another thread:

Spam Assasin
Nov 21, 2011

The problem now may be with dependencies as well, but it's compounded by another issue:

When building SpamAssassin from CustomBuild 2, the build fails with:

Code:
Trying to make SpamAssassin...
make: *** No targets specified and no makefile found.  Stop.

If needed, use cpan to install the missing modules, eg:
  cpan -i Archive::Tar Digest::SHA Mail::SPF IP::Country Net::Ident IO::Socket::INET6 Compress::Zlib Mail::DKIM LWP::UserAgent HTTP::Date Encode::Detect ExtUtils::MakeMaker

Press enter to answer [yes] if it asks you to install dependencies (it will prepend them to the queue)
Answer no if it asks: Are you ready for manual configuration? [yes] no


*** The make has failed, would you like to try to make again? (y,n):
(Note above all shows up at once, with no pauses for input)

So then I presume the depencies listed are real and not just examples, and I try to install them.

But running cpan, every time, always ends with disaster:

Code:
You have no /root/.cpan/sources/MIRRORED.BY
  I'm trying to fetch one
CPAN: LWP::UserAgent loaded ok (v5.833)
Fetching with LWP:
  ftp://mirror.cc.columbia.edu/pub/software/cpan/MIRRORED.BY
Fetching with LWP:
  ftp://mirror.cc.columbia.edu/pub/software/cpan/MIRRORED.BY.gz
Fetching with Net::FTP:
  ftp://mirror.cc.columbia.edu/pub/software/cpan/MIRRORED.BY
Catching error: "Can't use an undefined value as a symbol reference at /usr/share/perl5/Net/FTP/dataconn.pm line 54.\cJ" at /usr/share/perl5/CPAN.pm line 391
        CPAN::shell() called at -e line 1
I'm almost ashamed to admit how long I've spent going around in circles trying to fix this, but now I'm hoping to put it in the hands of John and Martynas.

And it's okay to ask me if I've tried anything at all besides just installing dependencies, but I have. I've tried everything including a complete initialization (which it seems to want to do anyway, no matter what I ask for).

While I understand that CustomBuild 2 is still in beta, I should probably note that the same thing occurs when I try to use the spamassassin installation script.

Any ideas, anyone? Don't be afraid to call me; worst case is it will simply wake me up :).

Jeff
 

DirectAdmin Support

Administrator
Staff member
Joined
Feb 27, 2003
Messages
9,005
Hi Jeff,

If the error occurs when running the cpan command, then I'm not too sure.

Might be an older module for the version of perl installed, ... or perhaps an update will help (guessing, never seen the error before):
Code:
[COLOR=#000000][FONT=Consolas]cpan upgrade [/FONT][/COLOR][COLOR=#000000][FONT=Consolas]/(.*)/[/FONT][/COLOR]
and the last idea would be to try installing all perl modules with yum instead of cpan:
http://help.directadmin.com/item.php?id=36

John
 

NoBaloney2

NoBaloney Internet Svcs.
Joined
Jun 17, 2007
Messages
498
Location
California
Thanks, John!

I don't remember what I tried last night but I'll try your suggestions.

This suggestion:
Code:
cpan upgrade /(.*)/
Exactly as shown it doesnt work; I get:
Code:
-bash: syntax error near unexpected token `('
So, I tried
Code:
cpan upgrade *
and get the same error:
Code:
CPAN: Storable loaded ok (v2.20)
Going to read '/root/.cpan/Metadata'
  Database was generated on Fri, 28 Feb 2014 08:41:02 GMT
CPAN: LWP::UserAgent loaded ok (v5.833)
Fetching with LWP:
  ftp://mirror.cc.columbia.edu/pub/software/cpan/authors/01mailrc.txt.gz
LWP failed with code[500] message[Can't use an undefined value as a symbol reference]
Fetching with Net::FTP:
  ftp://mirror.cc.columbia.edu/pub/software/cpan/authors/01mailrc.txt.gz
Can't use an undefined value as a symbol reference at /usr/share/perl5/Net/FTP/dataconn.pm line 54.
Bug in the entire cpan system? (seems to have same failure in two modules: Net::FTP and LWP.

Trying the link (sorry; didn't think of it last night)...
Code:
Ran the command to install prerequisites from YUM.
[code]yum -y install perl-ExtUtils-MakeMaker perl-Digest-SHA perl-Net-DNS perl-NetAddr-IP perl-Archive-Tar perl-IO-Zlib perl-Digest-SHA perl-Mail-SPF perl-IP-Country perl-Razor2 perl-Net-Ident perl-IO-Socket-INET6 perl-IO-Socket-SSL perl-Mail-DKIM perl-DBI perl-Encode-Detect perl-HTML-Parser perl-HTML-Tagset perl-Time-HiRes perl-libwww-perl
It installed all!
Then I ran the install from custombuild:
Code:
./build spamassassin
Voila! It works.
Code:
ps waux | grep spam

root     16494  6.0  0.2 144816 51120 ?        Ss   13:18   0:01 /usr/bin/spamd -d -c -m 5
root     16495  0.0  0.1 144816 48856 ?        S    13:18   0:00 spamd child
root     16496  0.0  0.1 144816 48856 ?        S    13:18   0:00 spamd child
root     16780  0.0  0.0 103312   860 pts/1    S+   13:19   0:00 grep spam
Thanks for the prompt help. Server can be delivered :)

Jeff
 

R1Lover

Verified User
Joined
Feb 24, 2007
Messages
439
In addition to the above items from jeff, if you see the following in your message log after trying to start SA.

Code:
 spamd: logger: add Syslog failed: Can't locate Sys/Syslog.pm in @INC (@INC contains: /usr/share/perl5 /usr/local/lib64/perl5 /usr/local/share/perl5 /usr/lib64/perl5/vendor_perl /usr/share/perl5/vendor_perl /usr/lib64/perl5) at /usr/share/perl5/Mail/SpamAssassin/Logger/Syslog.pm line 39.
This is due to the newer perl not including all modules as before, the Sys/Syslog.pm module is now provided by the perl-Sys-Syslog, run the following, then start SA normally.

Code:
 [COLOR=#000000][FONT=verdana]yum install -y perl-Sys-Syslog
[/FONT][/COLOR]
 
Top