Permission denied when Ansible Playbook runs "Install Dependencies with Composer"

Hi.

I’m trying to get a project up and running but can’t seem to get past the task “Install Dependencies with Composer”.

It complains about permissions, I even tried setting permissions to 777 just for debugging purposes but the problem still persists.

I’m running it on OS X Yosemite if that gives any input, I’m starting to think that it might be a problem with the NFS? I’m running latest version of Vagrant(1.6.5) and tried with Virtualbox 4.3.18 and 4.3.20.

vagrant@sitename:/var/www/sitename.dev/current$ composer install
Loading composer repositories with package information
Installing dependencies (including require-dev) from lock file
Nothing to install or update
Generating autoload files

  [ErrorException]                                                                                                                       
  file_put_contents(/var/www/sitename.dev/current/vendor/composer/autoload_namespaces.php): failed to open stream: Permission denied  
                                                                                                                                         
install [--prefer-source] [--prefer-dist] [--dry-run] [--dev] [--no-dev] [--no-plugins] [--no-custom-installers] [--no-scripts] [--no-progress] [-v|vv|vvv|--verbose] [-o|--optimize-autoloader] [--ignore-platform-reqs] [packages1] ... [packagesN]

Anyone else had this problem? Been searching/debugging this for a couple of hours without luck.

Can you post the synced folder part of your Vagrantfile?

edit: can you also show the permissions on /var/www/sitename.dev and for current?

Finally found out what the problem was. I had ran composer install on my host(OS X) and the rights/permissions to the folders vendor and wp were not working out for the guest/vagrant.

I did a basic rm -rf on the vendor and wp folder and cleared my composer cache on my host and voila, it works.

In case anyone else gets into the same problem. :slight_smile:

Glad you figured it out. Thanks for posting the solution!