Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Permissions issue when trying to install Symfony Application with Composer

Please refrain from commenting your suggestion unless you've read through my list of troubleshooting steps. I am updating this list as suggestions come in.

On my co-worker's Windows 7 environment, when trying to install one of our apps built on Symfony 2.5.*, we get the following problem with unlink:

Composer Install Error

We have tried the following:

  • Running composer self-update
  • Running composer update instead of composer install (which resulted in the same error below)
  • Running the git bash in Administrator mode
  • Running composer install from an Administrator DOS shell instead of the git bash
  • Cloning our repository in multiple locations, including directly on the User Desktop
  • Changing the permissions of the files to give full control and ownership to the current user (recursively)
  • Changing the permissions of the files to give full control and ownership to "Everybody" (recursively)
  • Changing the permissions of the files to give full control and ownership to "SYSTEM" (recursively)
  • Starting a new project from scratch using composer create-project symfony/framework-standard-edition test/ "2.5.*" and composer create-project symfony/framework-standard-edition path/ "2.3.*" (in case the issue is version-specific)
  • Trying on a different Windows 7 machine (with the same result)
  • Removing the vendor folder and clearing the composer cache
  • Turning off the Indexer (Windows Search System)

Any ideas on what's going on? Is this a composer bug, or one of the pleasures of working with Windows? Everything above runs fine on my OSX machine.

Another debugging note... when I try to manually unlink with php -r "unlink('...');" it deletes the file in question no problems

like image 630
sjagr Avatar asked Jun 20 '14 16:06

sjagr


1 Answers

I've found the issue. An office-wide anti-virus program called "Trend Micro" was doing a "live scanning" of any newly created files. Since the anti-virus program was accessing the file at the same time composer was trying to unlink the files, composer would fail. Adding the repository as to the anti-virus whitelist (as well as the Windows Indexer to be safe) fixed the problem entirely.

I have created an issue in GitHub for the composer team to work on so that this exception could be handled somehow (e.g. a sleep function upon failure of the unlink)

Thanks for the troubleshooting help, everyone.

EDIT: As of this edit, a fix has been written, so if you run into this problem, just run composer self-update to ensure Composer has the latest fix for this.

like image 198
sjagr Avatar answered Oct 29 '22 11:10

sjagr