Unable to create directory uploads/2015/03. Is its parent directory writable by the server?

I never had permission problems - what the reason, why they come now up with this error message?

Yeah I have been getting that with my old sites lately too. You just have to change the folder permissions for everything in the shared directory. Let me know if you need me to be more specific and I will explain better when I have more time in an hour or so.

I see what you mean, I am getting this error locally on Vagrant itself.
I am trying to import theme unit test from wordpress.

https://codex.wordpress.org/Theme_Unit_Test

I’ve been getting this same error on all the sites in my box. Sudden it seems, but I’ve updated bedrock-ansible to the latest version and my sites were provisioned using the previous versions. Doing a new provision with vagrant up/reload doesn’t help.

All files seem to have the correct permissions and are owned by vagrant:www-data.

ls -la /vagrant-nfs-example.dev is 501:dialout. Don’t know if that’s correct?

Been trying to find a solution to this for some time but I’m stuck and out of leads… Anyone had similar issues and solved it somehow?

I’m going to try and backup my database and then try it clean with vagrant destroy and see if it helps.

edit I might add that this is not only for the uploads folder but also for files created in the theme-folder.

edit2 Vagrant destroy did not help. nor did any software updates / repair permissions I come to think of so far… out of ideas :frowning:

1 Like

Same problem as stefanlindberg. Bedrock Ansible latest version and not being able to create new folders, neither import new content.

Please help needed!

Thank you

My first thought was that this issue was caused by bindfs getting the wrong user/group when setting up nfs-folders. But that led me nowhere.

After a lot of fiddling around I finally got it working again.

I found it a bit odd that group_vars/all defined

web_user: web
web_group: www-data

and that group_vars/development defined

web_user: vagrant

I couldn’t quite figure out what the web user was for. And is still unsure. There seemed indeed to be a disconnect between the right user/group for either nginx or php.

So I searched for all files using www-data and found that roles/php/templates/php-fpm.conf.j2 do.

Changing:

listen.owner = {{ web_user }}
listen.group = {{ web_group }}
user = www-data
group = www-data

To:

listen.owner = {{ web_user }}
listen.group = {{ web_group }}
user = {{ web_user }}
group = {{ web_group }}

And running vagrant provision

This makes PHP run as the vagrant user instead of www-data. I would do a pull-request but I’m not sure this is the correct solution.

Would be great if someone who is well oriented with all the processes and roles could look into this. In the meantime this change worked for me and I hope it works for some of you who are experiencing the same issues.

1 Like

Thank you very much! That solved the problem.

Thanks for digging in, @stefanlindberg. I’ve opened an issue over at roots/bedrock-ansible#174. Want to do the PR suggested over there?

2 Likes

Ok thanks for verifying this @fullyint I’ll look into that issue and arrange a PR asap.