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

Installing symfony/flex fails with composer2 using VirtualBox #9361

Closed
rpkamp opened this issue Oct 27, 2020 · 9 comments
Closed

Installing symfony/flex fails with composer2 using VirtualBox #9361

rpkamp opened this issue Oct 27, 2020 · 9 comments
Labels
Milestone

Comments

@rpkamp
Copy link

rpkamp commented Oct 27, 2020

Host system
Linux Fedora 32 (Linux localhost.localdomain 5.8.16-200.fc32.x86_64)
VirtualBox Version 6.1.16 r140961 (Qt5.14.2)
Vagrant 2.2.9

VM
Ubuntu 18.04 (v20201016)
UnZip version 6.00
Filesystems mounted using vboxfs

Composer
Composer version 2.0.2 2020-10-25 23:03:59

The problem
Doing this in a directory without any composer.json, composer.lock or vendor/ present.

When I run this command:

composer require symfony/flex

I get the following output:

Using version ^1.9 for symfony/flex
./composer.json has been created
Running composer update symfony/flex
Loading composer repositories with package information
Updating dependencies
Lock file operations: 1 install, 0 updates, 0 removals
  - Locking symfony/flex (v1.9.10)
Writing lock file
Installing dependencies from lock file (including require-dev)
Package operations: 1 install, 0 updates, 0 removals
  - Installing symfony/flex (v1.9.10): Extracting archive
Plugin initialization failed (Plugin symfony/flex could not be initialized, class not found: Symfony\Flex\Flex), uninstalling plugin
  - Removing symfony/flex (v1.9.10)
    Install of symfony/flex failed

Installation failed, deleting ./composer.json.

                                                                                    
  [UnexpectedValueException]                                                        
  Plugin symfony/flex could not be initialized, class not found: Symfony\Flex\Flex  

And I expected this to happen:
symfony/flex should have installed correctly

Problem seems related to Ocramius/PackageVersions#107 in that composer thinks the file has been extracted (running unzip), but it hasn't been synced to disk yet, so it can't be loaded when it tries to do so.

@Seldaek
Copy link
Member

Seldaek commented Oct 27, 2020

Seems related to composer/package-versions-deprecated#14 as well. It does look like an environment/filesystem issue though.

Can you try with composer 1 if it also fails?

Can you run the require with -vvv and paste the full output?

@Seldaek Seldaek added this to the 2.0 milestone Oct 27, 2020
@Seldaek Seldaek added the Bug label Oct 27, 2020
@rpkamp
Copy link
Author

rpkamp commented Oct 28, 2020

It fails under composer 1.x as well.

Logs for composer 2.0.2

Loading config file /home/vagrant/.config/composer/config.json
Loading config file /home/vagrant/.config/composer/auth.json
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
Running 2.0.2 (2020-10-25 23:03:59) with PHP 7.2.34-4+ubuntu18.04.1+deb.sury.org+1 on Linux / 4.15.0-121-generic
Loading config file /home/vagrant/.config/composer/config.json
Loading config file /home/vagrant/.config/composer/auth.json
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 ./composer.json
Loading config file /home/vagrant/.config/composer/config.json
Loading config file /home/vagrant/.config/composer/auth.json
Loading config file ./composer.json
Checked CA file /etc/ssl/certs/ca-certificates.crt: valid
Executing command (/opt/locke): git branch -a --no-color --no-abbrev -v
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
Downloading https://repo.packagist.org/packages.json
[200] https://repo.packagist.org/packages.json
Writing /home/vagrant/.cache/composer/repo/https---repo.packagist.org/packages.json into cache
Reading /home/vagrant/.cache/composer/repo/https---repo.packagist.org/provider-symfony~flex.json from cache
Downloading https://repo.packagist.org/p2/symfony/flex.json if modified
[304] https://repo.packagist.org/p2/symfony/flex.json
Using version ^1.9 for symfony/flex
./composer.json has been created
Reading ./composer.json
Loading config file /home/vagrant/.config/composer/config.json
Loading config file /home/vagrant/.config/composer/auth.json
Loading config file ./composer.json
Executing command (/opt/locke): git branch -a --no-color --no-abbrev -v
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
Running composer update symfony/flex
Loading composer repositories with package information
Updating dependencies
Downloading https://repo.packagist.org/packages.json
[200] https://repo.packagist.org/packages.json
Writing /home/vagrant/.cache/composer/repo/https---repo.packagist.org/packages.json into cache
Reading /home/vagrant/.cache/composer/repo/https---repo.packagist.org/provider-symfony~flex.json from cache
Downloading https://repo.packagist.org/p2/symfony/flex.json if modified
[304] https://repo.packagist.org/p2/symfony/flex.json
Generating rules
Resolving dependencies through SAT
Looking at all rules.

Dependency resolution completed in 0.001 seconds
Analyzed 96 packages to resolve dependencies
Analyzed 109 rules to resolve dependencies
Lock file operations: 1 install, 0 updates, 0 removals
Installs: symfony/flex:v1.9.10
  - Locking symfony/flex (v1.9.10)
Writing lock file
Installing dependencies from lock file (including require-dev)
Reading ./composer.lock
Package operations: 1 install, 0 updates, 0 removals
Installs: symfony/flex:v1.9.10
Reading /home/vagrant/.cache/composer/files/symfony/flex/c1dadf6c5cb3cc86f57dea466b102ccae1bf129d.zip from cache
  - Loading symfony/flex (v1.9.10) from cache
  - Installing symfony/flex (v1.9.10): Extracting archive
Executing command (CWD): rm -rf '/opt/locke/vendor/symfony/flex/src'
Executing async command (CWD): unzip -qq  '/opt/locke/vendor/composer/tmp-06486b70b70423882063350a2cab32a1' -d '/opt/locke/vendor/composer/9363ec6a'
Executing command (CWD): rm -rf '/opt/locke/vendor/symfony/flex'
Executing command (CWD): rm -rf '/opt/locke/vendor/composer/9363ec6a'
Plugin initialization failed (include(/opt/locke/vendor/symfony/flex/src/Flex.php): failed to open stream: No such file or directory), uninstalling plugin
  - Removing symfony/flex (v1.9.10)
Executing command (CWD): rm -rf '/opt/locke/vendor/symfony/flex'
    Install of symfony/flex failed
Executing command (CWD): rm -rf '/opt/locke/vendor/composer/'

Installation failed, deleting ./composer.json.

                                                        
  [RuntimeException]                                    
  Could not delete /opt/locke/vendor/symfony/flex/src:  
                                                        

Exception trace:
 () at phar:///usr/local/bin/composer/src/Composer/Util/Filesystem.php:218
 Composer\Util\Filesystem->unlink() at phar:///usr/local/bin/composer/src/Composer/Util/Filesystem.php:171
 Composer\Util\Filesystem->removeDirectoryPhp() at phar:///usr/local/bin/composer/src/Composer/Util/Filesystem.php:138
 Composer\Util\Filesystem->removeDirectory() at phar:///usr/local/bin/composer/src/Composer/Downloader/FileDownloader.php:381
 Composer\Downloader\FileDownloader->remove() at phar:///usr/local/bin/composer/src/Composer/Downloader/DownloadManager.php:348
 Composer\Downloader\DownloadManager->remove() at phar:///usr/local/bin/composer/src/Composer/Installer/LibraryInstaller.php:292
 Composer\Installer\LibraryInstaller->removeCode() at phar:///usr/local/bin/composer/src/Composer/Installer/LibraryInstaller.php:187
 Composer\Installer\LibraryInstaller->uninstall() at phar:///usr/local/bin/composer/src/Composer/Installer/PluginInstaller.php:119
 Composer\Installer\PluginInstaller->rollbackInstall() at phar:///usr/local/bin/composer/src/Composer/Installer/PluginInstaller.php:78
 Composer\Installer\PluginInstaller->Composer\Installer\{closure}() at n/a:n/a
 call_user_func() at phar:///usr/local/bin/composer/vendor/react/promise/src/React/Promise/FulfilledPromise.php:20
 React\Promise\FulfilledPromise->then() at phar:///usr/local/bin/composer/vendor/react/promise/src/React/Promise/Deferred.php:74
 React\Promise\Deferred->React\Promise\{closure}() at n/a:n/a
 call_user_func() at phar:///usr/local/bin/composer/vendor/react/promise/src/React/Promise/Deferred.php:166
 React\Promise\Deferred->processQueue() at phar:///usr/local/bin/composer/vendor/react/promise/src/React/Promise/Deferred.php:95
 React\Promise\Deferred->resolve() at n/a:n/a
 call_user_func() at phar:///usr/local/bin/composer/vendor/react/promise/src/React/Promise/FulfilledPromise.php:20
 React\Promise\FulfilledPromise->then() at phar:///usr/local/bin/composer/vendor/react/promise/src/React/Promise/Deferred.php:78
 React\Promise\Deferred->React\Promise\{closure}() at n/a:n/a
 call_user_func() at phar:///usr/local/bin/composer/vendor/react/promise/src/React/Promise/Deferred.php:166
 React\Promise\Deferred->processQueue() at phar:///usr/local/bin/composer/vendor/react/promise/src/React/Promise/Deferred.php:95
 React\Promise\Deferred->resolve() at n/a:n/a
 call_user_func() at phar:///usr/local/bin/composer/vendor/react/promise/src/React/Promise/FulfilledPromise.php:20
 React\Promise\FulfilledPromise->then() at phar:///usr/local/bin/composer/vendor/react/promise/src/React/Promise/Deferred.php:78
 React\Promise\Deferred->React\Promise\{closure}() at n/a:n/a
 call_user_func() at phar:///usr/local/bin/composer/vendor/react/promise/src/React/Promise/Deferred.php:166
 React\Promise\Deferred->processQueue() at phar:///usr/local/bin/composer/vendor/react/promise/src/React/Promise/Deferred.php:95
 React\Promise\Deferred->resolve() at n/a:n/a
 call_user_func() at phar:///usr/local/bin/composer/vendor/react/promise/src/React/Promise/FulfilledPromise.php:20
 React\Promise\FulfilledPromise->then() at phar:///usr/local/bin/composer/vendor/react/promise/src/React/Promise/Deferred.php:78
 React\Promise\Deferred->React\Promise\{closure}() at n/a:n/a
 call_user_func() at phar:///usr/local/bin/composer/vendor/react/promise/src/React/Promise/Deferred.php:166
 React\Promise\Deferred->processQueue() at phar:///usr/local/bin/composer/vendor/react/promise/src/React/Promise/Deferred.php:95
 React\Promise\Deferred->resolve() at n/a:n/a
 call_user_func() at phar:///usr/local/bin/composer/vendor/react/promise/src/React/Promise/FulfilledPromise.php:20
 React\Promise\FulfilledPromise->then() at phar:///usr/local/bin/composer/vendor/react/promise/src/React/Promise/Deferred.php:78
 React\Promise\Deferred->React\Promise\{closure}() at n/a:n/a
 call_user_func() at phar:///usr/local/bin/composer/vendor/react/promise/src/React/Promise/Deferred.php:166
 React\Promise\Deferred->processQueue() at phar:///usr/local/bin/composer/vendor/react/promise/src/React/Promise/Deferred.php:95
 React\Promise\Deferred->resolve() at phar:///usr/local/bin/composer/vendor/react/promise/src/React/Promise/Promise.php:42
 React\Promise\Promise->React\Promise\{closure}() at n/a:n/a
 call_user_func() at phar:///usr/local/bin/composer/src/Composer/Util/ProcessExecutor.php:279
 Composer\Util\ProcessExecutor->countActiveJobs() at phar:///usr/local/bin/composer/src/Composer/Util/Loop.php:90
 Composer\Util\Loop->wait() at phar:///usr/local/bin/composer/src/Composer/Installer/InstallationManager.php:442
 Composer\Installer\InstallationManager->waitOnPromises() at phar:///usr/local/bin/composer/src/Composer/Installer/InstallationManager.php:432
 Composer\Installer\InstallationManager->executeBatch() at phar:///usr/local/bin/composer/src/Composer/Installer/InstallationManager.php:362
 Composer\Installer\InstallationManager->downloadAndExecuteBatch() at phar:///usr/local/bin/composer/src/Composer/Installer/InstallationManager.php:261
 Composer\Installer\InstallationManager->execute() at phar:///usr/local/bin/composer/src/Composer/Installer.php:711
 Composer\Installer->doInstall() at phar:///usr/local/bin/composer/src/Composer/Installer.php:546
 Composer\Installer->doUpdate() at phar:///usr/local/bin/composer/src/Composer/Installer.php:251
 Composer\Installer->run() at phar:///usr/local/bin/composer/src/Composer/Command/RequireCommand.php:321
 Composer\Command\RequireCommand->doUpdate() at phar:///usr/local/bin/composer/src/Composer/Command/RequireCommand.php:240
 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:309
 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:121
 Composer\Console\Application->run() at phar:///usr/local/bin/composer/bin/composer:63
 require() at /usr/local/bin/composer:24

