Error while sending STMT_PREPARE packet

Error while sending STMT_PREPARE packet

Posted By: pmietlicki

Published to Laravel on Jan 25, 2016

This is a bug under laravel and it is linked to the connection to the database.
I had a lot of error messages just after using memcached so I guess it could be linked to it.

You have to change "causedByLostConnection" function inside Connection.php (framework/src/Illuminate/Database) by adding 'Error while sending STMT_PREPARE packet' :

protected function causedByLostConnection(Exception $e)
            {
$message = $e->getMessage();
return Str::contains($message, [
'server has gone away',
'no connection to the server',
'Lost connection',
'is dead or not enabled',
'Error while sending STMT_PREPARE packet'
                ]);
            }

Sources :
https://laracasts.com/discuss/channels/laravel/stm...
https://github.com/laravel/framework/pull/10609

Tags: database, laravel, stmt

Archive