PackageVersions: Unable to install on vboxfs

The error has already been reported at #98, but the assumption that it is a permission / UID issue is wrong.

When installing under xfs it works without problems:

mkdir /tmp/ocramius
cd /tmp/ocramius
composer require ocramius/package-versions -vvv

But when installing under vboxfs (Virtualbox, Windows) it fails:

mkdir /home/vboxfs/ocramius
cd /home/vboxfs/ocramius
composer require ocramius/package-versions -vvv

The error-message ist:

  - Installing ocramius/package-versions (1.5.1): Downloading https://api.github.com/repos/Ocramius/PackageVersions/zipball/1d32342b8c1eb27353c8887c366147b4c2da673c
Downloading (connecting...)
Following redirect (2) https://codeload.github.com/Ocramius/PackageVersions/legacy.zip/1d32342b8c1eb27353c8887c366147b4c2da673c
Downloading https://codeload.github.com/Ocramius/PackageVersions/legacy.zip/1d32342b8c1eb27353c8887c366147b4c2da673c
Downloading (100%)
 Extracting archiveExecuting command (CWD): unzip -qq  '/home/vboxfs/vendor/ocramius/package-versions/0d1e7190e461948bf156e9fea4add4ee' -d '/home/vboxfs/vendor/composer/e11a586c'
Plugin installation failed, rolling back
  - Removing ocramius/package-versions (1.5.1)

Installation failed, deleting ./composer.json.


  [RuntimeException]
  Could not delete /home/vboxfs/vendor/ocramius/package-versions/src/PackageVersions:


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:597
 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/RequireCommand.php:218
 Composer\Command\RequireCommand->doUpdate() at phar:///usr/local/bin/composer/src/Composer/Command/RequireCommand.php:175
 Composer\Command\RequireCommand->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:267
 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:106
 Composer\Console\Application->run() at phar:///usr/local/bin/composer/bin/composer:61
 require() at /usr/local/bin/composer:24

require [--dev] [--prefer-source] [--prefer-dist] [--no-progress] [--no-suggest] [--no-update] [--no-scripts] [--update-no-dev] [--update-with-dependencies] [--update-with-all-dependencies] [--ignore-platform-reqs] [--prefer-stable] [--prefer-lowest] [--sort-packages] [-o|--optimize-autoloader] [-a|--classmap-authoritative] [--apcu-autoloader] [--] [<packages>]...

Tested with Cent OS 7, PHP 7.3, composer 1.9.0-1.6.0

I can install many other packages without problems under the vbofs:

composer require chadsikorra/php-simple-enum
composer require friendsofsymfony/rest-bundle
composer require ldaptools/ldaptools-bundle
composer require nelmio/api-doc-bundle
composer require paragonie/random_compat
composer require ramsey/uuid
composer require symfony/routing

However, only when using the sleep-trick at https://github.com/laravel/homestead/issues/1240#issuecomment-513989365 in composer I can install ocramius/package-versions under vboxfs without problems. So it looks like there is something special in ocramius/package-versions which other packages do not have. But what?

About this issue

  • Original URL
  • State: closed
  • Created 5 years ago
  • Reactions: 6
  • Comments: 33 (7 by maintainers)

Commits related to this issue

Most upvoted comments

I will downgrade to 6.0.4 later (if composer is having problems with this, chances are other software will too).

But… if someone just wants a “make it work right now” solution for this specific bug:

  1. You have to have unzip installed (eg. apt install unzip), so that composer will use that instead of php’s unzip extension.

  2. Assuming which unzip shows /usr/bin/unzip.

  3. Assuming echo $PATH shows /usr/local/bin listed before /usr/bin.

  4. The hack (pasted in shell as root user):

cat >/usr/local/bin/unzip <<EOF
#!/bin/sh

/usr/bin/unzip "$@"
sleep 1
EOF

chmod 755 /usr/local/bin/unzip

Yeah, I did that. And it works. Hopefully a downgrade to VirtualBox 6.0.4 tomorrow is a better fix.

I ran into this problem aswell - my solution was removing the vendor folder and do: “composer install --no-scripts --no-custom-installers” which worked for me.

I’ll leave it open for now: lots of folks landing here, instead of opening new issues.

I’m using bento/ubuntu-18.04 image. Downgrading Virtualbox alone didn’t help, in my case. I found that downgrading the Virtualbox Guest Addition helps. I downgraded both Virtualbox and Guest Addition to version 6.0.0.

I found the following gist on how to downgrade the Guest Addition: https://gist.github.com/claudiobizzotto/67dfcf66ebffca58b1075123c2e898f8

You’ll need gcc, make and perl packages installed for the above gist.

I found a solution that works for me…

If you change the synced_folder type to rsync, then you’re able to install this package, since the folder is still technically local to the VM. If you choose to go this route, be sure to read up on how rsync behaves with Vagrant, since the folders are not synchronized in real time. For my purposes, it’s not necessary for them to stay synced. I just need the contents of the host copied into the VM for testing, so this does exactly what I need.

config.vm.synced_folder "./test", "/home/vagrant/test", type: "rsync"

I tried a ton of things and it turns out that downgrading VirtualBox to 6.0.4 fixes this problem. According to the CHANGELOG they “Linux guests: shared folder performance and reliability improvements and missing features (bugs #17360, #819)”, which did exactly the opposite.

@alexgit2k I suggest you try downgrading to 6.0.4 in case it fixes the issue for you too.

@Ocramius you can close this IMO since it’s neither a bug in this package nor Composer, it just manifests itself with this one since Composer does some special read/write operations for plugins compared to “normal” dependencies.

My coworker has this problem with VirtualBox 6.0.6, while I run VirtualBox 6.0.4 and have no issues. So I think you’re onto something here.

Update: he reverted to 6.0.4 and ran the existing (Homestead) VM, which didn’t work. Then he destroyed and recreated the VM and it worked again. So it’s nothing conclusive unfortunately.

Just stumbled upon this too after upgrading to PHP 7.3. Everything was fine as long as I used my existing vendor directory from an earlier installation where I used PHP 7.1, but as soon as I removed vendor and ran composer install this started happening again.

Vagrant + VirtualBox 6.0 + Ubuntu 18.04. There are no permission issues.