Skip to content

Unable to write new project config files #430

Open

Description

@kmeinke

Description

entrification of a category aborts with exception after the "💡 Run this command on other environments immediately after deploying these changes:" message.

The file /srv/www/kt_craft5_dev/config/project/ckeditor/configs dosnt exists, even its parent /srv/www/kt_craft5_dev/config/project/ckeditor dosnt exists.

`Exception 'yii\base\Exception' with message 'Unable to write new project config files'

in /srv/www/kt_craft5_dev/vendor/craftcms/cms/src/services/ProjectConfig.php:1652

Caused by: PHP Warning 'yii\base\ErrorException' with message 'rmdir(/srv/www/kt_craft5_dev/config/project/ckeditor/configs): Directory not empty'

in /srv/www/kt_craft5_dev/vendor/yiisoft/yii2/helpers/BaseFileHelper.php:466

Stack trace:
#0 [internal function]: yii\base\ErrorHandler->handleError()
#1 /srv/www/kt_craft5_dev/vendor/yiisoft/yii2/helpers/BaseFileHelper.php(466): rmdir()
#2 /srv/www/kt_craft5_dev/vendor/craftcms/cms/src/helpers/FileHelper.php(187): yii\helpers\BaseFileHelper::removeDirectory()
#3 /srv/www/kt_craft5_dev/vendor/yiisoft/yii2/helpers/BaseFileHelper.php(456): craft\helpers\FileHelper::removeDirectory()
#4 /srv/www/kt_craft5_dev/vendor/craftcms/cms/src/helpers/FileHelper.php(187): yii\helpers\BaseFileHelper::removeDirectory()
#5 /srv/www/kt_craft5_dev/vendor/craftcms/cms/src/helpers/FileHelper.php(579): craft\helpers\FileHelper::removeDirectory()
#6 /srv/www/kt_craft5_dev/vendor/craftcms/cms/src/services/ProjectConfig.php(1645): craft\helpers\FileHelper::clearDirectory()
#7 /srv/www/kt_craft5_dev/vendor/craftcms/cms/src/services/ProjectConfig.php(421): craft\services\ProjectConfig->writeYamlFiles()
#8 [internal function]: craft\services\ProjectConfig->flush()
#9 /srv/www/kt_craft5_dev/vendor/yiisoft/yii2/base/Component.php(645): call_user_func()
#10 /srv/www/kt_craft5_dev/vendor/craftcms/cms/src/base/ApplicationTrait.php(547): yii\base\Component->trigger()
#11 /srv/www/kt_craft5_dev/vendor/yiisoft/yii2/base/Application.php(387): craft\console\Application->trigger()
#12 /srv/www/kt_craft5_dev/craft(13): yii\base\Application->run()
#13 {main}
`

Additional info

  • Craft version: crtaft 5.7.6
  • PHP version: 8.3.8.
  • Database driver & version: 10.11.11-MariaDB
  • Plugins & versions: 4.8.0

Activity

  1. kmeinke commented on Jun 6, 2025

    @kmeinke
    Author

    also - pending changes dont go away if I apply them

    Image

  2. i-just commented on Jun 6, 2025

    @i-just
    Contributor

    Hi, thanks for getting in touch!

    It sounds like it could be related to: craftcms/cms#14909 and craftcms/cms#7323.

    Could you please check if there are any hidden files/folders in your project/config directory, if so, delete them, and then check if you’re still experiencing this issue?

    Also, can you double-check if Craft has permissions to write to the config/project folder?

  3. kmeinke commented on Jun 6, 2025

    @kmeinke
    Author

    I have tonnes of hidden directories in the config. Craft should have plenty of write permissions.

    Image

    I have deleted the hidden files and the pending changes vanished

    Image

    I have created a new test category to use entrify on - and got the same error

    Image

    The error message is true. ckconfig/config is not empty

    Image

    The pending YALM changes reappeared:

    Image

    The hidden files reappeared:

    Image

  4. kmeinke commented on Jun 6, 2025

    @kmeinke
    Author

    do you see? There is some strangeness in the group ownership of the files in ckedit/config. normaly all files and directories should be owned by www-data:webadmin. because of the GUID flag on the config/project directory.

    If i create a directory as www-data in bash it gets the right user and group:

    Image

  5. kmeinke commented on Jun 6, 2025

    @kmeinke
    Author

    perhaps crafts sets the user:group of created files manualy to www-data? but even than... the files in ckeditor/config are writeable by craft. so if it want the directory gone - it should be able to empty it first.

  6. i-just commented on Jun 9, 2025

    @i-just
    Contributor

    Thanks for the additional info! Craft doesn’t set ownership of files to any arbitrary value. If you manually change the ownership of the config/project directory and all its content to www-data:webadmin, remove any hidden files as before and run the entrification command, does the same error get thrown again?

  7. linear commented on Feb 16, 2026

    @linear
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions