Reputation: 5142
I can't seem to be able to complete installation of bundles using
composer require <bundle-name>
because of these errors:
[Symfony\Component\Filesystem\Exception\IOException] Failed to remove directory "/var/www/emerson-suite/var/cache/de~/pools/rDfZ
I1q9aB": .
Complete console output of error:
Generating autoload files ocramius/package-versions: Generating version class... ocramius/package-versions: ...done generating version class
Sensio\Bundle\DistributionBundle\Composer\ScriptHandler::buildBootstrap Sensio\Bundle\DistributionBundle\Composer\ScriptHandler::clearCache
// Clearing the cache for the dev environment with debug // true
Symfony\Component\Filesystem\Exception\IOException] Failed to remove directory "/var/www/emerson-suite/var/cache/de~/pools/rDfZ
I1q9aB": .cache:clear [--no-warmup] [--no-optional-warmers] [-h|--help] [-q|--quiet] [-v|vv|vvv|--verbose] [-V|--version] [--ansi] [--no-ansi] [-n|--no-interaction] [-e|--env ENV] [--no-debug] [--]
Script Sensio\Bundle\DistributionBundle\Composer\ScriptHandler::clearCache handling the post-update-cmd event terminated with an exception
Installation failed, reverting ./composer.json to its original content.
[RuntimeException] An error occurred when executing the "'cache:clear --no-warmup'" command: // Clearing the cache for the dev environment with debug // true
[Symfony\Component\Filesystem\Exception\IOException] Failed to remove directory "/var/www/emerson-suite/var/cache/de~/pools/rDfZ I1q9aB": .
cache:clear [--no-warmup] [--no-optional-warmers] [-h|--help] [-q|--quiet] [-v|vv|vvv|--verbose] [-V|--version] [--ansi] [--no-ansi] [-n|--no-interaction] [-e|--env ENV] [--no-debug] [--]
Tried running composer with both sudo
and without.
The command that I ran is: $ sudo composer require javiereguiluz/easyadmin-bundle
Not sure what to do about this, any help is appreciated.
My environment is Ubuntu on Vagrant VM on Mac OS X.
Upvotes: 0
Views: 284
Reputation: 35169
The directory ./de~/ is the old /dev/ directory, as it has been moved ready to be deleted. The /pools/ directory is the cache that is being built during the run of the application. On the initial startup, it's using one user-account, but the webserver is running another, and so the original user account does not have permission to delete some files.
The easy way around this - in the dev environment at least - is to sudo rm -rf .../de~
. When I do remove old versions of code on prod, I'll often have to do the same because there was more than just the original deploying user, writing to the cache directory.
Upvotes: 0
Reputation: 331
Seems like it could be an issue involving permissions inside the OS and perhaps development environments.
Try looking for the answer here, a lot of people seem to be having this issue. https://github.com/symfony/symfony/issues/19363#issuecomment-264655158
Upvotes: 1