Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic
 
PerlMonks  

What means this Unfamiliar WWW::Mech error message, please?

by hesco (Deacon)
on Aug 27, 2009 at 03:15 UTC ( [id://791512]=perlquestion: print w/replies, xml ) Need Help??

hesco has asked for the wisdom of the Perl Monks concerning the following question:

This code:

#!/perl -T use strict; use warnings; use WWW::Mechanize; my $agent = WWW::Mechanize->new(); my $baseurl = 'http://sd.reclaimedcomputers.com/'; my $authenticate = 'sd/agent/authentication/sd'; my $args = '?sd_username=admin&sd_password=canttellyou&CallerID=770250 +5192&Extension=21'; my $url = $baseurl . $authenticate . $args; $agent->get( $url );
is throwing this error:

Error GETing http://sd.reclaimedcomputers.com/sd/agent/authentication/ +sd?sd_username=admin&sd_password=canttellyou&CallerID=7702505192&Exte +nsion=21: Not Found at t/99-test_remotely.t line 28
This script (hitting that url) works just fine from my sandbox, but when I run it on to the development server which hosts this domain, it complains to me as described above. On that server, /etc/hosts includes:

127.0.0.1 sd.reclaimedcomputers.com
and DNS knows that the domain points to the CNAME for my development server, or at least the IP for the router on the edge of its network (which is port-forwarding the requests in to the network, judging from tests from remote boxes).

SuperSearch says nothing, google nothing useful (at least on the first couple of pages of results). I've never seen this error before and can find nothing about it perldoc for either WWW::Mechanize nor that for LWP.

Digging through the code it seems to come from $mech->_update_page(), which includes this:

if ( $res->is_error ) { if ( $self->{autocheck} ) { $self->die( 'Error ', $request->method, 'ing ', $request-> +uri, ': ', $res->message ); } }
So as for my questions: What is this about? What does it mean? Why doesn't this work when run on the development server? What's it all about? Is this just a game we play?

Well those last two may be perhaps beyond the scope of this forum, but any ideas on the former three would certainly be appreciated.

-- Hugh

UPDATE:

My appreciation to the Anonymous Monk who pointed out the debug options I had sought but missed. (I'd urge the maintainer of LWP and perhaps even WWW::Mechanize to include that references in the 'See also' section of their perldoc).

And my appreciation as well to ikegami, who pointed out the 404 error before the debug output could. This issue was very easily resolved by replicating a stanza in my apache configuration so that my sd. subdomain got answered at 127.0.0.1, in addition to its external private IP.

if( $lal && $lol ) { $life++; }
if( $insurance->rationing() ) { $people->die(); }

Replies are listed 'Best First'.
Re: What means this Unfamiliar WWW::Mech error message, please?
by ikegami (Patriarch) on Aug 27, 2009 at 06:39 UTC
    It's not a problem connecting to the server. The server returned a 404 (Not Found) error.
Re: What means this Unfamiliar WWW::Mech error message, please?
by Anonymous Monk on Aug 27, 2009 at 03:24 UTC
    Hey, turn on debugging and make sure you have the latest LWP/WWW::Mechanize :)
    $hesco{ice}++
      Well I bumped my copy of WWW::Mech from 1.50 (I think it was) to 1.60. (Still running 1.58 on my sandbox machine). Reran the tests and got the same error. Before I wrote to SoPW, I had searched the perldoc for both the WWW::Mech and LWP modules for a debug option; but to no avail. Can you clue me in please on how to set such an animal?

      -- Hugh

      if( $lal && $lol ) { $life++; }
      if( $insurance->rationing() ) { $people->die(); }
        see LWP::Debug
        $ua->add_handler("request_send", sub { shift->dump; return }); $ua->add_handler("response_done", sub { shift->dump; return });

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others learning in the Monastery: (6)
As of 2024-04-20 00:11 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found