Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Plugin installation failed, rolling back; Could not delete #430

Closed
Tanoro opened this issue Jun 26, 2019 · 17 comments
Closed

Plugin installation failed, rolling back; Could not delete #430

Tanoro opened this issue Jun 26, 2019 · 17 comments

Comments

@Tanoro
Copy link

Tanoro commented Jun 26, 2019

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>]...
@lisuml
Copy link

lisuml commented Jul 2, 2019

Same problem here.

Composer version 1.8.6 2019-06-11 15:03:05
$ vagrant version
Installed Version: 2.2.4
Latest Version: 2.2.5

@jakkyl
Copy link

jakkyl commented Jul 9, 2019

Same, any fixes?

@sachinsangde19
Copy link

Any update here?

@poluhovich
Copy link

I have the same issue.

@piotr-cz
Copy link
Contributor

Same here, btw I'm using Vagrant with homestead box (8.0.1) on VirtualBox (6.0.10).
May be related to laravel/homestead#1240

@hiepnsx
Copy link

hiepnsx commented Sep 24, 2019

Have same issue.
workaround with

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

@charlyox
Copy link

Exact same problem and environment, except for composer/installers version, which is 1.7.0.

@nessunluogo
Copy link

Same problem here using last composer version (1.9.3), composer/installers 1.7.0.

Cleared composer cache and vendor folder, set process-timeout 9999 and 4GB RAM to vagrant machine, working on Drupal 8.

Using @hiepnsx workaround causes dependencies conflict (drupal/core-recommended 8.8.2 requires composer/installers v1.7.0).

@sachinsangde19
Copy link

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

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

@nessunluogo
Copy link

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

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

This worked for me! Thanks!

@pyksid
Copy link

pyksid commented Feb 20, 2020

Same problem here with Composer 1.9.3 running inside virtual machine (VirtualBox + Debian) created with Vagrant 2.2.7 (WSL env).

I have to run Composer outside the VM (with shared folders) to work.

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

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

Unfortunately this is not a solution because plugins are necessary in many cases.

@kentr
Copy link

kentr commented Feb 24, 2020

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

@pyksid
Copy link

pyksid commented Apr 16, 2020

@kentr

Thanks for help.

Unfortunately, I can't get nfs to work with WSL :/

$ vagrant up
sh: 1: netsh: not found
sh: 1: cscript: not found
It seems that you don't have the privileges to change the firewall rules. NFS will not work without that firewall
changes. Execute the following commands via cmd as administrator:
netsh advfirewall firewall add rule name="VagrantWinNFSd-1.4.0" dir="in" action=allow protocol=any program="\home\xxx\.vagrant.d\gems\2.4.9\gems\vagrant-winnfsd-1.4.0\bin\winnfsd.exe" profile=any
netsh advfirewall firewall add rule name="VagrantWinNFSd-1.4.0" dir="out" action=allow protocol=any program="\home\xxx\.vagrant.d\gems\2.4.9\gems\vagrant-winnfsd-1.4.0\bin\winnfsd.exe" profile=any
If you are an Windows XP user run the following command instead:
netsh firewall add allowedprogram "\home\xxx\.vagrant.d\gems\2.4.9\gems\vagrant-winnfsd-1.4.0\bin\winnfsd.exe" VagrantWinNFSd-1.4.0 ENABLE

https://discourse.roots.io/t/vagrant-winnfsd-not-working-in-wsl/17709

@Seldaek
Copy link
Member

Seldaek commented Dec 8, 2020

Anyone still experiencing this? I guess it's just a vagrant filesystem issue but the question is if it's really common we can maybe try to work around it somehow by delaying plugin initialization if it fails or something like that?

@bilogic
Copy link

bilogic commented Dec 27, 2020

Anyone still experiencing this? I guess it's just a vagrant filesystem issue but the question is if it's really common we can maybe try to work around it somehow by delaying plugin initialization if it fails or something like that?

Me. I run composer inside a VirtualBox on a mounted SMB filesystem and needed to add --no-plugins for installation to succeed, so it's more a VirtualBox rather than Vagrant. See Jeroen-G/laravel-packager#101 on how it was 'solved'

@tabascoterrier
Copy link

@Seldaek yes, me also.

@Seldaek
Copy link
Member

Seldaek commented Jan 26, 2021

Closing here, please track composer/composer#9627 (comment) which is where the problem should be fixed if at all.

@Seldaek Seldaek closed this as completed Jan 26, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests