Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"MySQL server has gone away" error during building contributors page locally #964

Open
arogachev opened this issue Jan 5, 2022 · 6 comments
Assignees
Labels

Comments

@arogachev
Copy link
Contributor

Trying to build contributors page locally, getting the following error:

Exception 'yii\db\Exception' with message 'SQLSTATE[HY000]: General error: 2006 MySQL server has gone away
The SQL being executed was: SELECT RELEASE_LOCK('...')'

in /code/vendor/yiisoft/yii2/db/Schema.php:678

Error Info:
Array
(
    [0] => HY000
    [1] => 2006
    [2] => MySQL server has gone away
)

Caused by: Exception 'PDOException' with message 'SQLSTATE[HY000]: General error: 2006 MySQL server has gone away'

in /code/vendor/yiisoft/yii2/db/Command.php:1302

Stack trace:
#0 /code/vendor/yiisoft/yii2/db/Command.php(1302): PDOStatement->execute()
#1 /code/vendor/yiisoft/yii2/db/Command.php(1168): yii\db\Command->internalExecute('SELECT RELEASE_...')
#2 /code/vendor/yiisoft/yii2/db/Command.php(436): yii\db\Command->queryInternal('fetchColumn', 0)
#3 /code/vendor/yiisoft/yii2/mutex/MysqlMutex.php(81): yii\db\Command->queryScalar()
#4 [internal function]: yii\mutex\MysqlMutex->yii\mutex\{closure}(Object(yii\db\Connection))
#5 /code/vendor/yiisoft/yii2/db/Connection.php(1126): call_user_func(Object(Closure), Object(yii\db\Connection))
#6 /code/vendor/yiisoft/yii2/mutex/MysqlMutex.php(82): yii\db\Connection->useMaster(Object(Closure))
#7 /code/vendor/yiisoft/yii2/mutex/Mutex.php(88): yii\mutex\MysqlMutex->releaseLock('app\\commands\\Co...')
#8 /code/src/commands/ContributorsController.php(155): yii\mutex\Mutex->release('app\\commands\\Co...')
#9 /code/src/commands/ContributorsController.php(135): app\commands\ContributorsController->releaseMutex()
#10 [internal function]: app\commands\ContributorsController->actionGenerate()
#11 /code/vendor/yiisoft/yii2/base/InlineAction.php(57): call_user_func_array(Array, Array)
#12 /code/vendor/yiisoft/yii2/base/Controller.php(181): yii\base\InlineAction->runWithParams(Array)
#13 /code/vendor/yiisoft/yii2/console/Controller.php(184): yii\base\Controller->runAction('generate', Array)
#14 /code/vendor/yiisoft/yii2/base/Module.php(534): yii\console\Controller->runAction('generate', Array)
#15 /code/vendor/yiisoft/yii2/console/Application.php(181): yii\base\Module->runAction('contributors/ge...', Array)
#16 /code/vendor/yiisoft/yii2/console/Application.php(148): yii\console\Application->runAction('contributors/ge...', Array)
#17 /code/vendor/yiisoft/yii2/base/Application.php(392): yii\console\Application->handleRequest(Object(yii\console\Request))
#18 /code/src/yii(29): yii\base\Application->run()
#19 {main}
@arogachev arogachev added the bug label Jan 5, 2022
@arogachev arogachev self-assigned this Jan 5, 2022
@arogachev
Copy link
Contributor Author

Probably need to sync wait_timeout with production in #962.

@samdark
Copy link
Member

samdark commented Jan 5, 2022

Current production value is 28800.

@arogachev
Copy link
Contributor Author

arogachev commented Jan 5, 2022

Thanks. Seems like it's default value. I have the same in local environment on fresh isntall. I am wondering how it works on production server then. Could you check?

@samdark
Copy link
Member

samdark commented Jan 5, 2022

Works alright. Just re-generated contributors.

@arogachev
Copy link
Contributor Author

It works on consequent calls, when user avatars are already downloaded and cached. With no avatars on fresh install the error is consistent and reproducible. Maybe something else is tuned in production. But regardless of that, solution can be as easy as separating this 2 processes within a single command (probably related with mutex).

@arogachev
Copy link
Contributor Author

Not a high priority now because the command can be just called again.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants