installers: Plugin installation failed, rolling back; Could not delete

I am attempting to install on a Vagrant 2.2.4 VM running Ubuntu/bionic64 (Windows 10 Pro host machine). Other packages install fine, but this one returns “Plugin installation failed,” attempts to roll back, and then fails to delete the contents of its installation directory.

Vagrantfile: https://pastebin.com/YQjAuPWL Composer.json https://pastebin.com/Tj1kMehb

vagrant@ubuntu-bionic:/home/app$ composer update -vvv
Reading ./composer.json
Loading config file ./composer.json
Checked CA file /etc/ssl/certs/ca-certificates.crt: valid
Executing command (/home/app): git branch --no-color --no-abbrev -v
Executing command (/home/app): git describe --exact-match --tags
Executing command (/home/app): git log --pretty="%H" -n1 HEAD
Executing command (/home/app): hg branch
Executing command (/home/app): fossil branch list
Executing command (/home/app): fossil tag list
Executing command (/home/app): svn info --xml
Failed to initialize global composer: Composer could not find the config file: /home/vagrant/.config/composer/composer.json
To initialize a project, please create a composer.json file as described in the https://getcomposer.org/ "Getting Started" section
Reading /home/app/vendor/composer/installed.json
Running 1.8.6 (2019-06-11 15:03:05) with PHP 7.2.19-0ubuntu0.18.04.1 on Linux / 4.15.0-51-generic
Loading composer repositories with package information
Downloading https://asset-packagist.org/packages.json
Writing /home/vagrant/.cache/composer/repo/https---asset-packagist.org/packages.json into cache
Downloading https://repo.packagist.org/packages.json
Writing /home/vagrant/.cache/composer/repo/https---repo.packagist.org/packages.json into cache
Updating dependencies (including require-dev)
Reading /home/vagrant/.cache/composer/repo/https---asset-packagist.org/p-provider-latest-.json from cache
Reading /home/vagrant/.cache/composer/repo/https---asset-packagist.org/provider-bower-asset$jquery.json from cache
Reading /home/vagrant/.cache/composer/repo/https---repo.packagist.org/p-provider-2013.json from cache
Reading /home/vagrant/.cache/composer/repo/https---repo.packagist.org/p-provider-2014.json from cache
Reading /home/vagrant/.cache/composer/repo/https---repo.packagist.org/p-provider-2015.json from cache
Reading /home/vagrant/.cache/composer/repo/https---repo.packagist.org/p-provider-2016.json from cache
Reading /home/vagrant/.cache/composer/repo/https---repo.packagist.org/p-provider-2017.json from cache
Reading /home/vagrant/.cache/composer/repo/https---repo.packagist.org/p-provider-2018.json from cache
Reading /home/vagrant/.cache/composer/repo/https---repo.packagist.org/p-provider-2018-07.json from cache
Reading /home/vagrant/.cache/composer/repo/https---repo.packagist.org/p-provider-2018-10.json from cache
Reading /home/vagrant/.cache/composer/repo/https---repo.packagist.org/p-provider-2019-01.json from cache
Reading /home/vagrant/.cache/composer/repo/https---repo.packagist.org/p-provider-2019-04.json from cache
Reading /home/vagrant/.cache/composer/repo/https---repo.packagist.org/p-provider-archived.json from cache
Reading /home/vagrant/.cache/composer/repo/https---repo.packagist.org/p-provider-latest.json from cache
Reading /home/vagrant/.cache/composer/repo/https---repo.packagist.org/provider-bower-asset$jquery.json from cache
Reading /home/vagrant/.cache/composer/repo/https---asset-packagist.org/provider-bower-asset$jqueryui.json from cache
Reading /home/vagrant/.cache/composer/repo/https---repo.packagist.org/provider-bower-asset$jqueryui.json from cache
Reading /home/vagrant/.cache/composer/repo/https---repo.packagist.org/provider-smarty$smarty.json from cache
Reading /home/vagrant/.cache/composer/repo/https---repo.packagist.org/provider-oomphinc$composer-installers-extender.json from cache
Reading /home/vagrant/.cache/composer/repo/https---repo.packagist.org/provider-composer$installers.json from cache
Resolving dependencies through SAT
Looking at all rules.
Something's changed, looking at all rules again (pass #1)
Dependency resolution completed in 0.010 seconds
Analyzed 508 packages to resolve dependencies
Analyzed 2183 rules to resolve dependencies
Package operations: 2 installs, 0 updates, 0 removals
Installs: composer/installers:v1.6.0, oomphinc/composer-installers-extender:v1.1.1
  - Installing composer/installers (v1.6.0): Reading /home/vagrant/.cache/composer/files/composer/installers/9b12dbb8725af9a9ee8487c67b68262091bb71df.zip from cache
Loading from cache
 Extracting archiveExecuting command (CWD): unzip -qq  '/home/app/vendor/composer/installers/86ab17ee4b36addbac2f9c610c6203eb' -d '/home/app/vendor/composer/07959a72'
Plugin installation failed, rolling back
  - Removing composer/installers (v1.6.0)


  [RuntimeException]
  Could not delete /home/app/vendor/composer/installers/src/Composer:


Exception trace:
 () at phar:///usr/local/bin/composer/src/Composer/Util/Filesystem.php:217
 Composer\Util\Filesystem->unlink() at phar:///usr/local/bin/composer/src/Composer/Util/Filesystem.php:170
 Composer\Util\Filesystem->removeDirectoryPhp() at phar:///usr/local/bin/composer/src/Composer/Util/Filesystem.php:137
 Composer\Util\Filesystem->removeDirectory() at phar:///usr/local/bin/composer/src/Composer/Downloader/FileDownloader.php:238
 Composer\Downloader\FileDownloader->remove() at phar:///usr/local/bin/composer/src/Composer/Downloader/DownloadManager.php:299
 Composer\Downloader\DownloadManager->remove() at phar:///usr/local/bin/composer/src/Composer/Installer/LibraryInstaller.php:224
 Composer\Installer\LibraryInstaller->removeCode() at phar:///usr/local/bin/composer/src/Composer/Installer/LibraryInstaller.php:137
 Composer\Installer\LibraryInstaller->uninstall() at phar:///usr/local/bin/composer/src/Composer/Installer/PluginInstaller.php:66
 Composer\Installer\PluginInstaller->install() at phar:///usr/local/bin/composer/src/Composer/Installer/InstallationManager.php:173
 Composer\Installer\InstallationManager->install() at phar:///usr/local/bin/composer/src/Composer/Installer/InstallationManager.php:160
 Composer\Installer\InstallationManager->execute() at phar:///usr/local/bin/composer/src/Composer/Installer.php:595
 Composer\Installer->doInstall() at phar:///usr/local/bin/composer/src/Composer/Installer.php:229
 Composer\Installer->run() at phar:///usr/local/bin/composer/src/Composer/Command/UpdateCommand.php:163
 Composer\Command\UpdateCommand->execute() at phar:///usr/local/bin/composer/vendor/symfony/console/Command/Command.php:245
 Symfony\Component\Console\Command\Command->run() at phar:///usr/local/bin/composer/vendor/symfony/console/Application.php:835
 Symfony\Component\Console\Application->doRunCommand() at phar:///usr/local/bin/composer/vendor/symfony/console/Application.php:185
 Symfony\Component\Console\Application->doRun() at phar:///usr/local/bin/composer/src/Composer/Console/Application.php:258
 Composer\Console\Application->doRun() at phar:///usr/local/bin/composer/vendor/symfony/console/Application.php:117
 Symfony\Component\Console\Application->run() at phar:///usr/local/bin/composer/src/Composer/Console/Application.php:104
 Composer\Console\Application->run() at phar:///usr/local/bin/composer/bin/composer:61
 require() at /usr/local/bin/composer:24

update [--prefer-source] [--prefer-dist] [--dry-run] [--dev] [--no-dev] [--lock] [--no-custom-installers] [--no-autoloader] [--no-scripts] [--no-progress] [--no-suggest] [--with-dependencies] [--with-all-dependencies] [-v|vv|vvv|--verbose] [-o|--optimize-autoloader] [-a|--classmap-authoritative] [--apcu-autoloader] [--ignore-platform-reqs] [--prefer-stable] [--prefer-lowest] [-i|--interactive] [--root-reqs] [--] [<packages>]...

About this issue

  • Original URL
  • State: closed
  • Created 5 years ago
  • Reactions: 8
  • Comments: 17 (3 by maintainers)

Most upvoted comments

I had this issue. I solved it using the following command shared here

composer install --no-plugins --no-scripts

@dreamon11

Try this. Solved it for me.

  • Change the VM to use nfs (and reload the VM).
  • Inside the VM:
    • Delete the composer cache with composer clearcache
    • Rerun composer install

Credit to jimuelpalaca.

Problem appears to be related to the speed of Virtualbox shared folders. I’d guess that the vagrant composer cache is getting corrupted.

Edit: Or, according to svpernova09, maybe it’s a simple race condition in composer…

I had this issue. I solved it using the following command shared here

composer install --no-plugins --no-scripts

This worked for me! Thanks!

Have same issue. workaround with

"composer/installers": "dev-master#v1.7.0"