require [--dev] [--dry-run] [--prefer-source] [--prefer-dist] [--fixed] [--no-suggest] [--no-progress] [--no-update] [--no-install] [--no-scripts] [--update-no-dev] [-w|--update-with-dependencies] [-W|--update-with-all-dependencies] [--with-dependencies] [--with-all-dependencies] [--ignore-platform-req IGNORE-PLATFORM-REQ] [--ignore-platform-reqs] [--prefer-stable] [--prefer-lowest] [--sort-packages] [-o|--optimize-autoloader] [-a|--classmap-authoritative] [--apcu-autoloader] [--apcu-autoloader-prefix APCU-AUTOLOADER-PREFIX] [--] [<packages>]...

Logs for composer 1.10.16

Loading config file /home/vagrant/.config/composer/config.json
Loading config file /home/vagrant/.config/composer/auth.json
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
Running 1.10.16 (2020-10-24 09:55:59) with PHP 7.2.34-4+ubuntu18.04.1+deb.sury.org+1 on Linux / 4.15.0-121-generic
Loading config file /home/vagrant/.config/composer/config.json
Loading config file /home/vagrant/.config/composer/auth.json
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 ./composer.json
Loading config file /home/vagrant/.config/composer/config.json
Loading config file /home/vagrant/.config/composer/auth.json
Loading config file ./composer.json
Checked CA file /etc/ssl/certs/ca-certificates.crt: valid
Executing command (/opt/locke): git branch -a --no-color --no-abbrev -v
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
Downloading https://repo.packagist.org/packages.json
Writing /home/vagrant/.cache/composer/repo/https---repo.packagist.org/packages.json into cache
Downloading http://repo.packagist.org/p/provider-2013%24acbd2e45013353e216085947882b5e8cb786c04353ba2097f44b0e66edb7a0cc.json
Writing /home/vagrant/.cache/composer/repo/https---repo.packagist.org/p-provider-2013.json into cache
Downloading http://repo.packagist.org/p/provider-2014%24e6509c09fca9034484d33aee011101493524449292c0201543b6640f8854c684.json
Writing /home/vagrant/.cache/composer/repo/https---repo.packagist.org/p-provider-2014.json into cache
Downloading http://repo.packagist.org/p/provider-2015%2434290f0b0a320054094e6002aa82792e57bed3e99141f65f1bc3aafa149640d4.json
Writing /home/vagrant/.cache/composer/repo/https---repo.packagist.org/p-provider-2015.json into cache
Downloading http://repo.packagist.org/p/provider-2016%24afe3501e2ff80b26a955db1d146ab42a2790e1b1eeffe63f3b5dc2583b4ab33e.json
Writing /home/vagrant/.cache/composer/repo/https---repo.packagist.org/p-provider-2016.json into cache
Downloading http://repo.packagist.org/p/provider-2017%24804bc09bf9551ec593fe2f52fec401f80e515a8c57a25c849260e69507b091f4.json
Writing /home/vagrant/.cache/composer/repo/https---repo.packagist.org/p-provider-2017.json into cache
Downloading http://repo.packagist.org/p/provider-2018%24e127c4a270ba1ba9dbae403b817728eb9f62e8451925d9392d01de2afa7f974d.json
Writing /home/vagrant/.cache/composer/repo/https---repo.packagist.org/p-provider-2018.json into cache
Downloading http://repo.packagist.org/p/provider-2019%24059649eb61418e11bf805c3ee304be774ae9ab978a33b67a295e084e749fd843.json
Writing /home/vagrant/.cache/composer/repo/https---repo.packagist.org/p-provider-2019.json into cache
Downloading http://repo.packagist.org/p/provider-2020-01%24d6d1224374f95c354db4ae7f1c05ee77a6c9a5a0effee9eaf2e7a1df248017bb.json
Writing /home/vagrant/.cache/composer/repo/https---repo.packagist.org/p-provider-2020-01.json into cache
Downloading http://repo.packagist.org/p/provider-2020-04%24389ca272fa41fe361e1778ce368cf9603ec0320e2839960ed877fd451abf581f.json
Writing /home/vagrant/.cache/composer/repo/https---repo.packagist.org/p-provider-2020-04.json into cache
Downloading http://repo.packagist.org/p/provider-2020-07%24ae033898079998758859cdd9946ffc1368c03ba364cf5dbca558fd3f0d4fc493.json
Writing /home/vagrant/.cache/composer/repo/https---repo.packagist.org/p-provider-2020-07.json into cache
Downloading http://repo.packagist.org/p/provider-2020-10%24a9412bf39306005ef84df205a9b528df408e9423b781e939ba230dca6ef3e68d.json
Writing /home/vagrant/.cache/composer/repo/https---repo.packagist.org/p-provider-2020-10.json into cache
Downloading http://repo.packagist.org/p/provider-archived%24073bf4b4185e3dc33697abac22011045de93fc49c623de5b280aeaf5ce29c8da.json
Writing /home/vagrant/.cache/composer/repo/https---repo.packagist.org/p-provider-archived.json into cache
Downloading http://repo.packagist.org/p/provider-latest%2492dc3cca7775bf1fca6a2de82fcdeb34f531eb0bed1b096ebb2b59502030ae52.json
Writing /home/vagrant/.cache/composer/repo/https---repo.packagist.org/p-provider-latest.json into cache
Downloading http://repo.packagist.org/p/symfony/flex%24584e29b6ca16d55ed1b539f84ddf38e3caf397236077fcafb653ebf0f304ec20.json
Writing /home/vagrant/.cache/composer/repo/https---repo.packagist.org/provider-symfony$flex.json into cache
Using version ^1.9 for symfony/flex
./composer.json has been created
Reading ./composer.json
Loading config file /home/vagrant/.config/composer/config.json
Loading config file /home/vagrant/.config/composer/auth.json
Loading config file ./composer.json
Executing command (/opt/locke): git branch -a --no-color --no-abbrev -v
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
Loading composer repositories with package information
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---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-2019.json from cache
Reading /home/vagrant/.cache/composer/repo/https---repo.packagist.org/p-provider-2020-01.json from cache
Reading /home/vagrant/.cache/composer/repo/https---repo.packagist.org/p-provider-2020-04.json from cache
Reading /home/vagrant/.cache/composer/repo/https---repo.packagist.org/p-provider-2020-07.json from cache
Reading /home/vagrant/.cache/composer/repo/https---repo.packagist.org/p-provider-2020-10.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-symfony$flex.json from cache
Resolving dependencies through SAT
Looking at all rules.

