in reply to ftp problem on cpan client on windows with strawberry perl

LWP failed with code[500] message[]

It seems that Perl cannot reach the outside world, maybe because you are behind a proxy. Set the environment variable HTTP_PROXY to the appropriate value. For example, I have

HTTP_PROXYX=http://corion:secret@myproxy.internal.example:8080

Replies are listed 'Best First'.
Re^2: ftp problem on cpan client on windows with strawberry perl
by Marshall (Canon) on May 28, 2009 at 11:42 UTC
    Corion's idea is a great one.

    The code 500 means server terminated the connection. Just as another diagnostic test, without using Perl or perl -MCPAN, just use FTP to see if you can download the file. If you type>ftp ftp.perl.org, you should get a response. The user name is "anonymous" and the password is just a carriage return. Then do a "dir" and you will get a response. If you can get this far, then the proxy is not the problem. If you can't get this far, then some kind of firewall/proxy issue is in play, but you have simplified the question for your sys admin and have taken Perl completely out of the equation.

      doing a dir says
      Connected to ftp.cpan.ddns.develooper.com. User (ftp.cpan.ddns.develooper.com:(none)): anonymous 331 PASSCODE: you can use password@PASSCODE Password: 200 PASSCODE: you can use 'quote PASSCODE' or Account command ('ACCT') ftp> dir 421-SecurID internal error 421 aborted Connection closed by remote host. ftp>
      does it mean that surely it is some proxy or firewall issue.
      i have got a proxy file .pac file through which firefox connnects outside and from that I have seen what is the relevant proxy server I can use and I used that and the HTTP_PROXY variable, still i am unable to connect outside.
      I know that it has become a non-perl issue, but any help is appreciated

      Vivek
      -- In accordance with the prarabdha of each, the One whose function it is to ordain makes each to act. What will not happen will never happen, whatever effort one may put forth. And what will happen will not fail to happen, however much one may seek to prevent it. This is certain. The part of wisdom therefore is to stay quiet.

        ...intriguing.

        from a w32 box outside firewall, no proxy: a variant outcome:

        C:\>ftp ftp.perl.org Connected to ftp.cpan.ddns.develooper.com. 220---------- Welcome to Pure-FTPd ---------- 220-You are user number 4 of 512 allowed. 220-Local time is now 08:12. Server port: 21. 220-Only anonymous FTP is allowed here 220-IPv6 connections are also welcome on this server. 220 You will be disconnected after 15 minutes of inactivity. User (ftp.cpan.ddns.develooper.com:(none)): 230 Anonymous user logged in ftp> cd pub # 250 OK. Current directory is /pub ftp> ls # dir also OK 200 PORT command successful 150 Connecting to port 1548 CPAN FreeBSD OpenBSD WM analog apache exim fedora gimp gnu isc mysql openssl postfix proftpd proftpd-www python qmail sendmail squid vim webalizer webalizer-www xemacs xemacs-www 226 25 matches total ftp: 204 bytes received in 0.02Seconds 12.75Kbytes/sec. ftp> quit 221-Goodbye. You uploaded 0 and downloaded 0 kbytes. 221 Logout. C:\>

        But, same box, the very next iteration gets Welcome to viaVerio's San Jose, CA, USA CPAN FTP server! with a different organization of /pub and different content.

        Hi, what does your urllist look like?
        cpan o conf urllist
        maybe setting up some http:// sources could help?

        Cheers, Christoph
        Corion's example shows how to put proxy authentication into the HTTP_PROXY settings.
        HTTP_PROXY=http:/user:password@proxy:port
        The issue we have and may apply to you is that our proxy picks up the authentication from the O/S via some sort of domain setting. This means that apps on Windows can (sometimes) pass the proxy without further problems but on our Unix boxes and some W32 apps manual authentication is needed and with password changes that can make setting HTTP_PROXY interesting.

        We had to get security to allow a selection of our servers access to CPAN sites direct without the proxy.

        Also you can set FTP_PROXY as we have found that that can help. Also http_proxy and ftp_proxy. We set them all to the same value as HTTP_PROXY by setting HTTP_PROXY and then setting the others all to HTTP_PROXY. This is on Unix, Wintel may be different.

        HTTP_PROXY=http://proxy:port FTP_PROXY=$HTTP_PROXY http_proxy=$HTTP_PROXY ftp_proxy=$HTTP_PROXY
        Ok, first thing is that we get test cases straight so that we are talking apples to apples! I tested with this site:
        ftp://ftp.perl.org/pub/CPAN/authors/01mailrc.txt.gz

        You should even be able to cut'n-paste that exact thing into your web browser and get a response.

        When you change the test URL case to ftp.cpan.ddns.develooper.com that can change things. When I saw this, I thought hey, there is an extra "o" in developer, but no, this a valid URL! And this URL works in FireFox and I even tested with IE.

        update: I see that you have tested this. well this is a firewall / proxy deal.