Good day Bros. So I am trying to port a script from windoze (that works fine there) to Linux. It runs a Google search and gets the results using LWP. When I run it, I immediately get a response with response code 500, response msg "read timeout," and a response header with key "client-warning" with value "Internal Response." This seems to have something to do with the request url I am sending because I get the same thing when I try to access the Perlmonks seekers page, i.e. this
use LWP::UserAgent; my $request_url = 'http://perlmonks.com'; my $user_agent = LWP::UserAgent->new; $user_agent->timeout(30); my $request = HTTP::Request->new('GET', $request_url); my $response = $user_agent->request($request);
generates the same error. Anyone know what's going on? I googled it and super searched it and the only other reports I saw with this error seem to involve LPW::UserAgent::Parallel, which I'm not using.

TIA...

Steve

UPDATE

Eureka! All along I had been running the code in ActiveState Komodo IDE 4.0. I finally took to stepping though the code with its debugger. I narrowed the problem down to line 313 of http.pm, which leads to a socket read on line 232 of Methods.pm, which calls sub sysread in line 382 of http.pm. If I stepped through the code slowly it would return a valid read on perlmonks.com, but if I set breakpoints on line 313 and on sub sysread and hit continue to go between them, I would get the error. Since there seemed to be an interaction between debugger actions and the error, I tried it from the command line and it worked. I guess there was some kind of bad interaction between Komodo and the perl interpreter.

Why this error occurs for perlmonks but not google is a mystery to me, but there you have it. I am going to put in a bug report on Komod and go my merry way.

Thanks for all your suggestions.

Steve


In reply to LWP error 500 read timeout "internal response" by cormanaz

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.