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

Publishing a draft of table field causes internal server error #6122

Closed
karltriest opened this issue May 21, 2020 · 6 comments
Closed

Publishing a draft of table field causes internal server error #6122

karltriest opened this issue May 21, 2020 · 6 comments
Assignees

Comments

@karltriest
Copy link

karltriest commented May 21, 2020

Description

making a draft of a table field then publishing that draft causes "An internal server error occurred."

Steps to reproduce

  1. enter data to a table row
  2. publish draft
  3. publish changes

*note: publishing the exact same data without first making a draft works fine

Additional info

  • Craft version: Craft Pro 3.4.20
  • PHP version: 7.2.28
  • Database driver & version: MySQL 5.7.22
  • Plugins & versions:
    Activity Log | 1.0.1
    Amazon SES | 1.3.0
    Craft Color Mixer | 1.0.9
    Logs | 3.0.3
    Redactor | 2.6.1
    Sprout Forms | 3.11.7
    Transient | 1.0.0
    Twig Perversion | 2.1.0

Error Log

An Error occurred while handling another error:
PDOException: SQLSTATE[HY000]: General error: 2006 MySQL server has gone away in /usr/share/nginx/vendor/yiisoft/yii2/db/Command.php:1293
Stack trace:
#0 /usr/share/nginx/vendor/yiisoft/yii2/db/Command.php(1293): PDOStatement->execute()
#1 /usr/share/nginx/vendor/yiisoft/yii2/db/Command.php(1159): yii\db\Command->internalExecute('SELECT *\nFROM `...')
#2 /usr/share/nginx/vendor/yiisoft/yii2/db/Command.php(401): yii\db\Command->queryInternal('fetchAll', NULL)
#3 /usr/share/nginx/vendor/yiisoft/yii2/db/Query.php(237): yii\db\Command->queryAll()
#4 /usr/share/nginx/vendor/yiisoft/yii2/db/ActiveQuery.php(133): yii\db\Query->all(NULL)
#5 /usr/share/nginx/vendor/craftcms/cms/src/services/Categories.php(118): yii\db\ActiveQuery->all()
#6 /usr/share/nginx/vendor/craftcms/cms/src/services/Categories.php(135): craft\services\Categories->getAllGroups()
#7 /usr/share/nginx/vendor/craftcms/cms/src/web/assets/cp/CpAsset.php(360): craft\services\Categories->getEditableGroups()
#8 /usr/share/nginx/vendor/craftcms/cms/src/web/assets/cp/CpAsset.php(290): craft\web\assets\cp\CpAsset->_editableCategoryGroups()
#9 /usr/share/nginx/vendor/craftcms/cms/src/web/assets/cp/CpAsset.php(91): craft\web\assets\cp\CpAsset->_craftData()
#10 /usr/share/nginx/vendor/yiisoft/yii2/web/View.php(267): craft\web\assets\cp\CpAsset->registerAssetFiles(Object(craft\web\View))
#11 /usr/share/nginx/vendor/craftcms/cms/src/web/View.php(1771): yii\web\View->registerAssetFiles('craft\\web\\asset...')
#12 /usr/share/nginx/vendor/yiisoft/yii2/web/View.php(265): craft\web\View->registerAssetFiles('craft\\web\\asset...')
#13 /usr/share/nginx/vendor/craftcms/cms/src/web/View.php(1771): yii\web\View->registerAssetFiles('craft\\web\\asset...')
#14 /usr/share/nginx/vendor/yiisoft/yii2/web/View.php(163): craft\web\View->registerAssetFiles('craft\\web\\asset...')
#15 /usr/share/nginx/vendor/craftcms/cms/src/web/View.php(1059): yii\web\View->endBody()
#16 /usr/share/nginx/vendor/yiisoft/yii2/views/errorHandler/exception.php(538): craft\web\View->endBody()
#17 /usr/share/nginx/vendor/yiisoft/yii2/base/View.php(348): require('/usr/share/ngin...')
#18 /usr/share/nginx/vendor/yiisoft/yii2/base/View.php(257): yii\base\View->renderPhpFile('/usr/share/ngin...', Array)
#19 /usr/share/nginx/vendor/yiisoft/yii2/web/ErrorHandler.php(270): yii\base\View->renderFile('/usr/share/ngin...', Array, Object(craft\web\ErrorHandler))
#20 /usr/share/nginx/vendor/yiisoft/yii2/web/ErrorHandler.php(127): yii\web\ErrorHandler->renderFile('@yii/views/erro...', Array)
#21 /usr/share/nginx/vendor/craftcms/cms/src/web/ErrorHandler.php(128): yii\web\ErrorHandler->renderException(Object(yii\db\Exception))
#22 /usr/share/nginx/vendor/yiisoft/yii2/base/ErrorHandler.php(123): craft\web\ErrorHandler->renderException(Object(yii\db\Exception))
#23 /usr/share/nginx/vendor/craftcms/cms/src/web/ErrorHandler.php(61): yii\base\ErrorHandler->handleException(Object(yii\db\Exception))
#24 [internal function]: craft\web\ErrorHandler->handleException(Object(yii\db\Exception))
#25 {main}

