Re: Apache::DBI - consistently encountering about a .00667% error rate
"Randolf Richardson" <[email protected]> Fri, 22 Nov 2024 07:26:38 -0800
| Newsgroups | gmane.comp.apache.mod-perl |
|---|---|
| Organization | Inter-Corporate Computer & Network Services |
| Message-ID | <[email protected]> |
I've been away for a while, so I'm sorry if this reply is coming too late, but if not then hopefully it helps... Can you try changing the call to prepare() to prepare_cached() and try again? Also, I noticed that in the startup.pl script you included earlier that there's no "use strict;" line. Are you using this in the other scripts in which your users are encountering the HTTP 500 error? > Thanks Perrin. > > The "end user" is getting the following: > > HTTP/1.1 500 Internal Server Error > Date: Tue, 08 Oct 2024 20:17:24 GMT > Server: Apache/2.4.57 (AlmaLinux) OpenSSL/3.0.7 mod_perl/2.0.12 Perl/v5.= 32.1 > Content-Length: 333 > Connection: close > Content-Type: text/html; charset=3Diso-8859-1 > > <h1>Software error:</h1> > <pre>Can't call method "prepare" on an undefined value at > /var/www/holidayshop/perl/validatephone.pl line 26. > </pre> > <p> > For help, please send mail to the webmaster (<a > href=3D"mailto:redacted">redacted</a>), > giving this error message > and the time and date of the error. > > The version of Perl that mod_perl is using is apparently the exact same = one > as is on the system. > > mod_perl: Embedded Perl version *v5.32.1* > > $ perl -v > > This is perl 5, version 32, subversion 1 (v5.32.1) > > I'm not setting any ENV variables that I know of.. Perhaps you have som= e > examples of these that come to mind that might be the case? > > Thanks again for your help. > > On Thu, Oct 10, 2024 at 12:28PM Perrin Harkins <[email protected]> wrot= e: > > > DBI is supposed to install the driver when you call connect(), althoug= h > > that does mean any code loaded there isn't shared in memory. > > > > My question would be, did you get any actual failed responses in your = load > > test, or just these error log messages? If all the requests succeeded,= then > > I would suspect something where this code is somehow being run from th= e > > parent process. (Sorry if my terminology is off; I'm a mod_perl 1 user= .) > > > > If not, it could be that your validatephone.pl code does fine when the > > connection is opened for it by connect_on_init(), but after a connecti= on > > gets closed for some reason, it can't reconnect because the environmen= t is > > different. Maybe the path for shared objects is different at that poin= t. > > I'd try to figure out what's giving it that "not initialized" text in = the > > error message. > > > > Other things to consider: > > - Are your DBI/DBD modules compiled with the same Perl that mod_perl w= as > > compiled with? > > - Are you setting any ENV variables that might be needed by DBI/mysql = and > > might not get passed through to the child process? > > > > On Thu, Oct 10, 2024 at 11:02AM Tim Lank <[email protected]> wrote: > > > >> Thanks Ed. I'll add it and see if it helps. My load testing phase i= s > >> already completed, but I may get a chance to retest next year. > >> > >> On Thu, Oct 10, 2024 at 6:32AM Edward J. Sabol <[email protected]= m> > >> wrote: > >> > >>> On Oct 7, 2024, at 5:55PM, Tim Lank <[email protected]> wrote: > >>> > >>> I have the following in my startup.pl: > >>> > >>> use CGI qw(:all); > >>> use CGI::Carp 'fatalsToBrowser', 'carpout'; > >>> use List::Util 'shuffle'; > >>> CGI->compile(':all'); > >>> Apache::DBI->connect_on_init > >>> > >>> ("DBI:mysql:holidayshop", > >>> > >>> > >>> I don't know if it will help or not, but, before the above lines, yo= ur > >>> startup.pl should also have the following lines: > >>> > >>> use DBI; > >>> DBI->install_driver('mysql'); > >>> use Apache::DBI; > >>> > >>> Regards, > >>> Ed > >>> > >>> > Randolf Richardson, CNA - [email protected] Inter-Corporate Computer & Network Services, Inc. Beautiful British Columbia, Canada https://www.inter-corporate.com/