Permission Denied upload folder when Deploying (Task: deploy: Finalize deploy)

Hello,
I have added an image file manually using SFTP and now every time I deploy I have this error

TASK [deploy : Finalize the deploy] ********************************************
System info:
  Ansible 2.2.1.0; Darwin
  Trellis at "Change `remote-user` role to `connection` role: tests host key, user"
---------------------------------------------------
rmtree failed: [Errno 13] Permission denied: '/srv/www/nucreativetalent/relea
ses/20170421221737/web/app/uploads/2017/01/recruiter_icon.png'
fatal: [***.**.***.***]: FAILED! => {"changed": false, "failed": true}
	to retry, use: --limit @/Users/michelecocuccio/Desktop/NuCreative-Websites/NU Creative Talent/trellis/deploy.retry

The deploy is still successful but it’s not finished. I have removed the current release folder and tried again and the deploy is successful but If I deploy again I get the same error.

Is there a fix for this?

PS: I have masked the IP for security reasons

You should add images using the user web when possible. So SFTP in as web and add when you have to. That should help avoiding permission issues. You said you tried again. If that means you added the image the same way and not as web or not chmod-ed nor chown-ed properly you will probably get the same errors.

1 Like

Thanks for the quick response.
I have tried again with the deploy and yeah it worked the first time but the error is showing up again the second time. But this is fine for now. I will try again.

Another question that I wanted to ask is that I have a custom folder created by a plugin (wpallimport) that needs to have Writing permission. I am trying to run a cron job but it says that that folder needs writing permissions. Is there somewhere on Trellis to set permission to that folder? That’s very important.

Thanks a lot

No, there is not a location in Trellis to set directory permissions for a custom folder. Just ssh in as admin and cd into the directory’s location. cd /srv/www/domain.com/current/web/app/should do it as I would imagine that is the location where the directory is added. And then sudo chown web:www-data directory and if need be sudo chmod 755 directory

2 Likes