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

Multisites: Create new Field results in super long page load and then fails. (http 504) #4103

Closed
internetztube opened this Issue Apr 5, 2019 · 5 comments

Comments

Projects
None yet
4 participants
@internetztube
Copy link

commented Apr 5, 2019

Description

I'm currently working on a project with 44 multi-sites. In that project, there are about 8 channels that are propagated over all sites.
A few weeks ago where there weren't that many sites in there, everything worked like excepted.

But since I added that last bulk if sites, the creation of fields fails.

yii\base\UnknownPropertyException: Setting unknown property: craft\behaviors\ContentBehavior::tests in /path/to/project/inner/vendor/yiisoft/yii2/base/BaseObject.php:163
Stack trace:
#0 /path/to/project/_DATA/storage/runtime/compiled_classes/ContentBehavior.php(1006): yii\base\BaseObject->__set('tests', NULL)
#1 /path/to/project/inner/vendor/craftcms/cms/src/base/Element.php(1662): craft\behaviors\ContentBehavior->__set('tests', NULL)
#2 /path/to/project/inner/vendor/craftcms/cms/src/base/Element.php(1641): craft\base\Element->setFieldValue('tests', NULL)
#3 /path/to/project/inner/vendor/craftcms/cms/src/elements/db/ElementQuery.php(2281): craft\base\Element->setFieldValues(Array)
#4 /path/to/project/inner/vendor/craftcms/cms/src/elements/db/ElementQuery.php(2197): craft\elements\db\ElementQuery->_createElement(Array)
#5 /path/to/project/inner/vendor/craftcms/cms/src/elements/db/ElementQuery.php(1171): craft\elements\db\ElementQuery->_createElements(Array)
#6 /path/to/project/inner/vendor/craftcms/cms/src/elements/db/ElementQuery.php(1216): craft\elements\db\ElementQuery->populate(Array)
#7 /path/to/project/inner/vendor/craftcms/cms/src/elements/User.php(367): craft\elements\db\ElementQuery->one()
#8 /path/to/project/inner/vendor/yiisoft/yii2/web/User.php(690): craft\elements\User::findIdentity('465')
#9 /path/to/project/inner/vendor/craftcms/cms/src/web/User.php(488): yii\web\User->renewAuthStatus()
#10 /path/to/project/inner/vendor/yiisoft/yii2/web/User.php(192): craft\web\User->renewAuthStatus()
#11 /path/to/project/inner/vendor/yiisoft/yii2/web/User.php(370): yii\web\User->getIdentity()
#12 /path/to/project/inner/vendor/yiisoft/yii2/base/Component.php(139): yii\web\User->getId()
#13 /path/to/project/inner/vendor/mmikkel/child-me/src/ChildMe.php(60): yii\base\Component->__get('id')
#14 /path/to/project/inner/vendor/yiisoft/yii2/base/BaseObject.php(109): mmikkel\childme\ChildMe->init()
#15 /path/to/project/inner/vendor/yiisoft/yii2/base/Module.php(158): yii\base\BaseObject->__construct(Array)
#16 /path/to/project/inner/vendor/craftcms/cms/src/base/Plugin.php(127): yii\base\Module->__construct('child-me', Object(craft\web\Application), Array)
#17 [internal function]: craft\base\Plugin->__construct('child-me', Object(craft\web\Application), Array)
#18 /path/to/project/inner/vendor/yiisoft/yii2/di/Container.php(384): ReflectionClass->newInstanceArgs(Array)
#19 /path/to/project/inner/vendor/yiisoft/yii2/di/Container.php(156): yii\di\Container->build('mmikkel\\childme...', Array, Array)
#20 /path/to/project/inner/vendor/yiisoft/yii2/BaseYii.php(349): yii\di\Container->get('mmikkel\\childme...', Array, Array)
#21 /path/to/project/inner/vendor/craftcms/cms/src/services/Plugins.php(897): yii\BaseYii::createObject(Array, Array)
#22 /path/to/project/inner/vendor/craftcms/cms/src/services/Plugins.php(230): craft\services\Plugins->createPlugin('child-me', Array)
#23 /path/to/project/inner/vendor/craftcms/cms/src/base/ApplicationTrait.php(1223): craft\services\Plugins->loadPlugins()
#24 /path/to/project/inner/vendor/craftcms/cms/src/web/Application.php(112): craft\web\Application->_postInit()
#25 /path/to/project/inner/vendor/yiisoft/yii2/base/BaseObject.php(109): craft\web\Application->init()
#26 /path/to/project/inner/vendor/yiisoft/yii2/base/Application.php(206): yii\base\BaseObject->__construct(Array)
#27 /path/to/project/inner/vendor/craftcms/cms/src/web/Application.php(100): yii\base\Application->__construct(Array)
#28 [internal function]: craft\web\Application->__construct(Array)
#29 /path/to/project/inner/vendor/yiisoft/yii2/di/Container.php(384): ReflectionClass->newInstanceArgs(Array)
#30 /path/to/project/inner/vendor/yiisoft/yii2/di/Container.php(156): yii\di\Container->build('craft\\web\\Appli...', Array, Array)
#31 /path/to/project/inner/vendor/yiisoft/yii2/BaseYii.php(349): yii\di\Container->get('craft\\web\\Appli...', Array, Array)
#32 /path/to/project/inner/vendor/craftcms/cms/bootstrap/bootstrap.php(255): yii\BaseYii::createObject(Array)
#33 /path/to/project/inner/vendor/craftcms/cms/bootstrap/web.php(42): require('/path/to/project/in......')
#34 /path/to/project/inner/web/index.php(41): require('/path/to/project/in......')
#35 {main}
Database Exception – yii\db\Exception
SQLSTATE[HY000]: General error: 1799 Creating index 'PRIMARY' required more than 'innodb_online_alter_log_max_size' bytes of modification log. Please try again.
The SQL being executed was: ALTER TABLE `content` ADD `field_modalHeadline` text
Error Info: Array
(
    [0] => HY000
    [1] => 1799
    [2] => Creating index 'PRIMARY' required more than 'innodb_online_alter_log_max_size' bytes of modification log. Please try again.
)
↵
Caused by: PDOException
SQLSTATE[HY000]: General error: 1799 Creating index 'PRIMARY' required more than 'innodb_online_alter_log_max_size' bytes of modification log. Please try again.
in /path/to/project/vendor/yiisoft/yii2/db/Command.php at line 1290```

We tried to increase the php/nginx/mysql limits, but that resulted in the same error with longer loading times.

I sent the db dump and the composer.json and composer.lock via fred@fredmansky.at.

Steps to reproduce

  1. Create 40+ sites in the CP.
  2. Create a channel and propagate that to all sites.
  3. Try to create a simple field.
  4. The field form loads so long that (at least our) nginx returns a 504.

Additional info

  • Craft version:
  • PHP version: 7.2.15
  • Database driver & version: MySQL 5.7.25
  • Plugins & versions: see composer.json is email

@internetztube internetztube changed the title Multisites: Create new Field results in super long page load. (http 504) Multisites: Create new Field results in super long page load and then failes. (http 504) Apr 5, 2019

@internetztube internetztube changed the title Multisites: Create new Field results in super long page load and then failes. (http 504) Multisites: Create new Field results in super long page load and then fails. (http 504) Apr 5, 2019

@brandonkelly

This comment has been minimized.

Copy link
Member

commented Apr 5, 2019

Hm… number of sites shouldn’t have any effect on the time it takes to add a new field.

Can you make sure your server has ample free disk space?

@narration-sd

This comment has been minimized.

Copy link
Contributor

commented Apr 5, 2019

...or memory -- vs. swapping...

@internetztube

This comment has been minimized.

Copy link
Author

commented Apr 6, 2019

Actually the amount of sites has an effect. The server has enough memory (32GB) and the SWAP is currently at 0.
Also the Disk-space is far away from critical. 41 GB free.

Please check out the SQL Dump in the E-Mail.

@internetztube

This comment has been minimized.

Copy link
Author

commented Apr 6, 2019

I figured out, that on MySQL 5.7 the error persists, but on MySQL 8 the error is gone.

Maybe you could investigate on that or drop MySQL 5.7 support.

@angrybrad

This comment has been minimized.

Copy link
Member

commented Apr 22, 2019

Hrm... I'm not able to reproduce it locally on MySQL 5.7 from the files you attached, unfortunately.

I'm not sure why swapping from 5.7 to 8.0 would resolve it, either as the innodb_online_alter_log_max_size default values the error message is complaining about don't seem to have changed between 5.7 and 8.0, unless it has explicitly been increased on your MySQL 8 box.

Regardless, going to chalk this up to being environment specific.

@angrybrad angrybrad closed this Apr 22, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.