Failed AUTH: Must issue a STARTTLS command first - perl

I cannot for the life of me figure out how to setup Bugzilla to send email using TLS. I got the Bugzilla site running, however, when I try to change my Bugzilla account email, the system fails with the following (I setup my email parameters to use my Amazon AWS email server):
An unexpected error occurred. This could be a temporary problem, or some code is behaving incorrectly. If this problem persists, please email this page to ...#.....com with details of what you were doing at the time this message appeared.
URL: http://example.com/userprefs.cgi?new_password1=&new_password2=&tab=account&old_login=jdoe%40example.com&realname=John%20Doe&new_login_name=johndoe422%40example.net&dosave=1&token=...&old_password=...
There was an error sending mail from 'bugzilla#example.com' to 'johndoe422#example.com': failed AUTH: Must issue a STARTTLS command first
Traceback:
at Bugzilla/Mailer.pm line 186.
Bugzilla::Mailer::MessageToMTA(...) called at Bugzilla/Token.pm line 116
Bugzilla::Token::IssueEmailChangeToken(...) called at /srv/www/bugzilla/userprefs.cgi line 120
main::SaveAccount(...) called at /srv/www/bugzilla/userprefs.cgi line 608
So I proceeded to try to fix this problem by following the instructions in: Bugzilla Alerts Using Gmail
I managed to install the Email::Send::SMTP::TLS module using cpanm (Not sure why I just cannot install any module via CPAN at all), after installation, the SMTP::TLS option does not appear in the drop-down. I just ignored it and continue to update Mailer.pm as instructed.
After that, when I refresh my bugzilla page, I get the following error:
Software error:
Global symbol "#args" requires explicit package name at Bugzilla/Mailer.pm line 138.
Global symbol "#args" requires explicit package name at Bugzilla/Mailer.pm line 144.
Compilation failed in require at Bugzilla/Auth.pm line 22.
BEGIN failed--compilation aborted at Bugzilla/Auth.pm line 22.
Compilation failed in require at Bugzilla.pm line 23.
BEGIN failed--compilation aborted at Bugzilla.pm line 23.
Compilation failed in require at /srv/www/bugzilla/editparams.cgi line 15.
BEGIN failed--compilation aborted at /srv/www/bugzilla/editparams.cgi line 15.
For help, please send mail to this site's webmaster, giving this error message and the time and date of the error.
I've read that perhaps it is because Email::Send::SMTP::TLS requires Net::SSLeay package. So I proceed to try to install it using cpanm. However, cpanm fails with the following log:
23 *** Found OpenSSL-1.0.1f installed in /usr
24 *** Be sure to use the same compiler and options to compile your OpenSSL, perl,
25 and Net::SSLeay. Mixing and matching compilers is not supported.
26 Do you want to run external tests?
27 These tests *will* *fail* if you do not have network connectivity. [n] n
28 Checking if your kit is complete...
29 Looks good
30 Generating a Unix-style Makefile
31 Writing Makefile for Net::SSLeay
32 Writing MYMETA.yml and MYMETA.json
33 -> OK
34 Checking dependencies from MYMETA.json ...
35 Checking if you have Test::More 0.60_01 ... Yes (1.001014)
36 Checking if you have MIME::Base64 0 ... Yes (3.13)
37 Checking if you have ExtUtils::MakeMaker 0 ... Yes (7.10)
38 Building and testing Net-SSLeay-1.72
39 cp lib/Net/SSLeay.pm blib/lib/Net/SSLeay.pm
40 AutoSplitting blib/lib/Net/SSLeay.pm (blib/lib/auto/Net/SSLeay)
41 blib/lib/Net/SSLeay.pm: some names are not unique when truncated to 8 characters:
42 directory blib/lib/auto/Net/SSLeay:
43 do_https3.al, do_https2.al, do_https4.al, do_https.al truncate to do_https
44 do_httpx3.al, do_httpx2.al, do_httpx4.al truncate to do_httpx
45 get_https.al, get_https3.al, get_https4.al, get_http.al, get_http3.al, get_http4.al, get_httpx.al, get_httpx3.al, get_httpx4.al truncate to get_http
46 head_https.al, head_https3.al, head_https4.al, head_http.al, head_http3.al, head_http4.al, head_httpx.al, head_httpx3.al, head_httpx4.al truncate to head_htt
47 post_https.al, post_https3.al, post_https4.al, post_http.al, post_http3.al, post_http4.al, post_httpx.al, post_httpx3.al, post_httpx4.al truncate to post_htt
48 put_https.al, put_https3.al, put_https4.al, put_http.al, put_http3.al, put_http4.al, put_httpx.al, put_httpx3.al, put_httpx4.al truncate to put_http
49 ssl_read_all.al, ssl_read_until.al, ssl_read_CRLF.al truncate to ssl_read
50 ssl_write_all.al, ssl_write_CRLF.al truncate to ssl_writ
51 tcp_read_all.al, tcp_read_until.al, tcp_read_CRLF.al truncate to tcp_read
52 tcp_write_all.al, tcp_write_CRLF.al truncate to tcp_writ
53 cp lib/Net/SSLeay/Handle.pm blib/lib/Net/SSLeay/Handle.pm
54 cp lib/Net/SSLeay.pod blib/lib/Net/SSLeay.pod
55 Running Mkbootstrap for Net::SSLeay ()
56 chmod 644 "SSLeay.bs"
57 "/usr/bin/perl" "-Iinc" "/usr/share/perl/5.18/ExtUtils/xsubpp" -typemap "/usr/share/perl/5.18/ExtUtils/typemap" -typemap "typemap" SSLeay.xs > SSLeay.xsc && mv SSLeay.xsc SSL eay.c
58 cc -c -I/usr/include -D_REENTRANT -D_GNU_SOURCE -DDEBIAN -fstack-protector -fno-strict-aliasing -pipe -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -O2 -g -DVERSION=\"1.72\" -DXS_VERSION=\"1.72\" -fPIC "-I/usr/lib/perl/5.18/CORE" SSLeay.c
59 {standard input}: Assembler messages:
60 {standard input}: Error: open CFI at the end of file; missing .cfi_endproc directive
61 cc: internal compiler error: Killed (program cc1)
62 Please submit a full bug report,
63 with preprocessed source if appropriate.
64 See <file:///usr/share/doc/gcc-4.8/README.Bugs> for instructions.
65 make: *** [SSLeay.o] Error 4
66 -> FAIL Installing Net::SSLeay failed. See /home/ubuntu/.cpanm/work/1443609644.32449/build.log for details. Retry with --force to force install it.
I do not know perl and cannot figure out why I'm getting errors left and right.
I read in many places that I can simply install all available packages using command like:
/usr/bin/perl install-module.pl --all
However, this command does not work for me. (I can't install any modules using CPAN at all, not sure why) It pretty much just does nothing for me. This is the output I get when execute install-module.pl:
ubuntu#ip-10-130-10-107:/srv/www/bugzilla$ sudo /usr/bin/perl install-module.pl --all
Checking for CPAN (v1.81) ok: found v2.10
Checking for YAML (any) ok: found v1.15
Checking for ExtUtils-MakeMaker (v6.31) ok: found v7.1
defined(#array) is deprecated at /usr/share/perl5/Chart/Base.pm line 181.
(Maybe you should just omit the defined()?)
defined(#array) is deprecated at /usr/share/perl5/Chart/Base.pm line 233.
(Maybe you should just omit the defined()?)
Reading '/home/ubuntu/.cpan/Metadata'
Fetching with LWP:
http://cpan.mirror.vexxhost.com/authors/01mailrc.txt.gz
Reading '/home/ubuntu/.cpan/source/authors/01mailrc.txt.gz'
............................................................................DONE
Fetching with LWP:
http://cpan.mirror.vexxhost.com/modules/02packages.details.txt.gz
Reading '/home/ubuntu/.cpan/source/modules/02packages.details.txt.gz'
Database was generated on Wed, 30 Sep 2015 09:53:42 GMT
..........ubuntu#ip-10-130-10-107:/srv/www/bugzilla$
I'm not sure why things just don't work for me. Do I have a faulty perl installation or what? Can some perl guru please help?
Thanks!

Solved the issue by killing my Bugzilla installation (5.0.1) and completely re-install an older version (4.4.10). Things just worked with the previous version.

I fought with the same problem, with Bugzilla 5, for half a day. I did not have any success getting STARTTLS to work, which is odd, because it's the standard way to send email these days. I finally gave up and activated SMTPS (port 465) on my Postfix server. It was very easy to do this, and once I did it, Bugzilla could send emails easily. If you have control over the mail server, this is an easier approach because life is too short to spend it reading through perl code. Edit: all these years later, STARTTLS still doesn't work on Bugzilla. I tried installing libnet-smtp-tls-butmaintained-perl which some suggested, but that didn't help. For those finding this post, give up and use smtps.

Related

perl installation, cpan install true.pm fails

I am very much a perl newbie, I know very little about the system.
I am trying to install App/Lingua/BO/Wylie/Transliteration.pm which seems to be dependent on true.
I am getting an error on the install of true. This seems very surprising, so I am very open to something very fundamental and wrong with the perl installation. Running perl v5.30.2 on MacOS 11.3.1.
cpan error log:
force install true.pm
Running install for module 'true'
CHOCOLATE/true-v1.0.2.tar.gz
Has already been unwrapped into directory /Users/phil/.cpan/build/true-v1.0.2-0
CHOCOLATE/true-v1.0.2.tar.gz
Has already been prepared
Running make for C/CH/CHOCOLATE/true-v1.0.2.tar.gz
"/usr/bin/perl" -MExtUtils::Command::MM -e 'cp_nonempty' -- true.bs blib/arch/auto/true/true.bs 644
cc -c -I/Users/phil/perl5/lib/perl5/darwin-thread-multi-2level/B/Hooks/OP/Annotation/Install -I/System/Library/Perl/Extras/5.30/darwin-thread-multi-2level/B/Hooks/OP/Check/Install -g -pipe -fno-strict-aliasing -fstack-protector-strong -DPERL_USE_SAFE_PUTENV -O3 -Wall -W -DVERSION=\"v1.0.2\" -DXS_VERSION=\"v1.0.2\" -iwithsysroot "/System/Library/Perl/5.30/darwin-thread-multi-2level/CORE" true.c
true.xs:8:10: fatal error: 'hook_op_check.h' file not found
#include "hook_op_check.h"
^~~~~~~~~~~~~~~~~
1 error generated.
make: *** [true.o] Error 1
CHOCOLATE/true-v1.0.2.tar.gz
/usr/bin/make -- NOT OK
Failed during this command:
CHOCOLATE/true-v1.0.2.tar.gz : make NO
true.xs:8:10: fatal error: 'hook_op_check.h' file not found
This looks like a bug in the system Perl installation that comes preinstalled on macOS. The module B::Hooks::OP::Check comes preinstalled in /System/Library/Perl/Extras/5.30/darwin-thread-multi-2level/B/Hooks/OP/ but the file /System/Library/Perl/Extras/5.30/darwin-thread-multi-2level/B/Hooks/OP/Check/Install/hook_op_check.h is missing for some reason. As a consequence, it is not possible to install the module true which depends on that file being there.
You can override the preinstalled version by running:
$ cpan -f B::Hooks::OP::Check
This will install the module into /Library/Perl/5.30/darwin-thread-multi-2level/B/Hooks/OP if you are using sudo with cpan, or into ~/perl5/lib/perl5/darwin-thread-multi-2level/B/Hooks/OP if you are using local::lib with cpan. This latter installation will be found before the preinstalled version due to the ordering of the perl #INC include path, so it will override the preinstalled version of the module.
This will enable you to install the module true, but after installing this the installation of App::Lingua::BO::Wylie::Transliteration still fails:
$ cpan App::Lingua::BO::Wylie::Transliteration
Loading internal logger. Log::Log4perl recommended for better logging
Reading '/Users/hakonhaegland/.cpan/Metadata'
Database was generated on Sat, 01 Jan 2022 22:29:03 GMT
Running install for module 'App::Lingua::BO::Wylie::Transliteration'
Fetching with LWP:
http://www.cpan.org/authors/id/D/DB/DBR/App-Lingua-BO-Wylie-Transliteration-0.1.0.tar.gz
Fetching with LWP:
HASH(0x13444b3c8)authors/id/D/DB/DBR/CHECKSUMS
Fetching with LWP:
HASH(0x13444b3c8)authors/id/D/DB/DBR/CHECKSUMS.gz
Fetching with LWP:
http://www.cpan.org/authors/id/D/DB/DBR/CHECKSUMS
Checksum for /Users/hakonhaegland/.cpan/sources/authors/id/D/DB/DBR/App-Lingua-BO-Wylie-Transliteration-0.1.0.tar.gz ok
Configuring D/DB/DBR/App-Lingua-BO-Wylie-Transliteration-0.1.0.tar.gz with Build.PL
Created MYMETA.yml and MYMETA.json
Creating new 'Build' script for 'App-Lingua-BO-Wylie-Transliteration' version '0.1.0'
DBR/App-Lingua-BO-Wylie-Transliteration-0.1.0.tar.gz
/usr/bin/perl Build.PL -- OK
Running Build for D/DB/DBR/App-Lingua-BO-Wylie-Transliteration-0.1.0.tar.gz
Building App-Lingua-BO-Wylie-Transliteration
DBR/App-Lingua-BO-Wylie-Transliteration-0.1.0.tar.gz
./Build -- OK
Running Build test for DBR/App-Lingua-BO-Wylie-Transliteration-0.1.0.tar.gz
t/00-check-deps.t ........ ok
t/00-load.t .............. 1/1
# Failed test 'use App::Lingua::BO::Wylie::Transliteration;'
# at /Library/Perl/5.30/Test/UseAllModules.pm line 71.
# Tried to use 'App::Lingua::BO::Wylie::Transliteration'.
# Error: Couldn't find declarator 'method' at /System/Library/Perl/Extras/5.30/darwin-thread-multi-2level/Devel/Declare/Context/Simple.pm line 47.
# Devel::Declare::Context::Simple::skip_declarator(Method::Signatures::Simple=HASH(0x12704f6d8)) called at /System/Library/Perl/Extras/5.30/darwin-thread-multi-2level/Devel/Declare/MethodInstaller/Simple.pm line 62
# Devel::Declare::MethodInstaller::Simple::parser(Method::Signatures::Simple=HASH(0x12704f6d8), "method", 0, 1) called at /System/Library/Perl/Extras/5.30/darwin-thread-multi-2level/Devel/Declare/MethodInstaller/Simple.pm line 25
# Devel::Declare::MethodInstaller::Simple::__ANON__("method", 0) called at /System/Library/Perl/Extras/5.30/darwin-thread-multi-2level/Devel/Declare.pm line 277
# Devel::Declare::linestr_callback("const", "method", 0) called at lib/App/Lingua/BO/Wylie/Transliteration.pm line 37
# require App/Lingua/BO/Wylie/Transliteration.pm called at /Library/Perl/5.30/Test/UseAllModules.pm line 71
# Test::UseAllModules::BEGIN() called at lib/App/Lingua/BO/Wylie/Transliteration.pm line 37
# eval {...} called at lib/App/Lingua/BO/Wylie/Transliteration.pm line 37
# eval 'package Test::UseAllModules;
# BEGIN { ${^WARNING_BITS} = $args[-1] if defined $args[-1] }
# #line 71 /Library/Perl/5.30/Test/UseAllModules.pm
# use App::Lingua::BO::Wylie::Transliteration #{$args[0]};
# 1;
# ' called at /System/Library/Perl/5.30/Test/More.pm line 1034
# Test::More::_eval("package Test::UseAllModules;\x{a}BEGIN { \${^WARNING_BITS} = \$args"..., ARRAY(0x1268938e0), "UUUUUUUUUUUUUUUUUUU") called at /System/Library/Perl/5.30/Test/More.pm line 1009
# Test::More::use_ok("App::Lingua::BO::Wylie::Transliteration") called at /Library/Perl/5.30/Test/UseAllModules.pm line 71
# Test::UseAllModules::all_uses_ok() called at t/00-load.t line 4
# main::BEGIN() called at lib/App/Lingua/BO/Wylie/Transliteration.pm line 37
# eval {...} called at lib/App/Lingua/BO/Wylie/Transliteration.pm line 37
# Compilation failed in require at /Library/Perl/5.30/Test/UseAllModules.pm line 71.
# BEGIN failed--compilation aborted at /Library/Perl/5.30/Test/UseAllModules.pm line 71.
Bailout called. Further testing stopped: failed: App::Lingua::BO::Wylie::Transliteration
this is due to a recent change in Devel::Declare and a corresponding change in the parser in bleed described in these bug reports, report1 and report2.
A workaround is to install a an earlier version of perl together with an earlier version of Devel::Declare. You can do this using perlbrew. For example:
$ perlbrew install perl-5.26.3
$ cpanm Devel::Declare#0.006019
$ cpanm App::Lingua::BO::Wylie::Transliteration

Issues installing perl module Bio::Perl

I am having some issues installing Bio-DB-HTS (https://github.com/Ensembl/Bio-DB-HTS) requried to run a perl script from a cloned git repository.
System & Perl information
I am on Mac OSx High Sierra v.10.13.6 and using perl 5, version 18, subversion 2 (v5.18.2). I have added this information in my original question now.
Background information
When trying to perform a local installation, according to README instructions, i receive the error...
git clone https://github.com/Ensembl/Bio-DB-HTS.git
cd Bio-DB-HTS-2.10
perl INSTALL.pl
lzma.h library header not found in /usr/include
I tried to install the LZMA library but found that it actually was installed and that the lzma.h header file was simply missing from the path /usr/include. As LZMA is deprecated and replaced with XZ I installed the XZ library
brew install xz
After a quick search i found the lzma.h header in...
/usr/local/Cellar/xz/5.2.4/include/lzma.h
Main Issue
Now this is where I am not sure of how to proceed and if I have messed up something while trying to get around this. Since /usr/include has a directory with restricted access I added a line in the INSTALL.pl script to check existence for the file in both locations (which could probably disrupt something downstream in the analysis as I didn't change anything else except the if condition. However, when running the install this time i ran into a new problem.
perl INSTALL.pl
BioPerl does not seem to be installed. Please install it and try again.
On Debian/Ubuntu systems you can do this with the command:
apt-get install bioperl
On other systems use the CPAN shell:
perl -MCPAN -e 'install Bio::Perl'
And this is where my main issues reside. When trying to install Bio:Perl using cpan tests fail at various stage and I'm not sure which ones are the essential ones. The last lines from the output are
Result: FAIL
Failed 3/325 test programs. 16/19945 subtests failed.
CJFIELDS/BioPerl-1.007002.tar.gz
./Build test -- NOT OK
//hint// to see the cpan-testers results for installing this module,
try:
reports CJFIELDS/BioPerl-1.007002.tar.gz
Running Build install
make test had returned bad status, won't install without force
I reconfigured cpan to install dependancies automatically as mentioned here How do I tell CPAN to install all dependencies?.
perl -MCPAN -Mlocal::lib=~/perl5 -e 'my $c = "CPAN::HandleConfig"; $c->load(doit => 1, autoconfig => 1); $c->edit(prerequisites_policy => "follow"); $c->edit(build_requires_install_policy => "yes"); $c->commit'
And tried installing again forcing installation...
perl -f -MCPAN -e 'install Bio::Perl'
But I just get the same error
Result: FAIL
Failed 3/325 test programs. 16/19945 subtests failed.
CJFIELDS/BioPerl-1.007002.tar.gz
./Build test -- NOT OK
//hint// to see the cpan-testers results for installing this module,
try:
reports CJFIELDS/BioPerl-1.007002.tar.gz
Running Build install
make test had returned bad status, won't install without force
When I look at what modules have been installed using...
cpan -l
Bio::DB::HTS 2.11
Bio::DB::HTS::ReadIterator 2.11
Bio::DB::HTS::VCF 2.11
Bio::DB::HTS::Faidx 2.11
Bio::DB::HTS::PileupWrapper 2.11
Bio::DB::HTS::Alignment 2.11
Bio::DB::HTS::ConfigData undef
.
.
.
Bio::DB::HTS::VCF::Iterator 2.11
Bio::DB::HTS::VCF::Row 2.11
I can see that many of the ones I need from the Bio-DB-HTS package are there (assuming that they were one of the succesful installations when isntalling Bio::Perl) but now it prompts the error
Can't locate Bio/SeqFeature/Lite.pm in #INC
However, I never manage to actually get Bio:Seq nor Bio::Perl installed. I do have some perl knowledge but mostly work on python so I am feeling a bit lost of how to proceed.
Extra information
My cpan installs modules to
/usr/local/perl
And I have added the path to my environment variable
export PERL5LIB=/usr/local/perl
Edited information (failed tests & errors) as response to Shawn
#Shawn, Its a long list of errors, test failures and recommended installations. I I can post some examples of the first couple of errors. I am not really sure what to look neither.
Recommended installations
Checking prerequisites...
recommends:
* Algorithm::Munkres is not installed
* Array::Compare is not installed
* Bio::Phylo is not installed
* Convert::Binary::C is not installed
* GD is not installed
* Graph is not installed
* GraphViz is not installed
* HTML::TableExtract is not installed
* Inline::C (0.53) is installed, but we prefer to have 0.67
* PostScript::TextBlock is not installed
* SVG is not installed
* SVG::Graph is not installed
* Set::Scalar is not installed
* Sort::Naturally is not installed
* Spreadsheet::ParseExcel is not installed
* XML::DOM is not installed
* XML::DOM::XPath is not installed
* XML::Parser::PerlSAX is not installed
* XML::SAX::Writer is not installed
* XML::Twig is not installed
* YAML is not installed
Checking optional features...
EntrezGene............disabled
requires:
! Bio::ASN1::EntrezGene is not installed
MySQL Tests...........disabled
requires:
! DBD::mysql is not installed
Pg Tests..............disabled
requires:
! DBD::Pg is not installed
Here is the test summary report. I did not print the entire list of failed tests as it is extremely long. But What I cans see is that /LocalDB/SeqFeature_BDB.t is a part of the majority of the failed tests when looking at the verbose output.
Test Summary Report
-------------------
t/LocalDB/Fasta.t (Wstat: 1024 Tests: 109 Failed: 4)
Failed tests: 73, 91, 95, 101
Non-zero exit status: 4
t/LocalDB/Index/Index.t (Wstat: 20224 Tests: 36 Failed: 6)
Failed tests: 12-17
Non-zero exit status: 79
Parse errors: Bad plan. You planned 73 tests but ran 36.
t/LocalDB/Qual.t (Wstat: 1536 Tests: 56 Failed: 6)
Failed tests: 7-9, 49-50, 52
Non-zero exit status: 6
t/LocalDB/SeqFeature_BDB.t (Wstat: 0 Tests: 38 Failed: 4)
Failed tests: 17-19, 24
Parse errors: Bad plan. You planned 116 tests but ran 38.
t/Perl.t (Wstat: 512 Tests: 47 Failed: 16)
Failed tests: 28, 28, 28, 28-29, 29, 29, 29-30, 30, 30
30-31, 31, 31, 31
Non-zero exit status: 2
Parse errors: Tests out of sequence. Found (24) but expected (26)
Tests out of sequence. Found (25) but expected (27)
Tests out of sequence. Found (26) but expected (28)
Tests out of sequence. Found (26) but expected (29)
Tests out of sequence. Found (27) but expected (30)
Displayed the first 5 of 23 TAP syntax errors.
Re-run prove with the -p option to see them all.
t/RemoteDB/BioFetch.t (Wstat: 0 Tests: 83 Failed: 47)
Failed tests: 20-21, 21-22, 22-23, 23-24, 24-25, 25-26
26-27, 27-28, 28-29, 29-30, 30, 30, 30-31
31, 31, 31-32, 32, 32, 32-33, 33, 33, 33-34
34, 34, 34-35, 35, 35, 35-36, 36, 36, 36
Parse errors: Tests out of sequence. Found (4) but expected (6)
Tests out of sequence. Found (6) but expected (7)
Tests out of sequence. Found (7) but expected (8)
Tests out of sequence. Found (5) but expected (9)
Tests out of sequence. Found (6) but expected (10)
Displayed the first 5 of 79 TAP syntax errors.
Re-run prove with the -p option to see them all.
t/RemoteDB/GenBank.t (Wstat: 0 Tests: 658 Failed: 614)
Failed tests: 10-11, 11, 11-12, 12, 12-13, 13, 13-14
14, 14-15, 15, 15-16, 16, 16-17, 17, 17-18
18, 18-19, 19, 19, 19, 19, 19, 19-20, 20
20, 20, 20, 20, 20-21, 21, 21, 21, 21, 21
21-22, 22, 22, 22, 22, 22, 22-23, 23, 23
Thanks to everyone that helped out, I managed to figure it out in the end. I will explain the process here from beginning to end incase anyone else has the same issue.
The question I posted was to solve how to install Bio::Perl using CPAN as I was having issues with tests failing. Although I had some issues installing Bio-DB-HTS (which I solved before posting) and I will explain how I managed to install that as well in case anyone comes across the same issue.
It seems that Mac users tend to have an issue with the lzma.h header missing. In the case of installing Bio-DB-HTS. I had to modify a line in the Bio-DB-HTS/INSTALL.pl file that checked for the existence of the lzma.h file. See "Installing Bio-DB-HTS on Mac OSx" below for instructions.
Solving installation of Bio::Perl
Essentially I solved it by reinstalling/reconfiguring my CPAN installation. Although I believe the issue in the end was due to some environment variables that I had not set as I chose to manual sort out my CPAN directory structure, I recommend letting CPAN do this for you using the local:lib option as it will set or tell you how to set the environment variables at the end of the installation.
I had only set one of the environment variables below (PERL5LIB) which was probably the reason for my error. NOTE! that the paths you see below are specific for my system.
PATH="/Users/sjamal/perl5/bin${PATH:+:${PATH}}"; export PATH;
PERL5LIB="/Users/sjamal/perl5/lib/perl5${PERL5LIB:+:${PERL5LIB}}"; export PERL5LIB;
PERL_LOCAL_LIB_ROOT="/Users/sjamal/perl5${PERL_LOCAL_LIB_ROOT:+:${PERL_LOCAL_LIB_ROOT}}"; export PERL_LOCAL_LIB_ROOT;
PERL_MB_OPT="--install_base \"/Users/sjamal/perl5\""; export PERL_MB_OPT;
PERL_MM_OPT="INSTALL_BASE=/Users/sjamal/perl5"; export PERL_MM_OPT;
If you have already it configured like me but what to start from a clean slate you will need to remove the CPAN folder created on the user that you installed cpan on.
/Users/<USERNAME>/.cpan
rm -rf /Users/<USERNAME>/.cpan
Now you should be able to run the cpan command as done at the first instance and get prompted with lots of questions of how you want to set up the installation and this is where you will be able to chose 'local:lib' (if you are able to access sudo you can choose the 'sudo' option as well). I installed cpanm based on multiple recommendations and also since it prompts less question apparently and then installed Bio::Perl. Although I should mention that the installation did failed a test and refused to install so I had to run the force command for it to build Bio::Perl.
cpan -i App:cpanminus
cpanm --force Bio::Perl
You should now have Bio::Perl installed.
Installing Bio-DB-HTS on Mac OSx
The lzma library is deprecated on Mac OSx but has been replaced with the XZ library so if you are missing the file as well you can install XZ using brew. If you don't have brew installed you can find how to install it here https://brew.sh/
brew install xz
You will now have a lzma.h header file in the location where XZ was installed using brew, in my case /usr/local/Cellar/xz/5.2.4/include/lzma.h.
git clone https://github.com/Ensembl/Bio-DB-HTS.git
cd Bio-DB-HTS-2.10
vim Bio-DB-HTS/INSTALL.pl
So, I changed the line using vim...
-e '/usr/include/lzma.h' or die <<END;
to
-e '/usr/include/lzma.h' **|| '/usr/local/Cellar/xz/5.2.4/include/lzma.h'** or die <<END;
NOTE! You have to change '/usr/local/Cellar/xz/5.2.4/include/lzma.h' path to where you have the lzma.h in XZ package just installed using brew. However, I want to clarify that this does not solve anything other than telling the script that the file does exist. The Install script won't be able to make use of the file (if that is what it needs to do) as nothing else has been changed in the installation script.
You should now be able to install Bio-DB-HTS by simply running the perl script as below
cd Bio-DB-HTS-2.10
perl INSTALL.pl
Hope that helps!
Sabri

"cpanm PHP" fails

What should I change in order to install the module? php is 5.3.3 withyum install php-devel in place.
PHP.c: In function ‘PHP_set_php_input’:
PHP.c:818: warning: passing argument 2 of ‘Perl_sv_2pv_flags’ from incompatible pointer type
/home/mpapec/.plenv/versions/5.20.0/lib/perl5/5.20.0/x86_64-linux/CORE/proto.h:3931: note: expected ‘STRLEN * const’ but argument is of type ‘int *’
cc -c -I/usr/include/php -I/usr/include/php/main -I/usr/include/php/TSRM -I/usr/include/php/Zend -I/usr/include/php/ext -I/usr/include/php/ext/date/lib -Wall -O2 -DVERSION=\"0.15\" -DXS_VERSION=\"0.15\" -fPIC "-I/home/mpapec/.plenv/versions/5.20.0/lib/perl5/5.20.0/x86_64-linux/CORE" array.c
In file included from /usr/include/php/main/php.h:33,
from /usr/include/php/sapi/embed/php_embed.h:23,
from PHP.h:14,
from array.c:9:
/usr/include/php/main/php_config.h:2417:1: warning: "_GNU_SOURCE" redefined
In file included from /home/mpapec/.plenv/versions/5.20.0/lib/perl5/5.20.0/x86_64-linux/CORE/perl.h:28,
from PHP.h:9,
from array.c:9:
/home/mpapec/.plenv/versions/5.20.0/lib/perl5/5.20.0/x86_64-linux/CORE/config.h:1825:1: warning: this is the location of the previous definition
rm -f blib/arch/auto/PHP/PHP.so
cc -shared -O2 -L/usr/local/lib -fstack-protector PHP.o array.o -o blib/arch/auto/PHP/PHP.so \
\
chmod 755 blib/arch/auto/PHP/PHP.so
"/home/mpapec/.plenv/versions/5.20.0/bin/perl5.20.0" -MExtUtils::Command::MM -e 'cp_nonempty' -- PHP.bs blib/arch/auto/PHP/PHP.bs 644
Manifying 1 pod document
Running Mkbootstrap for PHP ()
chmod 644 "PHP.bs"
PERL_DL_NONLAZY=1 "/home/mpapec/.plenv/versions/5.20.0/bin/perl5.20.0" "-Iblib/lib" "-Iblib/arch" test.pl
1..79
not ok 1 - use_ok PHP
# Failed test 'use_ok PHP'
# at test.pl line 11.
not ok 2 - require PHP;
# Failed test 'require PHP;'
# at test.pl line 18.
# Tried to require 'PHP'.
# Error: Attempt to reload PHP.pm aborted.
# Compilation failed in require at (eval 6) line 2.
not ok 3 - eval
# Failed test 'eval'
# at test.pl line 49.
Module PHP failed to load at blib/lib/PHP.pm line 80.
Module PHP failed to load at blib/lib/PHP.pm line 80.
END failed--call queue aborted at test.pl line 50.
# Looks like you planned 79 tests but ran 3.
# Looks like you failed 3 tests of 3 run.
# Looks like your test exited with 22 just after 3.
make: *** [test_dynamic] Error 22
-> FAIL Installing PHP failed. See /home/mpapec/.cpanm/work/1440522239.12833/build.log for details. Retry with --force to force install it.
(
PHP is kind of fragile. It probably won't work out of the box with your system php installation, and may have trouble with 64-bit or multi-threaded versions of perl.
I have only ever gotten it to work on Linux. The latest version I have tried to use is 5.3.8 (back in 2013), though I remember things going smoothly from 5.2.x to 5.3.8.
I always build php from source, with this configuration:
./configure --enable-embed --with-zlib --with-openssl --with-mysql \
--with-libdir=lib/i386-linux-gnu
--enable-embed is absolutely required, as the pod mentions, to build a PHP interpreter with the SAPI extension, and which then allows perl to manipulate the PHP interpreter through XS code. The other extensions were for other requirements of my project; they may be optional, but I haven't experimented with building the PHP interpreter or the PHP module with any other configuration. The pod also says to never use the --with-apxs argument, which I was never tempted to do anyway.
The build process of the PHP module will look for and require a program called php-config. You may need to hack your $PATH, if only during the build process, so that the PHP module runs the correct php-config. After that the module will know where to look for the rest of your php installation.
I had fun working with this module for a while (writing a Catalyst and then a Mojolicious wrapper around WordPress), but it has fallen into disrepair and disrepute. Share whatever you learn trying to build it and we'll put it in the docs, making this module that much easier to use.

Perl module broke my windows xampp installation

PROBLEM: In the process of trying to install gitstat on a Windows7 machine I broke my xampp Apache installation. Now I can't get gitstat or apache to work.
APACHE ERROR:
[error] Can't load Perl file: C:/xampp/apache/conf/extra/startup.pl for server localhost:80, exiting...`
Other people have reported this issue being caused by the PERL5LIB environment variable, but that variable does not exist on my machine.
WHAT I DID / GITSTAT ERROR:
I needed the SOAP::Lite module installed so I followed the windows guide here: http://soaplite.com/install.html
As far as I could tell I installed the module successfully, console output below
cpan[1]> install SOAP::Lite
CPAN: Storable loaded ok (v2.21)
Going to read '\xampp\perl\bin\.cpan\Metadata'
Database was generated on Wed, 27 Jun 2012 02:47:03 GMT
SOAP::Lite is up to date (0.714).
I saw a SOAP directory in perl/site/lib which (to me) means that the module should be available. When I look in my perllocal.pod file SOAP:Lite is in there.
Part of the gitstat installation instructions say to copy the Lite.pm file from perl/site/lib/SOAP into gitstat\gstat_pl\lib
However, when I try to perform step nine of gitstat installation (perl gitstat.pl HEAD) I get the following:
C:\xampp\htdocs\gitstat\gstat_pl>perl gitstat.pl HEAD
Supported versions:
BEGIN failed--compilation aborted at C:/xampp/perl/site/lib/SOAP/Lite.pm line 34
86.
Compilation failed in require at C:/xampp/perl/site/lib/SOAP/Constants.pm line 1
3.
BEGIN failed--compilation aborted at C:/xampp/perl/site/lib/SOAP/Constants.pm li
ne 13.
Compilation failed in require at lib/Lite.pm line 3444.
BEGIN failed--compilation aborted at lib/Lite.pm line 3444.
Compilation failed in require at gitstat.pl line 30.
If I don't copy the file from perl/site/lib/SOAP then I get
C:\xampp\htdocs\gitstat\gstat_pl>perl gitstat.pl HEAD
Can't locate lib/Lite.pm in #INC (#INC contains: C:/xampp/perl/lib C:/xampp/perl
/site/lib .) at gitstat.pl line 30.
I don't understand why CPAN didn't install the Lite.pm module in the #INC path or why the compilation might fail when the module is available, or most importantly why my Apache install is broken. Also I'm very new to Perl and CPAN and my understanding of Apache is primitive so simpler explanations would be greatly appreciated.

CPAN Perl modules installer not finding tar file

It seems I have a configuration problem when installing Perl modules through CPAN and I don't know how to correct it:
[root#ip JESSE]# pwd
/root/.cpan/sources/authors/id/J/JE/JESSE
[root#ip JESSE]# ls -l
total 240
-rw-r--r-- 1 root root 105464 Feb 20 11:39 CHECKSUMS
-rw-r--r-- 1 root root 9223 Apr 12 2011 Locale-Maketext-Simple-0.21.tar.gz
-rw-r--r-- 1 root root 125483 Feb 20 11:39 WWW-Mechanize-1.72.tar.gz
[root#ip JESSE]# cpan -i WWW::Mechanize
CPAN: Storable loaded ok (v2.20)
Reading '/root/.cpan/Metadata'
Database was generated on Mon, 20 Feb 2012 11:10:26 GMT
Running install for module 'WWW::Mechanize'
Running make for J/JE/JESSE/WWW-Mechanize-1.72.tar.gz
CPAN: Digest::SHA loaded ok (v5.61)
CPAN: Compress::Zlib loaded ok (v2.033)
Checksum for /root/.cpan/sources/authors/id/J/JE/JESSE/WWW-Mechanize-1.72.tar.gz ok
CPAN: Archive::Tar loaded ok (v1.82)
Uncompressed /root/.cpan/sources/authors/id/J/JE/JESSE/WWW-Mechanize-1.72.tar.gz successfully
Using Tar:/bin/tar xvf "WWW-Mechanize-1.72.tar":
Couldn't untar WWW-Mechanize-1.72.tar
CPAN: File::Temp loaded ok (v0.22)
CPAN: CPAN::Meta loaded ok (v2.112150)
Package seems to come without Makefile.PL.
(The test -f "/root/.cpan/build/JESSE-n72IRU/Makefile.PL" returned false.)
Writing one on our own (setting NAME to WWWMechanize)
Had problems unarchiving. Please build manually
Running make test
Make had some problems, won't test
Running make install
Make had some problems, won't install
[root#ip JESSE]# ls -l
total 240
-rw-r--r-- 1 root root 105464 Feb 20 11:39 CHECKSUMS
-rw-r--r-- 1 root root 9223 Apr 12 2011 Locale-Maketext-Simple-0.21.tar.gz
-rw-r--r-- 1 root root 125483 Feb 20 11:39 WWW-Mechanize-1.72.tar.gz
[root#ip JESSE]# which tar
/bin/tar
[root#ip JESSE]# which gzip
/bin/gzip
The problem seems to be here:
Uncompressed /root/.cpan/sources/authors/id/J/JE/JESSE/WWW-Mechanize-1.72.tar.gz successfully
Using Tar:/bin/tar xvf "WWW-Mechanize-1.72.tar":
Couldn't untar WWW-Mechanize-1.72.tar
The tar.gz file is indeed uncompressed and can be found here in a new directory:
/root/.cpan/build/JESSE-KjCEMS/WWW-Mechanize-1.72.tar
If I run the same command from inside the shell, I get some more info:
cpan[1]> install WWW::Mechanize
CPAN: Storable loaded ok (v2.20)
Reading '/root/.cpan/Metadata'
Database was generated on Mon, 20 Feb 2012 11:10:26 GMT
Running install for module 'WWW::Mechanize'
Running make for J/JE/JESSE/WWW-Mechanize-1.72.tar.gz
CPAN: Digest::SHA loaded ok (v5.61)
CPAN: Compress::Zlib loaded ok (v2.033)
Checksum for /root/.cpan/sources/authors/id/J/JE/JESSE/WWW-Mechanize-1.72.tar.gz ok
Scanning cache /root/.cpan/build for sizes
Use of uninitialized value $newdir in substitution (s///) at /usr/lib64/perl5/Cwd.pm line 502.
Use of uninitialized value $newdir in chdir at /usr/lib64/perl5/Cwd.pm line 510.
Use of chdir('') or chdir(undef) as chdir() is deprecated at /usr/lib64/perl5/Cwd.pm line 510.
Use of uninitialized value $newdir in pattern match (m//) at /usr/lib64/perl5/Cwd.pm line 525.
Use of uninitialized value $newdir in split at /usr/lib64/perl5/Cwd.pm line 531.
..........................................................................--DONE
DEL(1/10): /root/.cpan/build/CPAN-1.9600-jGTV10
DEL(2/10): /root/.cpan/build/File-Which-1.09-yoVWZC
DEL(3/10): /root/.cpan/build/Test-Script-1.07-aJWrXb
DEL(4/10): /root/.cpan/build/Probe-Perl-0.01-gzZ2eR
DEL(5/10): /root/.cpan/build/IPC-Run3-0.044-AP6EMp
DEL(6/10): /root/.cpan/build/Time-HiRes-1.9721-xxseE6
DEL(7/10): /root/.cpan/build/CPAN-Meta-YAML-0.003-wGtH0a
DEL(8/10): /root/.cpan/build/JSON-PP-2.27105-fvkwNa
DEL(9/10): /root/.cpan/build/Package-Constants-0.02-7Ms_OL
DEL(10/10): /root/.cpan/build/Module-Metadata-1.000004-tXKIBB
CPAN: Archive::Tar loaded ok (v1.82)
Uncompressed /root/.cpan/sources/authors/id/J/JE/JESSE/WWW-Mechanize-1.72.tar.gz successfully
Using Tar:/bin/tar xvf "WWW-Mechanize-1.72.tar":
Couldn't untar WWW-Mechanize-1.72.tar
CPAN: File::Temp loaded ok (v0.22)
CPAN: CPAN::Meta loaded ok (v2.112150)
Package seems to come without Makefile.PL.
(The test -f "/root/.cpan/build/JESSE-DGrTh_/Makefile.PL" returned false.)
Writing one on our own (setting NAME to WWWMechanize)
Had problems unarchiving. Please build manually
Running make test
Make had some problems, won't test
Running make install
Make had some problems, won't install
Failed during this command:
JESSE/WWW-Mechanize-1.72.tar.gz : unwrapped NO -- untar failed
It seems to me that $newdir is not being updated with the dynamically generated /root/.cpan/build/JESSE-DGrTh_/ or /root/.cpan/build/JESSE-KjCEMS/ or whatever the system generates or at least that information is not getting to the tar command
Does anyone know how I can fix the mechanism without having to resort to a manual install ?
Edit:
I ran into this problem again. All I needed to do was free some memory like Keith Broughton suggested.
I ran into the same problem and tried to find the root cause for this problem. I'm listing my findings here so other Googlers don't have to spend a couple of hours before giving up...
What solved it for me was simply rebooting the system.
Things I tried:
Upgrading CPAN. This would also fail with the "Couldn't untar" error message. I doesn't matter if you try it using the cpan shell, "cpan -i CPAN" or "perl -MCPAN -e 'install CPAN'". I didn't think any of these would solve the problem, but when you start googling all these are suggested as possible solutions.
Replacing tar with a script that logs its input to check if one of the parameters or cwd is incorrect when it is called. The script is never called it seems. The "Couldn't untar" message is still the same, even after temporarily renaming /bin/tar.
Checking CPAN/Tarzip.pm and adding print lines near the code that writes the "Couldn't untar" message. It seems that the system() call fails and tar (or ls in my debug code) is never called.
Then I decided to reboot, which was an option because this is not a live system. After that the problem was gone and Perl modules installed on first try.
Other observations:
The system seems to work just fine for the rest. You can still connect to the system, you can edit files, modifications are still there after the reboot. I would expect any of these to fail long before a Perl system() call starts to fail.
A quick scan through the logfiles doesn't show any red flags.
Sometimes this can happen simply due to a lack of available memory. Try turning off some services that are running and try again.
Worked for me :-)
To resolve the following error:
Couldn't untar WWW-Mechanize-1.72.tar
Try install Archive::Tar
On centos 6.X:
yum install perl-Archive-Tar.x86_64
Found the same issue on DigitalOcean droplet with 512MB RAM running Ubuntu (with about 200MB free).
I was able to solve it by rebooting the machine, I tried updating my CPAN using 'install Bundle::CPAN'. It worked for the first few modules, and then the 'Couldn't untar' message appeared again.
Rebooting allowed me to progress in the installation. These repeated reboots are of course a less than optimal solution.
Given that the system has free memory, and the issue re-appears after using the machine for a little while, it seems to be this could be related to an issue with shared libraries.
Shot in the blue: partition is full. Delete some files.