Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight
 
PerlMonks  

Re: cpan & strawberry perl errors

by Corion (Patriarch)
on Dec 30, 2014 at 14:18 UTC ( [id://1111723]=note: print w/replies, xml ) Need Help??


in reply to cpan & strawberry perl errors

Your browser has a proxy set, or better network connectivity, than Perl.

Inspect your browser network settings closely (likely, the "Network" tab), and configure LWP appropriately. Most likely by setting $ENV{HTTP_PROXY} and $ENV{HTTPS_PROXY}, preferrably even before your Perl process starts. Especially for HTTPS, OpenSSL / SSLeay like to have first grab at these variables.

Replies are listed 'Best First'.
Re^2: cpan & strawberry perl errors
by BrowserUk (Patriarch) on Dec 30, 2014 at 14:51 UTC

    As you can see, the LWP failing url works fine in my browser and it has no proxies configured.

    Nor do I have any proxies set in my environment:

    C:\test>set proc PROCESSOR_ARCHITECTURE=x86 PROCESSOR_ARCHITEW6432=AMD64 PROCESSOR_IDENTIFIER=Intel64 Family 6 Model 15 Stepping 11, GenuineInt +el PROCESSOR_LEVEL=6 PROCESSOR_REVISION=0f0b C:\test>set http Environment variable http not defined

    The weird thing is that the same urls that fail (instantly and multiple times) will subsequently succeed occasionally. But in my browser, they always succeed.


    With the rise and rise of 'Social' network sites: 'Computers are making people easier to use everyday'
    Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
    "Science is about questioning the status quo. Questioning authority".
    In the absence of evidence, opinion is indistinguishable from prejudice.

      I would use WireShark to find out what is happening on the network layer. As your browser knows how to connect, but Perl doesn't, something in their behaviour is different. Maybe using WireShark, you can find out how their behaviour differs.

      I think you've mentioned using Opera, and I also remember that Opera (Mini) has a Turbo Mode, where it uses an Opera-operated proxy. This might not show up in your general proxy settings.

      Also consider whether Opera gets a different IP address for search.cpan.org than what Perl gets - Perl might end up with an unavailable mirror (sometimes) while Opera might be lucky due to longer DNS caching within the browser (instead of relying on the OS to provide "current" DNS).

        I think you've mentioned using Opera, and I also remember that Opera (Mini) has a Turbo Mode, where it uses an Opera-operated proxy.

        I never use Turbo mode.

        Also consider whether Opera gets a different IP address for search.cpan.org than what Perl gets - Perl might end up with an unavailable mirror (sometimes) while Opera might be lucky due to longer DNS caching within the browser (instead of relying on the OS to provide "current" DNS).

        Tracking through using TCPView, both LWP and Opera are resolving cpan.strawberryPerl.com:80 to 69.163.152.144, but with LWP the server responds with http error code 500:

        Fetching with LWP: http://cpan.strawberryperl.com/modules/03modlist.data.gz LWP failed with code[500] message[Can't connect to cpan.strawberryperl +.com:80]

        So then I discovered I could configure cpan to fall back to wget, and it resolves (presumably the same way as LWP) to the same address, and the fetch immediately works every time:

        Running install for module 'Test::Number::Delta' Fetching with LWP: http://cpan.strawberryperl.com/authors/id/D/DA/DAGOLDEN/Test-Number-De +lta-1.06.tar.gz LWP failed with code[500] message[Can't connect to cpan.strawberryperl +.com:80] Trying with c:/perl64/bin/wget.exe -O "C:\Perl5.18\cpan\sources\authors\id\D\D +A\DAGOLDEN\Test-Number-Delta-1.06.tar.gz.tmp11488" to get http://cpan.strawberryperl.com/authors/id/D/DA/DAGOLDEN/Test-Numbe +r-Delta-1.06.tar.gz --2014-12-30 18:03:48-- http://cpan.strawberryperl.com/authors/id/D/D +A/DAGOLDEN/Test-Number-Delta-1.06.tar.gz Resolving cpan.strawberryperl.com... 69.163.152.144 Connecting to cpan.strawberryperl.com|69.163.152.144|:80... connected. HTTP request sent, awaiting response... 302 Found Location: http://cpan.pair.com/authors/id/D/DA/DAGOLDEN/Test-Number-De +lta-1.06.tar.gz [following] --2014-12-30 18:03:48-- http://cpan.pair.com/authors/id/D/DA/DAGOLDEN +/Test-Number-Delta-1.06.tar.gz Resolving cpan.pair.com... 66.39.76.93 Connecting to cpan.pair.com|66.39.76.93|:80... connected. HTTP request sent, awaiting response... 200 OK Length: 21077 (21K) [application/x-gzip] Saving to: `C:/Perl5.18/cpan/sources/authors/id/D/DA/DAGOLDEN/Test-Num +ber-Delta-1.06.tar.gz.tmp11488' 100%[================================================================= +>] 21,077 51.2K/s in 0.4s 2014-12-30 18:03:49 (51.2 KB/s) - `C:/Perl5.18/cpan/sources/authors/id +/D/DA/DAGOLDEN/Test-Number-Delta-1.06.tar.gz.tmp11488' saved [21077/2 +1077]

        What appears to be happening, is that LWP is reporting the 302 Found redirection to cpan.pair.com as a 500 message?

        Anyway, configuring cpan to use wget means it eventually gets everything required; and popping two of three cpan.pair.com entries from the (default) urllist reduces the noise somewhat.

        If anyone has any further suggestions, I'm all ears.


        With the rise and rise of 'Social' network sites: 'Computers are making people easier to use everyday'
        Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
        "Science is about questioning the status quo. Questioning authority".
        In the absence of evidence, opinion is indistinguishable from prejudice.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others pondering the Monastery: (4)
As of 2024-03-28 18:30 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found