Cannot run `files:compile`
When I try to run files:compile, I get the following error:
The command "cd /srv/public_html/releases/20201105100601 && (/usr/local/bin/php ./bin/magento setup:di:compile)" failed.
Exit Code: 1 (General error)
Host Name: xxxxxxxxxx
================
In Write.php line 200:
The directory "/srv/public_html/releases/20201105100601/var/cache/" cannot
be deleted Warning!rmdir(/srv/public_html/releases/20201105100601/var/cache
/): Not a directory
setup:di:compile
The permissions on the symlink are drwxr-xr-x and I'm running as the directory owner.
We're using absolute symlinks, not sure if that's the issue? Running files:compile works when I do it in the context of a full deploy.
I have seen this too. I am guessing it could be related to this change
https://github.com/magento/magento2/commit/b3b80e68ab9b8d1bb8263f3e306bc97f3b9fa262#diff-8e4e939ca2dbd66e3362b5a1783aa978a910c060ac5a099b51e8454556bc6febR189-R194
which doesn't like the symlink.
The error itself also happens outside of using deployer when running bin/magento setup:di:compile but the var/cache symlink seems relevant to the getRealPathSafety check.
That looks like a commit for 2.4, but we're on 2.3.6.
@fooman Have you found a workaround? I'm a bit stuck and may need to find an alternative deployment solution if I can't resolve this.
@fooman haven't fully figured it out yet either. Need to double check but I believe just removing those directories worked for me.
set('override_shared_dirs', []);
in your deploy.php.