Next yii\db\Exception: SQLSTATE[HY000]: General error: 2006 MySQL server has gone away
The SQL being executed was: SELECT *
FROM `categorygroups`
WHERE `dateDeleted` IS NULL
ORDER BY `name` in /usr/share/nginx/vendor/yiisoft/yii2/db/Schema.php:674
Stack trace:
#0 /usr/share/nginx/vendor/yiisoft/yii2/db/Command.php(1298): yii\db\Schema->convertException(Object(PDOException), 'SELECT *\nFROM `...')
#1 /usr/share/nginx/vendor/yiisoft/yii2/db/Command.php(1159): yii\db\Command->internalExecute('SELECT *\nFROM `...')
#2 /usr/share/nginx/vendor/yiisoft/yii2/db/Command.php(401): yii\db\Command->queryInternal('fetchAll', NULL)
#3 /usr/share/nginx/vendor/yiisoft/yii2/db/Query.php(237): yii\db\Command->queryAll()
#4 /usr/share/nginx/vendor/yiisoft/yii2/db/ActiveQuery.php(133): yii\db\Query->all(NULL)
#5 /usr/share/nginx/vendor/craftcms/cms/src/services/Categories.php(118): yii\db\ActiveQuery->all()
#6 /usr/share/nginx/vendor/craftcms/cms/src/services/Categories.php(135): craft\services\Categories->getAllGroups()
#7 /usr/share/nginx/vendor/craftcms/cms/src/web/assets/cp/CpAsset.php(360): craft\services\Categories->getEditableGroups()
#8 /usr/share/nginx/vendor/craftcms/cms/src/web/assets/cp/CpAsset.php(290): craft\web\assets\cp\CpAsset->_editableCategoryGroups()
#9 /usr/share/nginx/vendor/craftcms/cms/src/web/assets/cp/CpAsset.php(91): craft\web\assets\cp\CpAsset->_craftData()
#10 /usr/share/nginx/vendor/yiisoft/yii2/web/View.php(267): craft\web\assets\cp\CpAsset->registerAssetFiles(Object(craft\web\View))
#11 /usr/share/nginx/vendor/craftcms/cms/src/web/View.php(1771): yii\web\View->registerAssetFiles('craft\\web\\asset...')
#12 /usr/share/nginx/vendor/yiisoft/yii2/web/View.php(265): craft\web\View->registerAssetFiles('craft\\web\\asset...')
#13 /usr/share/nginx/vendor/craftcms/cms/src/web/View.php(1771): yii\web\View->registerAssetFiles('craft\\web\\asset...')
#14 /usr/share/nginx/vendor/yiisoft/yii2/web/View.php(163): craft\web\View->registerAssetFiles('craft\\web\\asset...')
#15 /usr/share/nginx/vendor/craftcms/cms/src/web/View.php(1059): yii\web\View->endBody()
#16 /usr/share/nginx/vendor/yiisoft/yii2/views/errorHandler/exception.php(538): craft\web\View->endBody()
#17 /usr/share/nginx/vendor/yiisoft/yii2/base/View.php(348): require('/usr/share/ngin...')
#18 /usr/share/nginx/vendor/yiisoft/yii2/base/View.php(257): yii\base\View->renderPhpFile('/usr/share/ngin...', Array)
#19 /usr/share/nginx/vendor/yiisoft/yii2/web/ErrorHandler.php(270): yii\base\View->renderFile('/usr/share/ngin...', Array, Object(craft\web\ErrorHandler))
#20 /usr/share/nginx/vendor/yiisoft/yii2/web/ErrorHandler.php(127): yii\web\ErrorHandler->renderFile('@yii/views/erro...', Array)
#21 /usr/share/nginx/vendor/craftcms/cms/src/web/ErrorHandler.php(128): yii\web\ErrorHandler->renderException(Object(yii\db\Exception))
#22 /usr/share/nginx/vendor/yiisoft/yii2/base/ErrorHandler.php(123): craft\web\ErrorHandler->renderException(Object(yii\db\Exception))
#23 /usr/share/nginx/vendor/craftcms/cms/src/web/ErrorHandler.php(61): yii\base\ErrorHandler->handleException(Object(yii\db\Exception))
#24 [internal function]: craft\web\ErrorHandler->handleException(Object(yii\db\Exception))
#25 {main}
Additional Information:
Array
(
    [0] => HY000
    [1] => 2006
    [2] => MySQL server has gone away
)

