Re: Request Post error useragent.pm line 227

Robert (robert@chalmers.com.au)
Thu, 25 Jan 2001 08:30:21 +1000


I had exactly the same error the other day. Took me a week to find it. . I
tracked it down to a conflict with the encryption method DES. (Crypt::DES) I
switched to "Blowfish" and the error went away.


bob
> I am (occasionally) receiving this error:
> [23/Jan/2001:15:57:47] failure (10907): for host
>  158.###.###.117 trying to POST /cgi-bin/test/paycc.cgi,
>  cgieng_scan_headers reports: the CGI program
>  /usr/netscape/server4/cgi-bin/test/paycc.cgi did not
>  produce a valid header (name without value: got line
>  "can't call method "request" on an undefined value at
>  /usr/local/lib/perl5/site_perl/5.6.0/lwp/useragent.pm
>  line 227.")
>
> in my httpd log when performing:
>
>    use HTTP::Request::Common qw(POST);
>    use LWP::UserAgent;
>    $ua = LWP::UserAgent->new;
>
>    my $req = POST "https:\/\/$cc_gateway_host$script",
>    [   'x_Login'           => $cc_merchantID
>       ,'x_Test_Request'    => $cc_test_mode
> ...
>       ,'x_Description'     => $pay_xact_desc
>    ];
>    $response = $ua->request($req)->as_string;
>
> To call a credit card processor within the CGI script for
> my web pages.  It works ok 80% of the time.
>
> The really strange thing is that the CC processor does react
> to my request (the transaction is processed perfectly)
> but the error kills my CGI so user sees an incomplete page.
>
> Does anyone have any insight into this problem?  Could some
> error trap on my "$response = $ua->request($req)->as_string;"
> statement allow me to recover from the error?
> Or could I copy UserAgent.pm into my directory and attempt to
> debug it?
>
> # $Id: UserAgent.pm,v 1.73 2000/04/07 11:29:04 gisle Exp $
> # $Id: Request.pm,v 1.27 1999/11/17 20:38:14 gisle Exp $
> # $Id: Common.pm,v 1.16 1999/10/28 11:49:02 gisle Exp $
>
> bash-2.03$ perl -V
> Summary of my perl5 (revision 5.0 version 6 subversion 0)
> configuration:
>   Platform:
>     osname=solaris, osvers=2.8, archname=sun4-solaris
>     uname='sunos chaos 5.8 generic_108528-02 sun4u sparc
> sunw,ultra-5_10 '
>     config_args='-de'
> ...
>     cc='cc', optimize='-O', gccversion=2.95.2 19991024 (release)
> ...
> Characteristics of this binary (from libperl):
>   Compile-time options: USE_LARGE_FILES
>   Built under solaris
>   Compiled at Nov  7 2000 11:33:38
>   @INC:
>     /usr/local/lib/perl5/5.6.0/sun4-solaris
>     /usr/local/lib/perl5/5.6.0
>     /usr/local/lib/perl5/site_perl/5.6.0/sun4-solaris
>     /usr/local/lib/perl5/site_perl/5.6.0
>     /usr/local/lib/perl5/site_perl
>
> -- tia
> John Gerrish     RMS3 Application Manager     907-465-8861    fax:2024
>                  Alaska Marine Highway System, DOT/PF, State of Alaska
>                  3132 Channel Dr, Juneau, AK  99801
> Blessed are the flexible for they shall not be bent out of shape.
>