Possible to Increase mySQL timeouts?

Username epiz_31725829

http://favehub.epizy.com

Error Message

PDOException: SQLSTATE[HY000]: General error: 2006 MySQL server has gone away in /home/vol10_2/epizy.com/epiz_31725829/htdocs/protected/vendor/yiisoft/yii2/db/Command.php:1302
Stack trace:
#0 /home/vol10_2/epizy.com/epiz_31725829/htdocs/protected/vendor/yiisoft/yii2/db/Command.php(1302): PDOStatement->execute()
#1 /home/vol10_2/epizy.com/epiz_31725829/htdocs/protected/vendor/yiisoft/yii2/db/Command.php(1168): yii\db\Command->internalExecute(‘SELECT * FROM `…’)
#2 /home/vol10_2/epizy.com/epiz_31725829/htdocs/protected/vendor/yiisoft/yii2/db/Command.php(424): yii\db\Command->queryInternal(‘fetch’, NULL)
#3 /home/vol10_2/epizy.com/epiz_31725829/htdocs/protected/vendor/yiisoft/yii2/db/Query.php(287): yii\db\Command->queryOne()
#4 /home/vol10_2/epizy.com/epiz_31725829/htdocs/protected/vendor/yiisoft/yii2/db/ActiveQuery.php(304): yii\db\Query->one(NULL)
#5 /home/vol10_2/epizy.com/epiz_31725829/htdocs/protected/vendor/yiisoft/yii2/db/BaseActiveRecord.php(110): yii\db\ActiveQuery->one()
#6 /home/vol10_2/epizy.com/epiz_31725829/htdocs/protected/humhub/components/ModuleManager.php(497): yii\db\BaseActiveRecord::findOne(Array)
#7 /home/vol10_2/epizy.com/epiz_31725829/htdocs/protected/humhub/components/Module.php(226): humhub\components\ModuleManager->enable(Object(humhub\modules\custom_pages\Module))
#8 /home/vol10_2/epizy.com/epiz_31725829/htdocs/protected/humhub/modules/installer/controllers/ConfigController.php(211): humhub\components\Module->enable()
#9 [internal function]: humhub\modules\installer\controllers\ConfigController->actionModules()
#10 /home/vol10_2/epizy.com/epiz_31725829/htdocs/protected/vendor/yiisoft/yii2/base/InlineAction.php(57): call_user_func_array(Array, Array)
#11 /home/vol10_2/epizy.com/epiz_31725829/htdocs/protected/vendor/yiisoft/yii2/base/Controller.php(178): yii\base\InlineAction->runWithParams(Array)
#12 /home/vol10_2/epizy.com/epiz_31725829/htdocs/protected/vendor/yiisoft/yii2/base/Module.php(552): yii\base\Controller->runAction(‘modules’, Array)
#13 /home/vol10_2/epizy.com/epiz_31725829/htdocs/protected/vendor/yiisoft/yii2/web/Application.php(103): yii\base\Module->runAction(‘installer/confi…’, Array)
#14 /home/vol10_2/epizy.com/epiz_31725829/htdocs/protected/vendor/yiisoft/yii2/base/Application.php(384): yii\web\Application->handleRequest(Object(humhub\components\Request))
#15 /home/vol10_2/epizy.com/epiz_31725829/htdocs/index.php(25): yii\base\Application->run()
#16 {main}

