Permission problems on deploy can't create "current" symlink. 500 NGINX

I am trying to provision a production website on hosting solution provided by my work. Project took a while so bit older trellis like 1.0.3 or something deploying on 18.04. I have a local dev environment that works great and a digital ocean box that setup a staging server fine as well.

Immediately after running server.yml I ran deploy.yml, I think I am supposed to setup the wordpress first? Anyways it gets to the step of “Wordpress Installed?”


fatal: [142.103.202.113]: FAILED! => {"changed": false, "cmd": "wp core is-installed --skip-plugins --skip-themes

If I goto www.mydomain.com it shows a 500 NGINX error.

So I went into /srv/www/mydomain.com/logs and saw

*81 rewrite or internal redirection cycle while internally redirecting to "/index.php",

Snoop around the internet usually means the website is not finding “Index.php at all”.

So I compare my /srv/www/mydomain.com directory with my staging one I notice everything on production has chmod 750 under this directory while everything on staging is 755. I also noticed there is a current->releases/22035235wheverrelease sym-link created in /srv/www/mydomain.com on staging but not on production.

I think it doesn’t have permission to create one with web:www-data ?

Everything and all releases in the folder at owned by web:www-data though.

I can create a current symlink as root to a specific release on production and then change the owner to web:www-data the wordpress is able to install and setup fine. But if I do another deploy it fails again. Every new release it pulls is chmod 750 and I have to go in and change the symlink manually.

Is there a reason the production permissions are a little tighter or what is the issue causing this?