This article talks about the solution for the issue where you receive an " SQL server has gone away " error message in the cron.log
file. A range of symptoms including image file importing issues or deployment failure may be experienced.
You receive an " SQL server has gone away " error message in the cron.log
file.
Steps to reproduce
Import files and trigger a deployment.
Expected result
Successful deployment.
Actual result
Error message in cron.log
:" SQLSTATE[HY000] [2006] MySQL server has gone away at/app/AAAAAAAAA/vendor/magento/zendframework1/library/Zend/Db/Adapter/Pdo/Abstract.php:144"
The default_socket_timeout
value is set too low. This is caused by the setting default_socket_timeout
. If php doesn’t receive anything from the MySQL database within this period, it assumes it is disconnected and throws the error.
default_socket_timeout
by running in the CLI: php -i |grep default_socket_timeout
default_socket_timeout
variable to the expected longest possible run time in the /etc/platform/<project_name>/php.ini
file. It is suggested that you set between 10-15 mins.