Next yii\db\Exception: SQLSTATE[HY000]: General error: 2006 MySQL server has gone away
The SQL being executed was: SELECT * FROM module_enabled WHERE module_id=‘custom_pages’ in /home/vol10_2/epizy.com/epiz_31725829/htdocs/protected/vendor/yiisoft/yii2/db/Schema.php:676
Stack trace:
#0 /home/vol10_2/epizy.com/epiz_31725829/htdocs/protected/vendor/yiisoft/yii2/db/Command.php(1307): yii\db\Schema->convertException(Object(PDOException), ‘SELECT * FROM ...') #1 /home/vol10_2/epizy.com/epiz_31725829/htdocs/protected/vendor/yiisoft/yii2/db/Command.php(1168): yii\db\Command->internalExecute('SELECT * FROM …’)
#2 /home/vol10_2/epizy.com/epiz_31725829/htdocs/protected/vendor/yiisoft/yii2/db/Command.php(424): yii\db\Command->queryInternal(‘fetch’, NULL)
#3 /home/vol10_2/epizy.com/epiz_31725829/htdocs/protected/vendor/yiisoft/yii2/db/Query.php(287): yii\db\Command->queryOne()
#4 /home/vol10_2/epizy.com/epiz_31725829/htdocs/protected/vendor/yiisoft/yii2/db/ActiveQuery.php(304): yii\db\Query->one(NULL)
#5 /home/vol10_2/epizy.com/epiz_31725829/htdocs/protected/vendor/yiisoft/yii2/db/BaseActiveRecord.php(110): yii\db\ActiveQuery->one()
#6 /home/vol10_2/epizy.com/epiz_31725829/htdocs/protected/humhub/components/ModuleManager.php(497): yii\db\BaseActiveRecord::findOne(Array)
#7 /home/vol10_2/epizy.com/epiz_31725829/htdocs/protected/humhub/components/Module.php(226): humhub\components\ModuleManager->enable(Object(humhub\modules\custom_pages\Module))
#8 /home/vol10_2/epizy.com/epiz_31725829/htdocs/protected/humhub/modules/installer/controllers/ConfigController.php(211): humhub\components\Module->enable()
#9 [internal function]: humhub\modules\installer\controllers\ConfigController->actionModules()
#10 /home/vol10_2/epizy.com/epiz_31725829/htdocs/protected/vendor/yiisoft/yii2/base/InlineAction.php(57): call_user_func_array(Array, Array)
#11 /home/vol10_2/epizy.com/epiz_31725829/htdocs/protected/vendor/yiisoft/yii2/base/Controller.php(178): yii\base\InlineAction->runWithParams(Array)
#12 /home/vol10_2/epizy.com/epiz_31725829/htdocs/protected/vendor/yiisoft/yii2/base/Module.php(552): yii\base\Controller->runAction(‘modules’, Array)
#13 /home/vol10_2/epizy.com/epiz_31725829/htdocs/protected/vendor/yiisoft/yii2/web/Application.php(103): yii\base\Module->runAction(‘installer/confi…’, Array)
#14 /home/vol10_2/epizy.com/epiz_31725829/htdocs/protected/vendor/yiisoft/yii2/base/Application.php(384): yii\web\Application->handleRequest(Object(humhub\components\Request))
#15 /home/vol10_2/epizy.com/epiz_31725829/htdocs/index.php(25): yii\base\Application->run()
#16 {main}
Additional Information:
Array
(
[0] => HY000
[1] => 2006
[2] => MySQL server has gone away
)

Other Information

Seems like the way to solve this is to increase the wait_timeout and interactive_timeout to something like 28800. I am not sure how to do this and would appreciate some help in making this happen.

Upgrade to premium to do this.

3 Likes

Appreciate your response. To be clear, what is the function that upgrading to premium gives me that allows this?

Control of configuration files not accessible on free hosting.

1 Like

Are you sure that this is the issue?

Both of these parameters are only relevant for very long lasting database connections. You’re asking us to increase the database connection timeout to 4 hours, whereas realistically a database connection should never live for more than a few minutes, considering PHP cannot reuse database connections across different requests.

My first guess is that the query just takes too long and the server kills it because of that. The solution for a slow query is not to allow for longer lasting queries, but to speed up the query. Slow queries make for slow servers and slow websites, and nobody wants that.

I don’t think you can change this on premium hosting either. This is a MySQL system setting, you cannot change it for individual users.

4 Likes

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.