Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much
 
PerlMonks  

problems installing WWW::Mechanize::PhantomJS

by Special_K (Monk)
on Jul 06, 2014 at 20:28 UTC ( [id://1092499]=perlquestion: print w/replies, xml ) Need Help??

Special_K has asked for the wisdom of the Perl Monks concerning the following question:

I am trying to install WWW::Mechanize::PhantomJS and am having some problems. Here is the top level build output and error message:



> cpanm WWW::Mechanize::PhantomJS --> Working on WWW::Mechanize::PhantomJS Fetching http://www.cpan.org/authors/id/C/CO/CORION/WWW-Mechanize-Phan +tomJS-0.03.tar.gz ... OK Configuring WWW-Mechanize-PhantomJS-0.03 ... OK ==> Found dependencies: Selenium::Remote::Driver --> Working on Selenium::Remote::Driver Fetching http://www.cpan.org/authors/id/G/GE/GEMPESAW/Selenium-Remote- +Driver-0.2002.tar.gz ... OK Configuring Selenium-Remote-Driver-0.2002 ... OK ==> Found dependencies: LWP::Protocol::PSGI --> Working on LWP::Protocol::PSGI Fetching http://www.cpan.org/authors/id/M/MI/MIYAGAWA/LWP-Protocol-PSG +I-0.07.tar.gz ... OK Configuring LWP-Protocol-PSGI-0.07 ... OK ==> Found dependencies: HTTP::Message::PSGI --> Working on HTTP::Message::PSGI Fetching http://www.cpan.org/authors/id/M/MI/MIYAGAWA/Plack-1.0030.tar +.gz ... OK Configuring Plack-1.0030 ... OK ==> Found dependencies: Test::TCP --> Working on Test::TCP Fetching http://www.cpan.org/authors/id/T/TO/TOKUHIROM/Test-TCP-2.06.t +ar.gz ... OK Configuring Test-TCP-2.06 ... OK Building and testing Test-TCP-2.06 ... FAIL ! Timed out (> 1800s). Use --verbose to retry. ! Installing Test::TCP failed. See /home/user1/.cpanm/work/1404664893. +6244/build.log for details. Retry with --force to force install it. ! Installing the dependencies failed: Module 'Test::TCP' is not instal +led ! Bailing out the installation for Plack-1.0030. ! Installing the dependencies failed: Module 'HTTP::Message::PSGI' is +not installed ! Bailing out the installation for LWP-Protocol-PSGI-0.07. ! Installing the dependencies failed: Module 'LWP::Protocol::PSGI' is +not installed ! Bailing out the installation for Selenium-Remote-Driver-0.2002. ! Installing the dependencies failed: Module 'Selenium::Remote::Driver +' is not installed ! Bailing out the installation for WWW-Mechanize-PhantomJS-0.03.


Here are some excerpts from the build log for Test-TCP, the build log referenced above:



Configuring WWW-Mechanize-PhantomJS-0.03 Running Makefile.PL (Re)Creating lib/WWW/Mechanize/PhantomJS/Examples.pm Can't locate Selenium/Remote/Driver.pm in @INC (@INC contains: /usr/li +b/perl5/site_perl/5.14/i686-cygwin-threads-64int /usr/lib/perl5/site_ +perl/5.14 /usr/lib/perl5/vendor_perl/5.14/i686-cygwin-threads-64int / +usr/lib/perl5/vendor_perl/5.14 /usr/lib/perl5/5.14/i686-cygwin-thread +s-64int /usr/lib/perl5/5.14 /usr/lib/perl5/site_perl/5.10 /usr/lib/pe +rl5/vendor_perl/5.10 /usr/lib/perl5/site_perl/5.8 . lib) at ./example +s/../lib/WWW/Mechanize/PhantomJS.pm line 3. BEGIN failed--compilation aborted at ./examples/../lib/WWW/Mechanize/P +hantomJS.pm line 3. Compilation failed in require at examples/gen_examples_pod.pl line 32. Warning: prerequisite Selenium::Remote::Driver 0.18 not found. Checking if your kit is complete... Looks good


Building and testing Test-TCP-2.06 cp lib/Test/TCP/CheckPort.pm blib/lib/Test/TCP/CheckPort.pm cp lib/Net/EmptyPort.pm blib/lib/Net/EmptyPort.pm cp lib/Test/TCP.pm blib/lib/Test/TCP.pm Manifying blib/man3/Net.EmptyPort.3pm Manifying blib/man3/Test.TCP.3pm Manifying blib/man3/Test.TCP.CheckPort.3pm PERL_DL_NONLAZY=1 /usr/bin/perl.exe "-MExtUtils::Command::MM" "-MTest: +:Harness" "-e" "undef *Test::Harness::Switches; test_harness(0, 'blib +/lib', 'blib/arch')" t/*.t # Test::More: 0.98 t/00_compile.t ................. ok -> FAIL Timed out (> 1800s). Use --verbose to retry. Makefile:854: recipe for target 'test_dynamic' failed make: *** [test_dynamic] Terminated -> FAIL Installing Test::TCP failed.


At this point, installation of all modules up the dependency tree fail, and the original call to install WWW::Mechanize::PhantomJS fails.

Is the original failure of Selenium::Remote::Driver a problem, or is it just the Test::TCP? How do I debug this?

Replies are listed 'Best First'.
Re: problems installing WWW::Mechanize::PhantomJS
by Corion (Patriarch) on Jul 07, 2014 at 07:00 UTC

    I think it's Test::TCP that is broken on Windows. It relies on fork(), and I don't think that sockets and fork() play well under plain Win32. You seem to be using Cygwin, so maybe the problem lies elsewhere, but maybe the problems extend from plain Win32 to Cygwin as well.

    My approach to debugging this would be to run the Test::TCP tests in isolation:

    > cpanm --look Test::TCP C:\...Test-TCP> perl Makefile.PL C:\...Test-TCP> make test C:\...Test-TCP> perl -Ilib t\test-that-hung-or-failed.t ... debug the test C:\...Test-TCP> make install

      I followed your instructions and here is the result:



      perl Makefile.PL cp META.json MYMETA.json cp META.yml MYMETA.yml Checking if your kit is complete... Looks good Generating a Unix-style Makefile Writing Makefile for Test::TCP /home/user/.cpanm/work/1404793946.7456/Test-TCP-2.06[102]> make test cp lib/Test/TCP/CheckPort.pm blib/lib/Test/TCP/CheckPort.pm cp lib/Net/EmptyPort.pm blib/lib/Net/EmptyPort.pm cp lib/Test/TCP.pm blib/lib/Test/TCP.pm PERL_DL_NONLAZY=1 /usr/bin/perl.exe "-MExtUtils::Command::MM" "-MTest: +:Harness" "-e" "undef *Test::Harness::Switches; test_harness(0, 'blib +/lib', 'blib/arch')" t/*.t t/00_compile.t ................. 1/1 # Test::More: 0.98 t/00_compile.t ................. ok t/01_simple.t .................. empty port not found at /home/user/.c +panm/work/1404793946.7456/Test-TCP-2.06/blib/lib/Net/EmptyPort.pm lin +e 37. # Looks like your test exited with 255 before it could output anything +. t/01_simple.t .................. Dubious, test returned 255 (wstat 652 +80, 0xff00) Failed 22/22 subtests t/02_abrt.t .................... empty port not found at /home/user/.c +panm/work/1404793946.7456/Test-TCP-2.06/blib/lib/Net/EmptyPort.pm lin +e 37. # Looks like your test exited with 255 before it could output anything +. t/02_abrt.t .................... Dubious, test returned 255 (wstat 652 +80, 0xff00) Failed 2/2 subtests t/03_return_when_sigterm.t ..... empty port not found at /home/user/.c +panm/work/1404793946.7456/Test-TCP-2.06/blib/lib/Net/EmptyPort.pm lin +e 37. # Looks like your test exited with 255 before it could output anything +. t/03_return_when_sigterm.t ..... Dubious, test returned 255 (wstat 652 +80, 0xff00) Failed 2/2 subtests t/04_die.t ..................... 1/3 # Failed test at t/04_die.t line 25. # 'empty port not found at /home/user/.cpanm/work/14 +04793946.7456/Test-TCP-2.06/blib/lib/Net/EmptyPort.pm line 37. # ' # doesn't match '(?^:sinamon)' Can't kill a non-numeric process ID at t/04_die.t line 26. # Looks like you planned 3 tests but ran 2. # Looks like you failed 1 test of 2 run. # Looks like your test exited with 255 just after 2. t/04_die.t ..................... Dubious, test returned 255 (wstat 652 +80, 0xff00) Failed 2/3 subtests t/05_sigint.t .................. 1/2 # $Config{sig_name}: ZERO HUP INT + QUIT ILL TRAP ABRT EMT FPE KILL BUS SEGV SYS PIPE ALRM TERM URG STOP + TSTP CONT CHLD TTIN TTOU IO XCPU XFSZ VTALRM PROF WINCH LOST USR1 US +R2 RTMAX CLD POLL PWR RTMIN # CHILD_ERROR_NATIVE: 2 # $?: 2 t/05_sigint.t .................. ok t/06_nest.t .................... empty port not found at /home/user/.c +panm/work/1404793946.7456/Test-TCP-2.06/blib/lib/Net/EmptyPort.pm lin +e 37. # Looks like your test exited with 255 before it could output anything +. t/06_nest.t .................... Dubious, test returned 255 (wstat 652 +80, 0xff00) Failed 1/1 subtests t/07_optional.t ................ ok t/08_exit.t ....................


      I'm seeing a lot of "empty port not found" messages. Do you know what the problem could be?

        I'm seeing a lot of "empty port not found" messages. Do you know what the problem could be?

        Maybe you have some kind of firewall running? Maybe you need to run this test as root due to too-low port number or some such :/

Re: problems installing WWW::Mechanize::PhantomJS
by bojinlund (Monsignor) on Jul 07, 2014 at 07:15 UTC

      I read that thread and the other links it contains, but all I see is an acknowledgement of problems with no official solutions. Or did I miss something?

      Let me ask a different question: I have had problems installing perl modules from CPAN before, and occasionally the "solution" is to do a force install because the test itself is either broken or isn't testing for something that really matters in the context in which the module is used. Could that be the case here? If I force install Test::TCP given my current build failures will WWW::Mechanize::PhantomJS still work?

        Test::TCP is a module for testing TCP connections. WWW::Mechanize::PhantomJS does not use Test::TCP, so the two are not interrelated. I think Test::TCP is pulled in by LWP::Protocol::PSGI for self-testing.

        There may be problems with your setup that prevent Test::TCP from passing its test suite that may also prevent WWW::Mechanize::PhantomJS from working, but they are not apparent to me.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlquestion [id://1092499]
Approved by AppleFritter
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others browsing the Monastery: (4)
As of 2024-04-24 06:43 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found