Dependency resolution completed in 0.000 seconds
Analyzed 207 packages to resolve dependencies
Analyzed 141 rules to resolve dependencies
Package operations: 1 install, 0 updates, 0 removals
Installs: symfony/flex:v1.9.10
  - Installing symfony/flex (v1.9.10): Reading /home/vagrant/.cache/composer/files/symfony/flex/c1dadf6c5cb3cc86f57dea466b102ccae1bf129d.zip from cache
Loading from cache
 Extracting archiveExecuting command (CWD): unzip -qq  '/opt/locke/vendor/symfony/flex/eca71a909cada0a224cc8d642b3af756' -d '/opt/locke/vendor/composer/13b2c8f0'
Plugin installation failed (include(/opt/locke/vendor/symfony/flex/src/Flex.php): failed to open stream: No such file or directory), rolling back
  - Removing symfony/flex (v1.9.10)

Installation failed, deleting ./composer.json.

                                                              
  [RuntimeException]                                          
  Could not delete /opt/locke/vendor/symfony/flex/src/Event:  
                                                              

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:611
 Composer\Installer->doInstall() at phar:///usr/local/bin/composer/src/Composer/Installer.php:232
 Composer\Installer->run() at phar:///usr/local/bin/composer/src/Composer/Command/RequireCommand.php:248
 Composer\Command\RequireCommand->doUpdate() at phar:///usr/local/bin/composer/src/Composer/Command/RequireCommand.php:205
 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:281
 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:113
 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] [--fixed] [--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>]...

When I use a workaround described elsewhere of creating a /usr/local/bin/zip like so it works under 1.x and today it also works for 2.x, but it failed yesterday 😕

#!/bin/sh

/usr/bin/unzip "\$@"
sleep 0.2
Logs for composer 1.10.16 with unzip workaround

