in reply to LWP error 500 read timeout "internal response"

After a look through the LWP::UserAgent source, it seems that "Client-Warning: Internal response" is something that it produces in various error conditions. I invoked it by mangling the URL in your code. In that case, print $response->as_string, "\n" gave me this:

501 Protocol scheme 'x' is not supported Content-Type: text/plain Client-Date: Thu, 17 May 2007 02:13:56 GMT Client-Warning: Internal response 501 Protocol scheme 'x' is not supported

So you might get a little more info from that or just status_line.

Replies are listed 'Best First'.
Re^2: LWP error 500 read timeout "internal response"
by cormanaz (Deacon) on May 17, 2007 at 03:09 UTC
    Here's the dumper of the response
    $VAR1 = bless( { '_content' => '500 read timeout ', '_rc' => 500, '_headers' => bless( { 'client-warning' => 'Internal +response', 'client-date' => 'Thu, 17 May +2007 11:06:00 GMT', 'content-type' => 'text/plain' }, 'HTTP::Headers' ), '_msg' => 'read timeout', '_request' => bless( { '_content' => '', '_uri' => bless( do{\(my $o = +'http://www.perlmonks.com')}, 'URI::http' ), '_headers' => bless( { 'user-a +gent' => 'libwww-perl/5.805' }, 'HTTP: +:Headers' ), '_method' => 'GET' }, 'HTTP::Request' ) }, 'HTTP::Response' );

      A "read timeout" is just a regular timeout. You could try changing your "$user_agent->timeout(30)" to "$user_agent->timeout(300)" or something and see if that helps. Either your network is slow (or failed) or the site is not responding fast enough.

        It's not a real timeout because the response comes back instantly. But I tried it anyway and same result.

      hmmm ... how come the uri from the response object doesn't match the request_url from the OP?

      -derby
        Sorry...my bad. I shortened the URL on later tests.