Previous exception:
PDOException: SQLSTATE[HY000]: General error: 2006 MySQL server has gone away in /usr/share/nginx/vendor/yiisoft/yii2/db/Command.php:1293
Stack trace:
#0 /usr/share/nginx/vendor/yiisoft/yii2/db/Command.php(1293): PDOStatement->execute()
#1 /usr/share/nginx/vendor/yiisoft/yii2/db/Command.php(1093): yii\db\Command->internalExecute('ROLLBACK TO SAV...')
#2 /usr/share/nginx/vendor/yiisoft/yii2/db/Schema.php(406): yii\db\Command->execute()
#3 /usr/share/nginx/vendor/craftcms/cms/src/db/mysql/Schema.php(108): yii\db\Schema->rollBackSavepoint('LEVEL1')
#4 /usr/share/nginx/vendor/yiisoft/yii2/db/Transaction.php(200): craft\db\mysql\Schema->rollBackSavepoint('LEVEL1')
#5 /usr/share/nginx/vendor/craftcms/cms/src/services/Elements.php(860): yii\db\Transaction->rollBack()
#6 /usr/share/nginx/vendor/craftcms/cms/src/services/Drafts.php(378): craft\services\Elements->duplicateElement(Object(craft\elements\Entry), '[<span class="s...')
#7 /usr/share/nginx/vendor/craftcms/cms/src/controllers/EntryRevisionsController.php(392): craft\services\Drafts->applyDraft(Object(craft\elements\Entry))
#8 [internal function]: craft\controllers\EntryRevisionsController->actionPublishDraft()
#9 /usr/share/nginx/vendor/yiisoft/yii2/base/InlineAction.php(57): call_user_func_array(Array, Array)
#10 /usr/share/nginx/vendor/yiisoft/yii2/base/Controller.php(157): yii\base\InlineAction->runWithParams(Array)
#11 /usr/share/nginx/vendor/craftcms/cms/src/web/Controller.php(178): yii\base\Controller->runAction('publish-draft', Array)
#12 /usr/share/nginx/vendor/yiisoft/yii2/base/Module.php(528): craft\web\Controller->runAction('publish-draft', Array)
#13 /usr/share/nginx/vendor/craftcms/cms/src/web/Application.php(291): yii\base\Module->runAction('entry-revisions...', Array)
#14 /usr/share/nginx/vendor/craftcms/cms/src/web/Application.php(559): craft\web\Application->runAction('entry-revisions...', Array)
#15 /usr/share/nginx/vendor/craftcms/cms/src/web/Application.php(270): craft\web\Application->_processActionRequest(Object(craft\web\Request))
#16 /usr/share/nginx/vendor/yiisoft/yii2/base/Application.php(386): craft\web\Application->handleRequest(Object(craft\web\Request))
#17 /usr/share/nginx/html/index.php(46): yii\base\Application->run()
#18 {main}

