Error:
./craft project-config/apply
Applying changes from your project config files ... error: Changes to the project config are not possible while in read-only mode.
Config:
<?php
return [
'dev' => [
'devMode' => true,
],
'staging' => [
'allowAdminChanges' => false,
],
'production' => [
'allowAdminChanges' => false,
],
];
./craft project-config/applyNote: This command did work the first time after I had upgraded to 3.5.0. Now it is not.
Please search for that error in storage/logs/console.log and post the stack trace.
@brandonkelly - Below is the stack trace. I can only reproduce the issue when there are Project Config changes pending to be applied.
2020-08-05 14:04:49 [-][-][-][error][yii\base\NotSupportedException] yii\base\NotSupportedException: Changes to the project config are not possible while in read-only mode. in /httpdocs/vendor/craftcms/cms/src/services/ProjectConfig.php:446
Stack trace:
#0 /httpdocs/vendor/craftcms/cms/src/services/ProjectConfig.php(491): craft\services\ProjectConfig->set()
#1 /httpdocs/vendor/spicyweb/craft-neo/src/services/BlockTypes.php(304): craft\services\ProjectConfig->remove()
#2 /httpdocs/vendor/spicyweb/craft-neo/src/services/Fields.php(103): benf\neo\services\BlockTypes->deleteGroupsByFieldId()
#3 /httpdocs/vendor/spicyweb/craft-neo/src/Field.php(616): benf\neo\services\Fields->save()
#4 /httpdocs/vendor/craftcms/cms/src/services/Fields.php(1661): benf\neo\Field->afterSave()
#5 /httpdocs/vendor/craftcms/cms/src/services/Fields.php(824): craft\services\Fields->applyFieldSave()
#6 /httpdocs/vendor/craftcms/cms/src/services/ProjectConfig.php(1089): craft\services\Fields->handleChangedField()
#7 [internal function]: craft\services\ProjectConfig->handleChangeEvent()
#8 /httpdocs/vendor/yiisoft/yii2/base/Component.php(627): call_user_func()
#9 /httpdocs/vendor/craftcms/cms/src/services/ProjectConfig.php(667): yii\base\Component->trigger()
#10 /httpdocs/vendor/craftcms/cms/src/helpers/ProjectConfig.php(71): craft\services\ProjectConfig->processConfigChanges()
#11 /httpdocs/vendor/spicyweb/craft-neo/src/services/BlockTypes.php(325): craft\helpers\ProjectConfig::ensureAllFieldsProcessed()
#12 /httpdocs/vendor/craftcms/cms/src/services/ProjectConfig.php(1089): benf\neo\services\BlockTypes->handleChangedBlockType()
#13 [internal function]: craft\services\ProjectConfig->handleChangeEvent()
#14 /httpdocs/vendor/yiisoft/yii2/base/Component.php(627): call_user_func()
#15 /httpdocs/vendor/craftcms/cms/src/services/ProjectConfig.php(667): yii\base\Component->trigger()
#16 /httpdocs/vendor/craftcms/cms/src/services/ProjectConfig.php(1079): craft\services\ProjectConfig->processConfigChanges()
#17 [internal function]: craft\services\ProjectConfig->handleChangeEvent()
#18 /httpdocs/vendor/yiisoft/yii2/base/Component.php(627): call_user_func()
#19 /httpdocs/vendor/craftcms/cms/src/services/ProjectConfig.php(661): yii\base\Component->trigger()
#20 /httpdocs/vendor/craftcms/cms/src/services/ProjectConfig.php(1179): craft\services\ProjectConfig->processConfigChanges()
#21 /httpdocs/vendor/craftcms/cms/src/services/ProjectConfig.php(527): craft\services\ProjectConfig->_applyChanges()
#22 /httpdocs/vendor/craftcms/cms/src/console/controllers/ProjectConfigController.php(97): craft\services\ProjectConfig->applyYamlChanges()
#23 [internal function]: craft\console\controllers\ProjectConfigController->actionApply()
#24 /httpdocs/vendor/yiisoft/yii2/base/InlineAction.php(57): call_user_func_array()
#25 /httpdocs/vendor/yiisoft/yii2/base/Controller.php(180): yii\base\InlineAction->runWithParams()
#26 /httpdocs/vendor/yiisoft/yii2/console/Controller.php(181): yii\base\Controller->runAction()
#27 /httpdocs/vendor/craftcms/cms/src/console/Controller.php(188): yii\console\Controller->runAction()
#28 /httpdocs/vendor/yiisoft/yii2/base/Module.php(528): craft\console\Controller->runAction()
#29 /httpdocs/vendor/yiisoft/yii2/console/Application.php(180): yii\base\Module->runAction()
#30 /httpdocs/vendor/craftcms/cms/src/console/Application.php(87): yii\console\Application->runAction()
#31 /httpdocs/vendor/yiisoft/yii2/console/Application.php(147): craft\console\Application->runAction()
#32 /httpdocs/vendor/yiisoft/yii2/base/Application.php(386): yii\console\Application->handleRequest()
#33 /httpdocs/craft(23): yii\base\Application->run()
#34 {main}
Upgraded to Craft 3.5.1 and Neo 2.8.2 to see if either of those releases resolves the issue. Seems to have no impact. Apologies if this is a Neo issue - let me know if that seems to be the case and I can transfer.
Also, I can confirm that temporarily allowing admin changes on stage circumvents the exception from being thrown.
Looks like this is in fact a Neo bug. I just walked through the code based on your stack trace, and it looks like each time a Neo field is saved, Neo will delete each of the field鈥檚 groups and create new ones, which results in a project config change.