Struggling with "Unable to write new project config files" #15296
Replies: 5 comments 2 replies
-
So writing project config files works for a while, then after some time it stops working with that error? When you get the error, what do the permissions and user:group ownership look like on the |
Beta Was this translation helpful? Give feedback.
-
Ok I just got the error.
All of the perms for each folder in this path: However the yaml files are: Not sure if this is helpful as it seems the files are writeable by the owner. |
Beta Was this translation helpful? Give feedback.
-
Just got another error on another site... I'm only just noticing now that it's also related to writing CP Nav:
This may be a CP Nav issue — but I'll keep track of it a little longer to see if there is a pattern. If we could keep this discussion open so I can add more to it over time that would be great. |
Beta Was this translation helpful? Give feedback.
-
... Ok not just CP Nav. Got another error (on the same site as above, a 5.x site):
All similar conditions. Sometimes waiting a few seconds and refreshing the page brings the site back. |
Beta Was this translation helpful? Give feedback.
-
Assuming this is for the same site/environment/server as #15351 (comment) we can look at this issue as well. |
Beta Was this translation helpful? Give feedback.
-
My Problem:
I've had this issue for a while now.
From CraftCMS 3.x — up to today in CraftCMS 5.x
My CraftCMS sites run on a no frills LAMP server with lots if resources.
I have tried almost everything I can think of in terms of file permissions while still maintaining security.
What I used to do was:
Where:
user
is a non-root user account with the ability to log into the server.www-data
is the Apache web server group, of which both the user and Apache belong.This gives me a fully functional CraftCMS site that can upload and delete assets, and have no issues operating otherwise. However, after a time, I would get the dreaded
Unable to write new project config files
error. Usually as I am making changes to field settings, or changing configuration in the CP. So I would re-run those two commands to reset the perms and boom - my CraftCMS site would come back no problem.So in an effort to try to prevent what seems to be a permissions issue, I tried setting perms inheritance so that if CraftCMS created a file, it would hopefully inherit the perms of those around it:
.... but this doesn't help. And, after a while I'll run into the same problem.
Today, I have a multi user environment so I have to resort to ACLs to manage perms on the web root — I've even had to write a script to nuke and re-apply all the perms as this error happens so frequently. The site works, but then after a while some perms get out of sync, and the site can't write to project config.
I have seen and read this:
https://nystudio107.com/blog/hardening-craft-cms-permissions
My Question:
Those of you who run CrafCMS on LAMP servers — how do you manager your perms? Do you often have to reset the perms to keep the site maintained over time? Am I missing something or is this just the way things work?
Beta Was this translation helpful? Give feedback.
All reactions