Mattan
Mattan

Reputation: 753

Cannot install WWW::Mechanize Under proxy

OS: Linux. Perl Version: 5.16.0 (using Perlbrew).

I was trying to install Catalyst, and I got failed tests exactly as described in:

http://stevemoss.posterous.com/installing-wwwmechanize-and-testwwwmechanize

I am running under proxy in my workplace, I have set the http_proxy in ~/.cpan/CPAN/Config.pm and also set the no_proxy to each of the following with no success: 1. local host. 2. 127.0.0.1 (local host ip). 3. A known http server I have tested working without proxy. 4. Blank.

Here are the failed tests log, the last one doesn't even end, and it is stuck at 44/47:

rlbrew/perls/perl-5.16.0/bin/perl
# Test::Memory::Cycle 1.04 is installed.
t/00-load.t .............. ok   
t/add_header.t ........... ok   
t/aliases.t .............. ok   
t/area_link.t ............ ok   
t/autocheck.t ............ ok   
t/clone.t ................ ok   
t/content.t .............. ok   
t/cookies.t .............. # Test server http://127.0.0.1:22443 as PID 4655
t/cookies.t .............. ok     
t/credentials-api.t ...... Use of uninitialized value in lc at /perl5/perlbrew/perls/perl-5.16.0/lib/site_perl/5.16.0/LWP/UserAgent.pm line 605.
t/credentials-api.t ...... ok   
t/credentials.t .......... ok     
t/die.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 ..... 1/? There are 2 forms with the named fields.  The first one was used. at t/form_with_fields.t line 27.
t/form_with_fields.t ..... ok   
t/frames.t ............... ok   
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 ........... 44/47 

Upvotes: 1

Views: 269

Answers (3)

igelkott
igelkott

Reputation: 1287

For local/back.t (and several others tests), http_proxy is temporarily disabled. It's possible that you are suffering from a race condition where the temporary server (created in the test) isn't destroyed before http_proxy is reactivated.

Fortunately, no_proxy is not disabled during the tests and it should be able to fix the problem. Just make certain to set it to "localhost" rather than "local host", as you had written for option #1.

If that doesn't work, check that NO_PROXY is being configured correctly by temporarily setting it to an external site (and fail to reach it). Of course, taking away all mention of http_proxy is another option but that's sometimes awkward and should lead to other tests failing.

Upvotes: 1

innaM
innaM

Reputation: 47839

The problem here is obviously not that your CPAN clients fails to use the proxy correctly (it managed to download the package after all), but that the module you are installing either doesn't know about the proxy or isn't ready to handle a proxy.

If the module you are trying to install cannot handle, proxies, you're out of luck.

If it can, tell it to use your proxy by setting the relevant environment variable:

export http_proxy="http://your.proxy.goes.here"

Upvotes: 1

Miguel Prz
Miguel Prz

Reputation: 13792

it seems that are not important problems. You can force module install:

cpan -f -i WWW::Mechanize

Upvotes: 2

Related Questions