Next yii\db\Exception: SQLSTATE[HY000]: General error: 2006 MySQL server has gone away
The SQL being executed was: ROLLBACK TO SAVEPOINT LEVEL1 in /usr/share/nginx/vendor/yiisoft/yii2/db/Schema.php:674
Stack trace:
#0 /usr/share/nginx/vendor/yiisoft/yii2/db/Command.php(1298): yii\db\Schema->convertException(Object(PDOException), 'ROLLBACK TO SAV...')
#1 /usr/share/nginx/vendor/yiisoft/yii2/db/Command.php(1093): yii\db\Command->internalExecute('ROLLBACK TO SAV...')
#2 /usr/share/nginx/vendor/yiisoft/yii2/db/Schema.php(406): yii\db\Command->execute()
#3 /usr/share/nginx/vendor/craftcms/cms/src/db/mysql/Schema.php(108): yii\db\Schema->rollBackSavepoint('LEVEL1')
#4 /usr/share/nginx/vendor/yiisoft/yii2/db/Transaction.php(200): craft\db\mysql\Schema->rollBackSavepoint('LEVEL1')
#5 /usr/share/nginx/vendor/craftcms/cms/src/services/Elements.php(860): yii\db\Transaction->rollBack()
#6 /usr/share/nginx/vendor/craftcms/cms/src/services/Drafts.php(378): craft\services\Elements->duplicateElement(Object(craft\elements\Entry), '[<span class="s...')
#7 /usr/share/nginx/vendor/craftcms/cms/src/controllers/EntryRevisionsController.php(392): craft\services\Drafts->applyDraft(Object(craft\elements\Entry))
#8 [internal function]: craft\controllers\EntryRevisionsController->actionPublishDraft()
#9 /usr/share/nginx/vendor/yiisoft/yii2/base/InlineAction.php(57): call_user_func_array(Array, Array)
#10 /usr/share/nginx/vendor/yiisoft/yii2/base/Controller.php(157): yii\base\InlineAction->runWithParams(Array)
#11 /usr/share/nginx/vendor/craftcms/cms/src/web/Controller.php(178): yii\base\Controller->runAction('publish-draft', Array)
#12 /usr/share/nginx/vendor/yiisoft/yii2/base/Module.php(528): craft\web\Controller->runAction('publish-draft', Array)
#13 /usr/share/nginx/vendor/craftcms/cms/src/web/Application.php(291): yii\base\Module->runAction('entry-revisions...', Array)
#14 /usr/share/nginx/vendor/craftcms/cms/src/web/Application.php(559): craft\web\Application->runAction('entry-revisions...', Array)
#15 /usr/share/nginx/vendor/craftcms/cms/src/web/Application.php(270): craft\web\Application->_processActionRequest(Object(craft\web\Request))
#16 /usr/share/nginx/vendor/yiisoft/yii2/base/Application.php(386): craft\web\Application->handleRequest(Object(craft\web\Request))
#17 /usr/share/nginx/html/index.php(46): yii\base\Application->run()
#18 {main}
Additional Information:
Array
(
    [0] => HY000
    [1] => 2006
    [2] => MySQL server has gone away
)
@karltriest
Copy link
Author

karltriest commented May 21, 2020

i get this error from the web.log:

2020-05-20 15:04:43 - error - yii\web\HttpException:400
yii\web\BadRequestHttpException: Unable to verify your data submission. in /usr/share/nginx/vendor/yiisoft/yii2/web/Controller.php:190
Stack trace:
#0 /usr/share/nginx/vendor/craftcms/cms/src/web/Controller.php(134): yii\web\Controller->beforeAction(Object(yii\base\InlineAction))
#1 /usr/share/nginx/vendor/craftcms/cms/src/controllers/TemplatesController.php(69): craft\web\Controller->beforeAction(Object(yii\base\InlineAction))
#2 /usr/share/nginx/vendor/yiisoft/yii2/base/Controller.php(155): craft\controllers\TemplatesController->beforeAction(Object(yii\base\InlineAction))
#3 /usr/share/nginx/vendor/craftcms/cms/src/web/Controller.php(178): yii\base\Controller->runAction('render', Array)
#4 /usr/share/nginx/vendor/yiisoft/yii2/base/Module.php(528): craft\web\Controller->runAction('render', Array)
#5 /usr/share/nginx/vendor/craftcms/cms/src/web/Application.php(291): yii\base\Module->runAction('templates/rende...', Array)
#6 /usr/share/nginx/vendor/yiisoft/yii2/web/Application.php(103): craft\web\Application->runAction('templates/rende...', Array)
#7 /usr/share/nginx/vendor/craftcms/cms/src/web/Application.php(276): yii\web\Application->handleRequest(Object(craft\web\Request))
#8 /usr/share/nginx/vendor/yiisoft/yii2/base/Application.php(386): craft\web\Application->handleRequest(Object(craft\web\Request))
#9 /usr/share/nginx/html/index.php(48): yii\base\Application->run()
#10 {main}

@angrybrad angrybrad self-assigned this May 26, 2020
@angrybrad
Copy link
Member

@karltriest The MySQL docs have a whole page dedicated to that "MySQL server has gone away" message (https://dev.mysql.com/doc/refman/8.0/en/gone-away.html), but 9 times out of 10 when we see it, it's because you need to bump your MySQL server's max_allowed_packet and/or wait_timeout settings to higher values.

@karltriest
Copy link
Author

karltriest commented Jun 1, 2020

@angrybrad I changed the MySQL options to max_allowed_packet to 67108864 (64MB), (default/was 4MB) supposedly the default for wait_timeout on mysql is 28800 (8 hours), so i don't think that was an issue but I added in 28800 just in case.

Unfortunately the bug persists.

@angrybrad
Copy link
Member

@karltriest did you verify the settings took? i.e. SHOW VARIABLES LIKE '%max_allowed_packet%';

If they did, the other setting I've setting that works is bumping innodb_log_file_size higher.

@karltriest
Copy link
Author

@angrybrad turns out that it was the max_allowed_packet setting, and the server needed a reboot in order for the setting to take.
thanks! really appreciate your help

@angrybrad
Copy link
Member

@karltriest glad you're all sorted!

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

No branches or pull requests

3 participants