2

I'm trying to work out why a Perl module won't install on my server.

cpanm WWW::Mechanize

It processes stuff for ages, and then eventually dies with:

root@admin:~# cpanm WWW::Mechanize
--> Working on WWW::Mechanize
Fetching http://www.cpan.org/authors/id/O/OA/OALDERS/WWW-Mechanize-1.90.tar.gz ... OK
Configuring WWW-Mechanize-1.90 ... OK
Building and testing WWW-Mechanize-1.90 ... FAIL
! Installing WWW::Mechanize failed. See /root/.cpanm/work/1543994046.20570/build.log for details. Retry with --force to force install it.

The log file has stuff like this in:

t/00-report-prereqs.t .................... ok
t/add_header.t ........................... ok
t/aliases.t .............................. ok
t/area_link.t ............................ ok
t/autocheck.t ............................ ok
t/bad-request.t .......................... ok
t/clone.t ................................ ok
t/content.t .............................. ok
# Test server http://127.0.0.1:31546 as PID 20661
t/cookies.t .............................. ok
t/credentials-api.t ...................... ok
t/credentials.t .......................... ok
t/die.t .................................. ok
t/dump.t ................................. ok
t/field.t ................................ ok
t/find_frame.t ........................... ok
t/find_image.t ........................... ok
t/find_inputs.t .......................... ok
t/find_link-warnings.t ................... ok
t/find_link.t ............................ ok
t/find_link_id.t ......................... ok
t/form-parsing.t ......................... ok
t/form_with_fields.t ..................... ok
t/form_with_fields_passthrough_params.t .. ok
t/frames.t ............................... ok

#   Failed test '... and it was recorded in the history'
#   at t/history.t line 131.
#          got: '3'
#     expected: '2'
# Looks like you failed 1 test of 28.
t/history.t .............................. 
Dubious, test returned 1 (wstat 256, 0x100)
Failed 1/28 subtests 
t/image-new.t ............................ ok
t/image-parse.t .......................... ok
t/link-base.t ............................ ok
t/link-relative.t ........................ ok
t/link.t ................................. ok
t/local/back.t ........................... ok
t/local/click.t .......................... ok
t/local/click_button.t ................... ok
# Running tests against http://127.0.0.1:50871/?xml=1
t/local/content.t ........................ ok
t/local/encoding.t ....................... ok
t/local/failure.t ........................ ok
t/local/follow.t ......................... ok
t/local/form.t ........................... ok
t/local/get.t ............................ ok
t/local/nonascii.t ....................... ok
t/local/overload.t ....................... skipped: Mysteriously stopped passing, and I don't know why.
t/local/page_stack.t ..................... ok
t/local/post.t ........................... ok
t/local/referer.t ........................ ok
t/local/reload.t ......................... ok
t/local/submit.t ......................... ok
t/mech-dump/mech-dump.t .................. ok
t/new.t .................................. ok
t/regex-error.t .......................... ok
t/save_content.t ......................... ok
t/select.t ............................... ok
t/taint.t ................................ skipped: Test::Taint required for checking taintedness
t/tick.t ................................. ok
t/untaint.t .............................. ok
t/upload.t ............................... ok
t/uri.t .................................. ok
t/warn.t ................................. ok
t/warnings.t ............................. ok

Test Summary Report
-------------------
t/history.t                            (Wstat: 256 Tests: 28 Failed: 1)
  Failed test:  23
  Non-zero exit status: 1
Files=59, Tests=752, 1241 wallclock secs ( 0.29 usr  0.08 sys + 11.13 cusr  1.60 csys = 13.10 CPU)
Result: FAIL
Failed 1/59 test programs. 1/752 subtests failed.
Makefile:946: recipe for target 'test_dynamic' failed
make: *** [test_dynamic] Error 255
-> FAIL Installing WWW::Mechanize failed. See /root/.cpanm/work/1543994046.20570/build.log for details. Retry with --force to force install it.

I see this in there, but I'm unsure what it means:

#   Failed test '... and it was recorded in the history'
#   at t/history.t line 131.
#          got: '3'
#     expected: '2'
# Looks like you failed 1 test of 28.
t/history.t .............................. 
Dubious, test returned 1 (wstat 256, 0x100)
Failed 1/28 subtests 

Any suggestions? I need this module for another module I'm trying to install :/

  • Can you run the verbose test and add the output? – choroba Dec 5 '18 at 8:42
  • Is WWW::Mechanize version provided in Ubuntu repositories (1.75) too old? – AnFi Dec 5 '18 at 9:13
  • 1
    Don't get anything from CPAN if it's already packaged for your distro and you don't absolutely need a newer version. – Michael Hampton Dec 5 '18 at 19:56
  • 2
    Not sure about Debian/Ubuntu. On Red Hat based systems you can simply query yum whatprovides 'perl(WWW::Mechanize)' and it will tell you which package to install. – Michael Hampton Dec 6 '18 at 14:50
  • 1
    Well, you can always get rid of Ubuntu :) – Michael Hampton Dec 7 '18 at 14:38
7

Perl CPAN packages installed as Linux distribution packages [Debian/Ubuntu]

Install perl packages as your Linux distribution packages if possible.

It is possible for WWW::Mechanize on Ubuntu (and other Debian family distributions):

Ubuntu – Details of package libwww-mechanize-perl in xenial
Package: libwww-mechanize-perl (1.75-1)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.