Loading config file /home/vagrant/.config/composer/config.json
Loading config file /home/vagrant/.config/composer/auth.json
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
Running 1.10.16 (2020-10-24 09:55:59) with PHP 7.2.34-4+ubuntu18.04.1+deb.sury.org+1 on Linux / 4.15.0-121-generic
Loading config file /home/vagrant/.config/composer/config.json
Loading config file /home/vagrant/.config/composer/auth.json
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 ./composer.json
Loading config file /home/vagrant/.config/composer/config.json
Loading config file /home/vagrant/.config/composer/auth.json
Loading config file ./composer.json
Checked CA file /etc/ssl/certs/ca-certificates.crt: valid
Executing command (/opt/locke): git branch -a --no-color --no-abbrev -v
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
Downloading https://repo.packagist.org/packages.json
Writing /home/vagrant/.cache/composer/repo/https---repo.packagist.org/packages.json into 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
Downloading http://repo.packagist.org/p/provider-2019%24344d8d0f0ef90fe5816b11fd9ab4e973b0450577b61bb8bca4853311903f67dd.json
Writing /home/vagrant/.cache/composer/repo/https---repo.packagist.org/p-provider-2019.json into cache
Downloading http://repo.packagist.org/p/provider-2020-01%24eecc6d0f1e13e05b73b8d07f9d1e8c119f198d0ec9dff0a312dceb3e578484ed.json
Writing /home/vagrant/.cache/composer/repo/https---repo.packagist.org/p-provider-2020-01.json into cache
Downloading http://repo.packagist.org/p/provider-2020-04%24f161c03655c567d3faacb4a92eb0085c790f23a7f4166add17f3755a00f7304c.json
Writing /home/vagrant/.cache/composer/repo/https---repo.packagist.org/p-provider-2020-04.json into cache
Downloading http://repo.packagist.org/p/provider-2020-07%24584c4268c23e727804a81d63f2825026f87792b8af686a59a83d5c7a4e867a74.json
Writing /home/vagrant/.cache/composer/repo/https---repo.packagist.org/p-provider-2020-07.json into cache
Downloading http://repo.packagist.org/p/provider-2020-10%24f5ef03a8e39b9bf714596d144cfc4328143ddf246091bab1d835331fec08de78.json
Writing /home/vagrant/.cache/composer/repo/https---repo.packagist.org/p-provider-2020-10.json into cache
Reading /home/vagrant/.cache/composer/repo/https---repo.packagist.org/p-provider-archived.json from cache
Downloading http://repo.packagist.org/p/provider-latest%24cb4590e185558fc279e0bc2dc5a09ad319f0833442e830c717ff2ac2f84e1c48.json
Writing /home/vagrant/.cache/composer/repo/https---repo.packagist.org/p-provider-latest.json into cache
Reading /home/vagrant/.cache/composer/repo/https---repo.packagist.org/provider-symfony$flex.json from cache
Using version ^1.9 for symfony/flex
./composer.json has been created
Reading ./composer.json
Loading config file /home/vagrant/.config/composer/config.json
Loading config file /home/vagrant/.config/composer/auth.json
Loading config file ./composer.json
Executing command (/opt/locke): git branch -a --no-color --no-abbrev -v
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
Loading composer repositories with package information
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---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-2019.json from cache
Reading /home/vagrant/.cache/composer/repo/https---repo.packagist.org/p-provider-2020-01.json from cache
Reading /home/vagrant/.cache/composer/repo/https---repo.packagist.org/p-provider-2020-04.json from cache
Reading /home/vagrant/.cache/composer/repo/https---repo.packagist.org/p-provider-2020-07.json from cache
Reading /home/vagrant/.cache/composer/repo/https---repo.packagist.org/p-provider-2020-10.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-symfony$flex.json from cache
Resolving dependencies through SAT
Looking at all rules.

Dependency resolution completed in 0.000 seconds
Analyzed 207 packages to resolve dependencies
Analyzed 141 rules to resolve dependencies
Package operations: 1 install, 0 updates, 0 removals
Installs: symfony/flex:v1.9.10
  - Installing symfony/flex (v1.9.10): Reading /home/vagrant/.cache/composer/files/symfony/flex/c1dadf6c5cb3cc86f57dea466b102ccae1bf129d.zip from cache
Loading from cache
 Extracting archiveExecuting command (CWD): unzip -qq  '/opt/locke/vendor/symfony/flex/4374a6bbca6517c458cd805e6083a6be' -d '/opt/locke/vendor/composer/07ca4b5b'
Loading plugin Symfony\Flex\Flex
Downloading https://flex.symfony.com/versions.json
Writing /home/vagrant/.cache/composer/repo/https---flex.symfony.com/versions.json into cache
Downloading https://repo.packagist.org/packages.json
Writing /home/vagrant/.cache/composer/repo/https---repo.packagist.org/packages.json into 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-2019.json from cache
Reading /home/vagrant/.cache/composer/repo/https---repo.packagist.org/p-provider-2020-01.json from cache
Reading /home/vagrant/.cache/composer/repo/https---repo.packagist.org/p-provider-2020-04.json from cache
Reading /home/vagrant/.cache/composer/repo/https---repo.packagist.org/p-provider-2020-07.json from cache
Reading /home/vagrant/.cache/composer/repo/https---repo.packagist.org/p-provider-2020-10.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
    REASON: Required by the root package: Install command rule (install symfony/flex v1.9.0|install symfony/flex v1.9.1|install symfony/flex v1.9.10|install symfony/flex v1.9.2|install symfony/flex v1.9.3|install symfony/flex v1.9.4|install symfony/flex v1.9.5|install symfony/flex v1.9.6|install symfony/flex v1.9.7|install symfony/flex v1.9.8|install symfony/flex v1.9.9)


