[CDBI] Lost connection to MySQL server during query

John Beppu john.beppu at gmail.com
Fri Jan 20 19:11:59 GMT 2006


Here's one that hit me very recently.

http://dev.mysql.com/doc/refman/5.0/en/gone-away.html#c7112



On 20/01/06, Carlos Vicente <cvicente at network-services.uoregon.edu> wrote:
> Hi all,
>
> I've been having this kind of error recently and can't seem to find a
> solution:
>
> error:          DBD::mysql::st execute failed: Lost connection to MySQL server
> during query [for Statement "SELECT address, prefix, status, used_by
> FROM Ipblock
> WHERE id=?
> "] at /usr/lib/perl5/site_perl/5.8.0/DBIx/ContextualFetch.pm line 51.
> context:
> ...
> 47:     sub _untaint_execute {
> 48:     my $sth = shift;
> 49:     my $old_value = $sth->{Taint};
> 50:     $sth->{Taint} = 0;
> 51:     my $ret = $sth->SUPER::execute(@_);
> 52:     $sth->{Taint} = $old_value;
> 53:     return $ret;
> 54:     }
> 55:
> ...
> code stack:     /usr/lib/perl5/site_perl/5.8.0/DBIx/ContextualFetch.pm:51
> /usr/lib/perl5/site_perl/5.8.0/DBIx/ContextualFetch.pm:31
> /usr/lib/perl5/site_perl/5.8.0/DBIx/ContextualFetch.pm:86
> /usr/lib/perl5/site_perl/5.8.0/Class/DBI.pm:849
> /usr/lib/perl5/site_perl/5.8.0/Class/DBI.pm:836
> /usr/lib/perl5/site_perl/5.8.0/Class/Accessor.pm:385
> /usr/local/netdot/lib/Netdot/IPManager.pm:416
> /usr/local/netdot/lib/Netdot/IPManager.pm:748
> /usr/local/netdot/lib/Netdot/DeviceManager.pm:828
> /usr/local/netdot/htdocs/updatedevice.html:164
> /usr/local/netdot/htdocs/section_management.html:174
> /usr/local/netdot/htdocs/autohandler:20
> raw error
>
> As you can probably guess, this is a web app using Class::DBI, HTML::Mason and mod_perl.
>
> The problem happens at random and it's difficult to reproduce.  It happens at differnt parts of the code.
> In some cases, to simplify things, I bypass Class::DBI and execute direct SQL queries using the db handle returned by db_Main.
> I don't know whether this has anything to do with the issue.
> I've followed the suggestions in the wiki about the interaction between Apache::DBI and Ima::DBI and added an overridden
> db_Main in my Class::DBI subclass.  But that didn't seem get rid of the error.  :-(
>
> The versions of packages I'm running are as follows:
>
> Class::DBI v3.0.14
> Ima::DBI 0.34
> DBI 1.50
> DBD::mysql 3.0002
> Apache 2.0.53
> Apache::DBI 0.9901
> Ima::DBI 0.34
> HTML::Mason 1.32
> mod_perl-2.0.1
> MySQL 4.1.14-standard
>
>
> Any help would be very appreciated.




More information about the ClassDBI mailing list