magento2-deployer-plus icon indicating copy to clipboard operation
magento2-deployer-plus copied to clipboard

Cannot run `files:compile`

Open lfolco opened this issue 5 years ago • 4 comments

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.

lfolco avatar Nov 05 '20 15:11 lfolco

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.

fooman avatar Nov 10 '20 00:11 fooman

That looks like a commit for 2.4, but we're on 2.3.6.

lfolco avatar Nov 10 '20 14:11 lfolco

@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.

lfolco avatar Dec 29 '20 23:12 lfolco

@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.

fooman avatar Dec 30 '20 00:12 fooman