Run composer recipes at any time to see the status of your Symfony recipes.

Reading ./composer.json
Loading config file /home/vagrant/.config/composer/config.json
Loading config file /home/vagrant/.config/composer/auth.json
Loading config file ./composer.json
Executing command (/opt/locke): git branch -a --no-color --no-abbrev -v
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 /opt/locke/vendor/composer/installed.json
Loading plugin Symfony\Flex\Flex_composer_tmp0
Loading composer repositories with package information
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---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-2019.json from cache
Reading /home/vagrant/.cache/composer/repo/https---repo.packagist.org/p-provider-2020-01.json from cache
Reading /home/vagrant/.cache/composer/repo/https---repo.packagist.org/p-provider-2020-04.json from cache
Reading /home/vagrant/.cache/composer/repo/https---repo.packagist.org/p-provider-2020-07.json from cache
Reading /home/vagrant/.cache/composer/repo/https---repo.packagist.org/p-provider-2020-10.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-symfony$flex.json from cache
Resolving dependencies through SAT
Looking at all rules.

Dependency resolution completed in 0.001 seconds
Analyzed 208 packages to resolve dependencies
Analyzed 154 rules to resolve dependencies
Nothing to install or update
Reading /opt/locke/vendor/composer/installed.json
Writing lock file
Generating autoload files
1 package you are using is looking for funding.
Use the `composer fund` command to find out more!

Run composer recipes at any time to see the status of your Symfony recipes.

Reading ./composer.lock

Logs for composer 2.0.2 with unzip workaround

Loading config file /home/vagrant/.config/composer/config.json
Loading config file /home/vagrant/.config/composer/auth.json
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
Running 2.0.2 (2020-10-25 23:03:59) with PHP 7.4.11 on Linux / 4.15.0-121-generic
Loading config file /home/vagrant/.config/composer/config.json
Loading config file /home/vagrant/.config/composer/auth.json
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 ./composer.json
Loading config file /home/vagrant/.config/composer/config.json
Loading config file /home/vagrant/.config/composer/auth.json
Loading config file ./composer.json
Checked CA file /etc/ssl/certs/ca-certificates.crt: valid
Executing command (/opt/locke): git branch -a --no-color --no-abbrev -v
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
Downloading https://repo.packagist.org/packages.json
[200] https://repo.packagist.org/packages.json
Writing /home/vagrant/.cache/composer/repo/https---repo.packagist.org/packages.json into cache
Reading /home/vagrant/.cache/composer/repo/https---repo.packagist.org/provider-symfony~flex.json from cache
Downloading https://repo.packagist.org/p2/symfony/flex.json if modified
[304] https://repo.packagist.org/p2/symfony/flex.json
Using version ^1.9 for symfony/flex
./composer.json has been created
Reading ./composer.json
Loading config file /home/vagrant/.config/composer/config.json
Loading config file /home/vagrant/.config/composer/auth.json
Loading config file ./composer.json
Executing command (/opt/locke): git branch -a --no-color --no-abbrev -v
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
Running composer update symfony/flex
Loading composer repositories with package information
Updating dependencies
Downloading https://repo.packagist.org/packages.json
[200] https://repo.packagist.org/packages.json
Writing /home/vagrant/.cache/composer/repo/https---repo.packagist.org/packages.json into cache
Reading /home/vagrant/.cache/composer/repo/https---repo.packagist.org/provider-symfony~flex.json from cache
Downloading https://repo.packagist.org/p2/symfony/flex.json if modified
[304] https://repo.packagist.org/p2/symfony/flex.json
Generating rules
Resolving dependencies through SAT
Looking at all rules.

Dependency resolution completed in 0.001 seconds
Analyzed 92 packages to resolve dependencies
Analyzed 105 rules to resolve dependencies
Lock file operations: 1 install, 0 updates, 0 removals
Installs: symfony/flex:v1.9.10
  - Locking symfony/flex (v1.9.10)
Writing lock file
Installing dependencies from lock file (including require-dev)
Reading ./composer.lock
Package operations: 1 install, 0 updates, 0 removals
Installs: symfony/flex:v1.9.10
Reading /home/vagrant/.cache/composer/files/symfony/flex/c1dadf6c5cb3cc86f57dea466b102ccae1bf129d.zip from cache
  - Loading symfony/flex (v1.9.10) from cache
  - Installing symfony/flex (v1.9.10): Extracting archive
