ThingEngineer / PHP-MySQLi-Database-Class

Wrapper for a PHP MySQL class, which utilizes MySQLi and prepared statements.
Other
3.29k stars 1.35k forks source link

Warning: Error while sending STMT_CLOSE packet. #972

Open pabloruizfaundez opened 3 years ago

pabloruizfaundez commented 3 years ago

Hi everyone, I've had the following error sporadically for a while:

Warning: Error while sending STMT_CLOSE packet. PID=30017 in /var/www/virtual/DOMAIN/htdocs/libs/MysqliDb.php on line 1718 Warning: mysqli::__construct(): (HY000/2002): No such file or directory in /var/www/virtual/DOMAIN/htdocs/libs/MysqliDb.php on line 346 Fatal error: Uncaught Exception: Connect Error 2002: No such file or directory in /var/www/virtual/DOMAIN/htdocs/libs/MysqliDb.php:349 Stack trace: #0 /var/www/virtual/DOMAIN/htdocs/libs/MysqliDb.php(2020): MysqliDb->connect('default') #1 /var/www/virtual/DOMAIN/htdocs/libs/MysqliDb.php(1617): MysqliDb->_prepareQuery() #2 /var/www/virtual/DOMAIN/htdocs/libs/MysqliDb.php(761): MysqliDb->_buildQuery(NULL) #3 /var/www/virtual/DOMAIN/htdocs/dashboards/admin.php(306): MysqliDb->get('sii_folio f') #4 /var/www/virtual/DOMAIN/htdocs/index.php(8): include('/var/www/virtua...') #5 {main} thrown in /var/www/virtual/DOMAIN/htdocs/libs/MysqliDb.php on line 349

any ideas? Thanks!!!

nikola-webnauts commented 2 years ago

I spent some time investigating this issue. It can appear as result of multiple issues.

For us it was up to large data packets sent within update metod. Once we increased db variable max_allowed_packet from default 4MB to higher value of 32MB it was resolved.

Also, it can be related to long lasting connections. Check your wait_timeout db variable.