Executing async command (CWD): unzip -qq  '/opt/locke/vendor/composer/tmp-750af66359fd92cab5c4d7749044b315' -d '/opt/locke/vendor/composer/d0c7dabe'
Executing command (CWD): rm -rf '/opt/locke/vendor/symfony/flex'
Executing command (CWD): rm -rf '/opt/locke/vendor/composer/d0c7dabe'
Loading plugin Symfony\Flex\Flex
Reading /home/vagrant/.cache/composer/repo/https---flex.symfony.com/versions.json from cache
Downloading https://flex.symfony.com/versions.json if modified
[304] https://flex.symfony.com/versions.json
Executing command (CWD): rm -rf '/opt/locke/vendor/composer/'
> post-package-install: Symfony\Flex\Flex->record
> post-package-install: Symfony\Flex\Flex->checkForUpdate

Run composer recipes at any time to see the status of your Symfony recipes.

Reading ./composer.json
Loading config file /home/vagrant/.config/composer/config.json
Loading config file /home/vagrant/.config/composer/auth.json
Loading config file ./composer.json
Executing command (/opt/locke): git branch -a --no-color --no-abbrev -v
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 /opt/locke/vendor/composer/installed.json
Loading plugin Symfony\Flex\Flex_composer_tmp0
> pre-update-cmd: Symfony\Flex\Flex->configureInstaller
Loading composer repositories with package information
Updating dependencies
Reading /home/vagrant/.cache/composer/repo/https---repo.packagist.org/provider-symfony~flex.json from cache
> pre-pool-create: Symfony\Flex\Flex->truncatePackages
Generating rules
Resolving dependencies through SAT
Looking at all rules.

Dependency resolution completed in 0.000 seconds
Analyzed 92 packages to resolve dependencies
Analyzed 105 rules to resolve dependencies
Nothing to modify in lock file
Installing dependencies from lock file (including require-dev)
Nothing to install, update or remove
Generating autoload files
> post-autoload-dump: Symfony\Flex\Flex->updateAutoloadFile
1 package you are using is looking for funding.
Use the `composer fund` command to find out more!
> post-update-cmd: Symfony\Flex\Flex->update

Run composer recipes at any time to see the status of your Symfony recipes.

At any rate this somewhat proofs that unzip indicates it is done even though the files haven't been fully written to disk yet, or something somewhere isn't aware of them being there.

When I run this in my host machine all works well BTW.

@Seldaek
Copy link
Member

Seldaek commented Oct 28, 2020

Ok so definitely an environment issue with virtualbox. Hopefully they fix the issue.. Closing here as I am not sure what we can do about it.

@Seldaek Seldaek closed this as completed Oct 28, 2020
@rpkamp
Copy link
Author

rpkamp commented Oct 28, 2020

Hopefully they fix the issue..

It's been over a year, I'm not very hopeful.

Thanks for your time and consideration anyway!

@bilogic
Copy link
Contributor

bilogic commented Dec 27, 2020

@rpkamp do you know if the issue reported to VirtualBox? What I'm seeing is that no one has yet to really pin point what's causing the problem.

@rpkamp
Copy link
Author

rpkamp commented Dec 27, 2020

@bilogic I don't have proof, nor an idea how to go about proofing this, but I highly suspect a syncing issue with vboxfs

  1. composer calls unzip
  2. unzip unzips files and reports back it's it done - vboxfs however is still syncing files to the host OS, so files aren't really there (yet)
  3. composer wants to touch a file that was unzipped but can't find it (since it didn't fully sync yet)

When I use the hack I described above with sleep 0.1 after each unzip everything works fine, all the time. Leading me to believe this is indeed a timing issue.

And yes, there are multiple issues on VirtualBox and vagrant, but nobody thinks it's their problem and won't fix it 🤷

@bilogic
Copy link
Contributor

bilogic commented Dec 27, 2020

@rpkamp Sorry, read too fast. Anyway, I agree with your analysis. Do you have any links I could follow up on?

@rpkamp
Copy link
Author

rpkamp commented Dec 27, 2020

This is pretty much the biggest issue that links to all kinds of places: Ocramius/PackageVersions#107

@bilogic
Copy link
Contributor

bilogic commented Dec 27, 2020

Ok, thanks, but it isn't at VirtualBox. I doubt it will get anywhere.
Like you, I have no proof of root cause, thus no keyword to search on. Perhaps moving to WSL2 is the way.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants