composer

composer

Member Since 10 years ago

Experience Points
0
follower
Lessons Completed
0
follow
Best Reply Awards
17
repos
Jun
23
9 hours ago
started
started time in 1 hour ago
started
started time in 2 hours ago
Activity icon
fork

petridahura73 forked composer/composer

⚡ Dependency Manager for PHP
petridahura73 MIT License Updated
fork time in 7 hours ago
Activity icon
fork

Mu-L forked composer/satis

⚡ Simple static Composer repository generator - For a full private Composer repo use Private Packagist
Mu-L MIT License Updated
fork time in 8 hours ago
Jun
22
1 day ago
started
started time in 10 hours ago
Activity icon
issue

dmitskevich issue composer/composer

dmitskevich
dmitskevich

Failed to extract xyz: (-1) '/usr/bin/unzip' -qq

My composer.json:

I don't have one.

Output of composer diagnose:

     [exec] Checking platform settings: OK
     [exec] Checking git settings: OK
     [exec] Checking http connectivity to packagist: OK
     [exec] Checking https connectivity to packagist: OK
     [exec] Checking github.com rate limit: OK
     [exec] Checking disk free space: OK
     [exec] Checking pubkeys: 
     [exec] Tags Public Key Fingerprint: 57815BA2 7E54DC31 7ECC7CC5 573090D0  87719BA6 8F3BB723 4E5D42D0 84A14642
     [exec] Dev Public Key Fingerprint: 4AC45767 E5EC2265 2F0C1167 CBBB8A2B  0C708369 153E328C AD90147D AFE50952
     [exec] OK
     [exec] Checking composer version: OK
     [exec] Composer version: 2.1.3
     [exec] PHP version: 7.4.20
     [exec] PHP binary path: /local/home/dima/PHP/PHP-7.4/bin/php
     [exec] OpenSSL version: OpenSSL 1.0.2u  20 Dec 2019
     [exec] cURL version: 7.74.0 libz 1.2.11 ssl OpenSSL/1.0.2u
     [exec] zip: extension not loaded, unzip present

When I run this command:

php build/composer.phar require doctrine/cache -d src -vvv

I get the following output:

     [exec] Failed to initialize global composer: Composer could not find the config file: /home/dima/.config/composer/composer.json
     [exec] To initialize a project, please create a composer.json file as described in the https://getcomposer.org/ "Getting Started" section
     [exec] Running 2.1.3 (2021-06-09 16:31:20) with PHP 7.4.20 on Linux / 5.4.116-64.217.amzn2int.x86_64
     [exec] Failed to initialize global composer: Composer could not find the config file: /home/dima/.config/composer/composer.json
     [exec] To initialize a project, please create a composer.json file as described in the https://getcomposer.org/ "Getting Started" section
     [exec] Reading ./composer.json (/project/src/composer.json)
     [exec] Loading config file ./composer.json (/project/src/composer.json)
     [exec] Checked CA file /etc/pki/ca-trust/extracted/pem/tls-ca-bundle.pem: valid
     [exec] Executing command (/project/src): git branch -a --no-color --no-abbrev -v
     [exec] Executing command (/project/src): git describe --exact-match --tags
     [exec] Executing command (CWD): git --version
     [exec] Executing command (/project/src): git log --pretty="%H" -n1 HEAD
     [exec] Executing command (/project/src): hg branch
     [exec] Executing command (/project/src): fossil branch list
     [exec] Executing command (/project/src): fossil tag list
     [exec] Executing command (/project/src): svn info --xml
     [exec] Failed to initialize global composer: Composer could not find the config file: /home/dima/.config/composer/composer.json
     [exec]
     [exec] Downloading https://repo.packagist.org/packages.json
     [exec] [200] https://repo.packagist.org/packages.json
     [exec] Writing /home/dima/.cache/composer/repo/https---repo.packagist.org/packages.json into cache
     [exec] Reading /home/dima/.cache/composer/repo/https---repo.packagist.org/provider-doctrine~cache.json from cache
     [exec] Downloading https://repo.packagist.org/p2/doctrine/cache.json if modified
     [exec] [304] https://repo.packagist.org/p2/doctrine/cache.json
     [exec] Using version ^2.0 for doctrine/cache
     [exec] ./composer.json has been created
     [exec] Reading ./composer.json (/project/src/composer.json)
     [exec] Loading config file ./composer.json (/project/src/composer.json)
     [exec] Executing command (/project/src): git branch -a --no-color --no-abbrev -v
     [exec] Executing command (/project/src): git describe --exact-match --tags
     [exec] Executing command (/project/src): git log --pretty="%H" -n1 HEAD
     [exec] Executing command (/project/src): hg branch
     [exec] Executing command (/project/src): fossil branch list
     [exec] Executing command (/project/src): fossil tag list
     [exec] Executing command (/project/src): svn info --xml
     [exec] Failed to initialize global composer: Composer could not find the config file: /home/dima/.config/composer/composer.json
     [exec]
     [exec] Running composer update doctrine/cache
     [exec] Loading composer repositories with package information
     [exec] Downloading https://repo.packagist.org/packages.json
     [exec] [200] https://repo.packagist.org/packages.json
     [exec] Writing /home/dima/.cache/composer/repo/https---repo.packagist.org/packages.json into cache
     [exec] Reading /home/dima/.cache/composer/repo/https---repo.packagist.org/provider-doctrine~cache.json from cache
     [exec] Downloading https://repo.packagist.org/p2/doctrine/cache.json if modified
     [exec] [304] https://repo.packagist.org/p2/doctrine/cache.json
     [exec] Updating dependencies
     [exec] Generating rules
     [exec] Resolving dependencies through SAT
     [exec] Looking at all rules.
     [exec]
     [exec] Dependency resolution completed in 0.000 seconds
     [exec] Analyzed 65 packages to resolve dependencies
     [exec] Analyzed 67 rules to resolve dependencies
     [exec] Lock file operations: 1 install, 0 updates, 0 removals
     [exec] Installs: doctrine/cache:2.0.3
     [exec]   - Locking doctrine/cache (2.0.3)
     [exec] Writing lock file
     [exec] Installing dependencies from lock file (including require-dev)
     [exec] Reading ./composer.lock (/project/src/composer.lock)
     [exec] Package operations: 1 install, 0 updates, 0 removals
     [exec] Installs: doctrine/cache:2.0.3
     [exec] Reading /home/dima/.cache/composer/files/doctrine/cache/92b7dbb84ca3ba3ec5ad280db72a4b3d0732957e.zip from cache
     [exec]   - Loading doctrine/cache (2.0.3) from cache
     [exec]   - Installing doctrine/cache (2.0.3): Extracting archive
     [exec] Executing async command (CWD): '/usr/bin/unzip' -qq '/project/src/vendor/composer/tmp-af412d4a77b0c99b988402177a6409ae' -d '/project/src/vendor/composer/0b0c048b'
     [exec] Executing command (CWD): rm -rf '/project/src/vendor/composer/0b0c048b'
     [exec] Executing command (CWD): rm -rf '/project/src/vendor/doctrine/cache'
     [exec]     Install of doctrine/cache failed
     [exec] Downloading https://packagist.org/downloads/
     [exec] [201] https://packagist.org/downloads/
     [exec]
     [exec] Installation failed, deleting ./composer.json.
     [exec]
     [exec]
     [exec]   [RuntimeException]
     [exec]   Failed to extract doctrine/cache: (-1) '/usr/bin/unzip' -qq '/project/src/vendor/composer/tmp-af412d4a77b0c99b988402177a6409ae' -d '/project/src/vendor/composer/0b0c048b'
     [exec]
     [exec]
     [exec] Exception trace:
     [exec]  () at phar:///build/composer.phar/src/Composer/Downloader/ZipDownloader.php:126
     [exec]  Composer\Downloader\ZipDownloader->Composer\Downloader\{closure}() at n/a:n/a
     [exec]  call_user_func() at phar:///build/composer.phar/vendor/react/promise/src/React/Promise/FulfilledPromise.php:20
     [exec]  React\Promise\FulfilledPromise->then() at phar:///build/composer.phar/vendor/react/promise/src/React/Promise/Deferred.php:74
     [exec]  React\Promise\Deferred->React\Promise\{closure}() at n/a:n/a
     [exec]  call_user_func() at phar:///build/composer.phar/vendor/react/promise/src/React/Promise/Deferred.php:166
     [exec]  React\Promise\Deferred->processQueue() at phar:///build/composer.phar/vendor/react/promise/src/React/Promise/Deferred.php:95
     [exec]  React\Promise\Deferred->resolve() at n/a:n/a
     [exec]  call_user_func() at phar:///build/composer.phar/vendor/react/promise/src/React/Promise/FulfilledPromise.php:20
     [exec]  React\Promise\FulfilledPromise->then() at phar:///build/composer.phar/vendor/react/promise/src/React/Promise/Deferred.php:76
     [exec]  React\Promise\Deferred->React\Promise\{closure}() at n/a:n/a
     [exec]  call_user_func() at phar:///build/composer.phar/vendor/react/promise/src/React/Promise/Deferred.php:166
     [exec]  React\Promise\Deferred->processQueue() at phar:///build/composer.phar/vendor/react/promise/src/React/Promise/Deferred.php:95
     [exec]  React\Promise\Deferred->resolve() at phar:///build/composer.phar/vendor/react/promise/src/React/Promise/Promise.php:42
     [exec]  React\Promise\Promise->React\Promise\{closure}() at n/a:n/a
     [exec]  call_user_func() at phar:///build/composer.phar/src/Composer/Util/ProcessExecutor.php:316
     [exec]  Composer\Util\ProcessExecutor->countActiveJobs() at phar:///build/composer.phar/src/Composer/Util/Loop.php:92
     [exec]  Composer\Util\Loop->wait() at phar:///build/composer.phar/src/Composer/Installer/InstallationManager.php:462
     [exec]  Composer\Installer\InstallationManager->waitOnPromises() at phar:///build/composer.phar/src/Composer/Installer/InstallationManager.php:440
     [exec]  Composer\Installer\InstallationManager->executeBatch() at phar:///build/composer.phar/src/Composer/Installer/InstallationManager.php:367
     [exec]  Composer\Installer\InstallationManager->downloadAndExecuteBatch() at phar:///build/composer.phar/src/Composer/Installer/InstallationManager.php:266
     [exec]  Composer\Installer\InstallationManager->execute() at phar:///build/composer.phar/src/Composer/Installer.php:706
     [exec]  Composer\Installer->doInstall() at phar:///build/composer.phar/src/Composer/Installer.php:543
     [exec]  Composer\Installer->doUpdate() at phar:///build/composer.phar/src/Composer/Installer.php:247
     [exec]  Composer\Installer->run() at phar:///build/composer.phar/src/Composer/Command/RequireCommand.php:383
     [exec]  Composer\Command\RequireCommand->doUpdate() at phar:///build/composer.phar/src/Composer/Command/RequireCommand.php:266
     [exec]  Composer\Command\RequireCommand->execute() at phar:///build/composer.phar/vendor/symfony/console/Command/Command.php:245
     [exec]  Symfony\Component\Console\Command\Command->run() at phar:///build/composer.phar/vendor/symfony/console/Application.php:835
     [exec]  Symfony\Component\Console\Application->doRunCommand() at phar:///build/composer.phar/vendor/symfony/console/Application.php:185
     [exec]  Symfony\Component\Console\Application->doRun() at phar:///build/composer.phar/src/Composer/Console/Application.php:312
     [exec]  Composer\Console\Application->doRun() at phar:///build/composer.phar/vendor/symfony/console/Application.php:117
     [exec]  Symfony\Component\Console\Application->run() at phar:///build/composer.phar/src/Composer/Console/Application.php:125
     [exec]  Composer\Console\Application->run() at phar:///build/composer.phar/bin/composer:64
     [exec]  require() at /build/composer.phar:24
     [exec]
     [exec] require [--dev] [--dry-run] [--prefer-source] [--prefer-dist] [--prefer-install PREFER-INSTALL] [--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>]...
     [exec]

And I expected this to happen:

  • should not fail
started
started time in 16 hours ago
Activity icon
fork

JParkinson1991 forked composer/package-versions-deprecated

⚡ :package: Composer addon to efficiently get installed packages' version numbers
JParkinson1991 MIT License Updated
fork time in 18 hours ago
started
started time in 19 hours ago
Activity icon
issue

dmpinder issue comment composer/composer

dmpinder
dmpinder

ZIP uncompress errors when installing/updating dependencies

My composer.json:

    "require": {
        "php"                                      : ">=5.5.9",
        "algolia/algoliasearch-client-php"         : "^1.6",
        "beberlei/metrics"                         : "^2.0",

        "// ... and more packages here"
    }

Output of composer diagnose:

$ composer diagnose

Checking composer.json: OK
Checking platform settings: OK
Checking git settings: OK
Checking http connectivity to packagist: OK
Checking https connectivity to packagist: OK
Checking github.com oauth access: OK
Checking disk free space: OK
Checking pubkeys:
Tags Public Key Fingerprint: 57815BA2 7E54DC31 7ECC7CC5 573090D0  87719BA6 8F3BB723 4E5D42D0 84A14642
Dev Public Key Fingerprint: 4AC45767 E5EC2265 2F0C1167 CBBB8A2B  0C708369 153E328C AD90147D AFE50952
OK
Checking composer version: OK

When I run this command:

$ composer install

I get the following output:

- Installing beberlei/metrics (v2.3.0)
    Downloading: 100%
    Update failed ('<my-project>/vendor/beberlei/metrics/18ddcb3d31a1a6b6aaf65fef675bc3c9' is not a zip archive.
Failed to execute unzip '<my-project>/vendor/beberlei/metrics/18ddcb3d31a1a6b6aaf65fef675bc3c9' -d '<my-project>/vendor/composer/9c528af1' && chmod -R u+w '<my-project>/vendor/composer/9c528af1'

  End-of-central-directory signature not found.  Either this file is not
  a zipfile, or it constitutes one disk of a multi-part archive.  In the
  latter case the central directory and zipfile comment will be found on
  the last disk(s) of this archive.
unzip:  cannot find zipfile directory in one of <my-project>/vendor/beberlei/metrics/18ddcb3d31a1a6b6aaf65fef675bc3c9 or
        <my-project>/vendor/beberlei/metrics/18ddcb3d31a1a6b6aaf65fef675bc3c9.zip, and cannot find <my-project>/vendor/beberlei/metrics/18ddcb3d31a1a6b6aaf65fef675bc3c9.ZIP, period.)
    Would you like to try reinstalling the package instead [yes]?

  - Removing beberlei/metrics (v2.4.0)
  - Installing beberlei/metrics (v2.3.0)
    Downloading: 100%
    Invalid zip file, retrying...
  - Installing beberlei/metrics (v2.3.0)
    Downloading: 100%
    Invalid zip file, retrying...
  - Installing beberlei/metrics (v2.3.0)
    Downloading: 100%
    Failed to download beberlei/metrics from dist: '<my-project>/vendor/beberlei/metrics/18ddcb3d31a1a6b6aaf65fef675bc3c9' is not a zip archive.

    Now trying to download from source
    [...]

    (and the package is installed correctly)

At the end the packages are installed ... but after several retries and after downloading them from source, which is much slower. The error happens randomly for some packages, but not for all of them.

This never happened to me before. The only recent change that I made was installing PHP 7.1:

PHP 7.1.0 (cli) (built: Dec  2 2016 09:19:56) ( NTS )
Copyright (c) 1997-2016 The PHP Group
Zend Engine v3.1.0-dev, Copyright (c) 1998-2016 Zend Technologies
    with Zend OPcache v7.1.0, Copyright (c) 1999-2016, by Zend Technologies
    with blackfire v1.14.1~mac-x64-non_zts71, https://blackfire.io, by Blackfireio Inc.
dmpinder
dmpinder

I had the same issue. It seems that some downloaded zip files were broken. Run composer clearcache solved my problem.

This worked for me, thanks!

Activity icon
issue

dmitskevich issue comment composer/composer

dmitskevich
dmitskevich

Failed to extract xyz: (-1) '/usr/bin/unzip' -qq

My composer.json:

I don't have one.

Output of composer diagnose:

     [exec] Checking platform settings: OK
     [exec] Checking git settings: OK
     [exec] Checking http connectivity to packagist: OK
     [exec] Checking https connectivity to packagist: OK
     [exec] Checking github.com rate limit: OK
     [exec] Checking disk free space: OK
     [exec] Checking pubkeys: 
     [exec] Tags Public Key Fingerprint: 57815BA2 7E54DC31 7ECC7CC5 573090D0  87719BA6 8F3BB723 4E5D42D0 84A14642
     [exec] Dev Public Key Fingerprint: 4AC45767 E5EC2265 2F0C1167 CBBB8A2B  0C708369 153E328C AD90147D AFE50952
     [exec] OK
     [exec] Checking composer version: OK
     [exec] Composer version: 2.1.3
     [exec] PHP version: 7.4.20
     [exec] PHP binary path: /local/home/dima/PHP/PHP-7.4/bin/php
     [exec] OpenSSL version: OpenSSL 1.0.2u  20 Dec 2019
     [exec] cURL version: 7.74.0 libz 1.2.11 ssl OpenSSL/1.0.2u
     [exec] zip: extension not loaded, unzip present

When I run this command:

php -c tst/php.ini build/composer.phar require doctrine/cache -d src -vvv

I get the following output:

     [exec] Failed to initialize global composer: Composer could not find the config file: /home/dima/.config/composer/composer.json
     [exec] To initialize a project, please create a composer.json file as described in the https://getcomposer.org/ "Getting Started" section
     [exec] Running 2.1.3 (2021-06-09 16:31:20) with PHP 7.4.20 on Linux / 5.4.116-64.217.amzn2int.x86_64
     [exec] Failed to initialize global composer: Composer could not find the config file: /home/dima/.config/composer/composer.json
     [exec] To initialize a project, please create a composer.json file as described in the https://getcomposer.org/ "Getting Started" section
     [exec] Reading ./composer.json (/project/src/composer.json)
     [exec] Loading config file ./composer.json (/project/src/composer.json)
     [exec] Checked CA file /etc/pki/ca-trust/extracted/pem/tls-ca-bundle.pem: valid
     [exec] Executing command (/project/src): git branch -a --no-color --no-abbrev -v
     [exec] Executing command (/project/src): git describe --exact-match --tags
     [exec] Executing command (CWD): git --version
     [exec] Executing command (/project/src): git log --pretty="%H" -n1 HEAD
     [exec] Executing command (/project/src): hg branch
     [exec] Executing command (/project/src): fossil branch list
     [exec] Executing command (/project/src): fossil tag list
     [exec] Executing command (/project/src): svn info --xml
     [exec] Failed to initialize global composer: Composer could not find the config file: /home/dima/.config/composer/composer.json
     [exec]
     [exec] Downloading https://repo.packagist.org/packages.json
     [exec] [200] https://repo.packagist.org/packages.json
     [exec] Writing /home/dima/.cache/composer/repo/https---repo.packagist.org/packages.json into cache
     [exec] Reading /home/dima/.cache/composer/repo/https---repo.packagist.org/provider-doctrine~cache.json from cache
     [exec] Downloading https://repo.packagist.org/p2/doctrine/cache.json if modified
     [exec] [304] https://repo.packagist.org/p2/doctrine/cache.json
     [exec] Using version ^2.0 for doctrine/cache
     [exec] ./composer.json has been created
     [exec] Reading ./composer.json (/project/src/composer.json)
     [exec] Loading config file ./composer.json (/project/src/composer.json)
     [exec] Executing command (/project/src): git branch -a --no-color --no-abbrev -v
     [exec] Executing command (/project/src): git describe --exact-match --tags
     [exec] Executing command (/project/src): git log --pretty="%H" -n1 HEAD
     [exec] Executing command (/project/src): hg branch
     [exec] Executing command (/project/src): fossil branch list
     [exec] Executing command (/project/src): fossil tag list
     [exec] Executing command (/project/src): svn info --xml
     [exec] Failed to initialize global composer: Composer could not find the config file: /home/dima/.config/composer/composer.json
     [exec]
     [exec] Running composer update doctrine/cache
     [exec] Loading composer repositories with package information
     [exec] Downloading https://repo.packagist.org/packages.json
     [exec] [200] https://repo.packagist.org/packages.json
     [exec] Writing /home/dima/.cache/composer/repo/https---repo.packagist.org/packages.json into cache
     [exec] Reading /home/dima/.cache/composer/repo/https---repo.packagist.org/provider-doctrine~cache.json from cache
     [exec] Downloading https://repo.packagist.org/p2/doctrine/cache.json if modified
     [exec] [304] https://repo.packagist.org/p2/doctrine/cache.json
     [exec] Updating dependencies
     [exec] Generating rules
     [exec] Resolving dependencies through SAT
     [exec] Looking at all rules.
     [exec]
     [exec] Dependency resolution completed in 0.000 seconds
     [exec] Analyzed 65 packages to resolve dependencies
     [exec] Analyzed 67 rules to resolve dependencies
     [exec] Lock file operations: 1 install, 0 updates, 0 removals
     [exec] Installs: doctrine/cache:2.0.3
     [exec]   - Locking doctrine/cache (2.0.3)
     [exec] Writing lock file
     [exec] Installing dependencies from lock file (including require-dev)
     [exec] Reading ./composer.lock (/project/src/composer.lock)
     [exec] Package operations: 1 install, 0 updates, 0 removals
     [exec] Installs: doctrine/cache:2.0.3
     [exec] Reading /home/dima/.cache/composer/files/doctrine/cache/92b7dbb84ca3ba3ec5ad280db72a4b3d0732957e.zip from cache
     [exec]   - Loading doctrine/cache (2.0.3) from cache
     [exec]   - Installing doctrine/cache (2.0.3): Extracting archive
     [exec] Executing async command (CWD): '/usr/bin/unzip' -qq '/project/src/vendor/composer/tmp-af412d4a77b0c99b988402177a6409ae' -d '/project/src/vendor/composer/0b0c048b'
     [exec] Executing command (CWD): rm -rf '/project/src/vendor/composer/0b0c048b'
     [exec] Executing command (CWD): rm -rf '/project/src/vendor/doctrine/cache'
     [exec]     Install of doctrine/cache failed
     [exec] Downloading https://packagist.org/downloads/
     [exec] [201] https://packagist.org/downloads/
     [exec]
     [exec] Installation failed, deleting ./composer.json.
     [exec]
     [exec]
     [exec]   [RuntimeException]
     [exec]   Failed to extract doctrine/cache: (-1) '/usr/bin/unzip' -qq '/project/src/vendor/composer/tmp-af412d4a77b0c99b988402177a6409ae' -d '/project/src/vendor/composer/0b0c048b'
     [exec]
     [exec]
     [exec] Exception trace:
     [exec]  () at phar:///build/composer.phar/src/Composer/Downloader/ZipDownloader.php:126
     [exec]  Composer\Downloader\ZipDownloader->Composer\Downloader\{closure}() at n/a:n/a
     [exec]  call_user_func() at phar:///build/composer.phar/vendor/react/promise/src/React/Promise/FulfilledPromise.php:20
     [exec]  React\Promise\FulfilledPromise->then() at phar:///build/composer.phar/vendor/react/promise/src/React/Promise/Deferred.php:74
     [exec]  React\Promise\Deferred->React\Promise\{closure}() at n/a:n/a
     [exec]  call_user_func() at phar:///build/composer.phar/vendor/react/promise/src/React/Promise/Deferred.php:166
     [exec]  React\Promise\Deferred->processQueue() at phar:///build/composer.phar/vendor/react/promise/src/React/Promise/Deferred.php:95
     [exec]  React\Promise\Deferred->resolve() at n/a:n/a
     [exec]  call_user_func() at phar:///build/composer.phar/vendor/react/promise/src/React/Promise/FulfilledPromise.php:20
     [exec]  React\Promise\FulfilledPromise->then() at phar:///build/composer.phar/vendor/react/promise/src/React/Promise/Deferred.php:76
     [exec]  React\Promise\Deferred->React\Promise\{closure}() at n/a:n/a
     [exec]  call_user_func() at phar:///build/composer.phar/vendor/react/promise/src/React/Promise/Deferred.php:166
     [exec]  React\Promise\Deferred->processQueue() at phar:///build/composer.phar/vendor/react/promise/src/React/Promise/Deferred.php:95
     [exec]  React\Promise\Deferred->resolve() at phar:///build/composer.phar/vendor/react/promise/src/React/Promise/Promise.php:42
     [exec]  React\Promise\Promise->React\Promise\{closure}() at n/a:n/a
     [exec]  call_user_func() at phar:///build/composer.phar/src/Composer/Util/ProcessExecutor.php:316
     [exec]  Composer\Util\ProcessExecutor->countActiveJobs() at phar:///build/composer.phar/src/Composer/Util/Loop.php:92
     [exec]  Composer\Util\Loop->wait() at phar:///build/composer.phar/src/Composer/Installer/InstallationManager.php:462
     [exec]  Composer\Installer\InstallationManager->waitOnPromises() at phar:///build/composer.phar/src/Composer/Installer/InstallationManager.php:440
     [exec]  Composer\Installer\InstallationManager->executeBatch() at phar:///build/composer.phar/src/Composer/Installer/InstallationManager.php:367
     [exec]  Composer\Installer\InstallationManager->downloadAndExecuteBatch() at phar:///build/composer.phar/src/Composer/Installer/InstallationManager.php:266
     [exec]  Composer\Installer\InstallationManager->execute() at phar:///build/composer.phar/src/Composer/Installer.php:706
     [exec]  Composer\Installer->doInstall() at phar:///build/composer.phar/src/Composer/Installer.php:543
     [exec]  Composer\Installer->doUpdate() at phar:///build/composer.phar/src/Composer/Installer.php:247
     [exec]  Composer\Installer->run() at phar:///build/composer.phar/src/Composer/Command/RequireCommand.php:383
     [exec]  Composer\Command\RequireCommand->doUpdate() at phar:///build/composer.phar/src/Composer/Command/RequireCommand.php:266
     [exec]  Composer\Command\RequireCommand->execute() at phar:///build/composer.phar/vendor/symfony/console/Command/Command.php:245
     [exec]  Symfony\Component\Console\Command\Command->run() at phar:///build/composer.phar/vendor/symfony/console/Application.php:835
     [exec]  Symfony\Component\Console\Application->doRunCommand() at phar:///build/composer.phar/vendor/symfony/console/Application.php:185
     [exec]  Symfony\Component\Console\Application->doRun() at phar:///build/composer.phar/src/Composer/Console/Application.php:312
     [exec]  Composer\Console\Application->doRun() at phar:///build/composer.phar/vendor/symfony/console/Application.php:117
     [exec]  Symfony\Component\Console\Application->run() at phar:///build/composer.phar/src/Composer/Console/Application.php:125
     [exec]  Composer\Console\Application->run() at phar:///build/composer.phar/bin/composer:64
     [exec]  require() at /build/composer.phar:24
     [exec]
     [exec] require [--dev] [--dry-run] [--prefer-source] [--prefer-dist] [--prefer-install PREFER-INSTALL] [--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>]...
     [exec]

And I expected this to happen:

  • should not fail
dmitskevich
dmitskevich

It works if I change Composer code to do a "synchronous" call instead of "asynchronous" one:

Executing async command (CWD): '/usr/bin/unzip' -qq '/project/src/vendor/composer/tmp-af412d4a77b0c99b988402177a6409ae' -d '/project/src/vendor/composer/0b0c048b'
Activity icon
issue

andypost issue composer/composer

andypost
andypost

Compatibility with PHP 8.1

Running composer on PHP 8.1 (alpha1) throws deprecation notice Deprecation Notice: strlen(): Passing null to parameter #1 ($string) of type string is deprecated in phar:///usr/local/bin/composer/vendor/justinrainbow/json-schema/src/JsonSchema/Constraints/Constraint.php:48

The related fix https://github.com/justinrainbow/json-schema/pull/666

Activity icon
issue

andypost issue comment composer/composer

andypost
andypost

Compatibility with PHP 8.1

Running composer on PHP 8.1 (alpha1) throws deprecation notice Deprecation Notice: strlen(): Passing null to parameter #1 ($string) of type string is deprecated in phar:///usr/local/bin/composer/vendor/justinrainbow/json-schema/src/JsonSchema/Constraints/Constraint.php:48

The related fix https://github.com/justinrainbow/json-schema/pull/666

Activity icon
issue

stof issue comment composer/composer

stof
stof

Compatibility with PHP 8.1

Running composer on PHP 8.1 (alpha1) throws deprecation notice Deprecation Notice: strlen(): Passing null to parameter #1 ($string) of type string is deprecated in phar:///usr/local/bin/composer/vendor/justinrainbow/json-schema/src/JsonSchema/Constraints/Constraint.php:48

The related fix https://github.com/justinrainbow/json-schema/pull/666

Activity icon
issue

andypost issue composer/composer

andypost
andypost

Compatibility with PHP 8.1

Running composer on PHP 8.1 (alpha1) throws deprecation notice Deprecation Notice: strlen(): Passing null to parameter #1 ($string) of type string is deprecated in phar:///usr/local/bin/composer/vendor/justinrainbow/json-schema/src/JsonSchema/Constraints/Constraint.php:48

The related fix https://github.com/justinrainbow/json-schema/pull/666

Activity icon
issue

dmitskevich issue composer/composer

dmitskevich
dmitskevich

Failed to extract xyz: (-1) '/usr/bin/unzip' -qq

My composer.json:

I don't have one.

Output of composer diagnose:

     [exec] Checking platform settings: OK
     [exec] Checking git settings: OK
     [exec] Checking http connectivity to packagist: OK
     [exec] Checking https connectivity to packagist: OK
     [exec] Checking github.com rate limit: OK
     [exec] Checking disk free space: OK
     [exec] Checking pubkeys: 
     [exec] Tags Public Key Fingerprint: 57815BA2 7E54DC31 7ECC7CC5 573090D0  87719BA6 8F3BB723 4E5D42D0 84A14642
     [exec] Dev Public Key Fingerprint: 4AC45767 E5EC2265 2F0C1167 CBBB8A2B  0C708369 153E328C AD90147D AFE50952
     [exec] OK
     [exec] Checking composer version: OK
     [exec] Composer version: 2.1.3
     [exec] PHP version: 7.4.20
     [exec] PHP binary path: /local/home/dima/PHP/PHP-7.4
     .PTHREAD/build/bin/php
     [exec] OpenSSL version: OpenSSL 1.0.2u  20 Dec 2019
     [exec] cURL version: 7.74.0 libz 1.2.11 ssl OpenSSL/1.0.2u
     [exec] zip: extension not loaded, unzip present

When I run this command:

php -c tst/php.ini build/composer.phar require doctrine/cache -d src -vvv

I get the following output:

     [exec] All settings correct for using Composer
     [exec] Downloading...
     [exec]
     [exec] Composer (version 2.1.3) successfully installed to: /build/composer.phar
     [exec] Use it: php build/composer.phar
     [exec]
    [mkdir] Created dir: /project/src
    [first] Building symlink farm of 41 packages from package cache
    [first] Caching runtime components of dependencies
    [first] Successfully created environment at /build/private/tmp/brazil-path/testrun.runtimefarm
     [exec] Changed CWD to /project/src
     [exec] Failed to initialize global composer: Composer could not find the config file: /home/dima/.config/composer/composer.json
     [exec] To initialize a project, please create a composer.json file as described in the https://getcomposer.org/ "Getting Started" section
     [exec] Running 2.1.3 (2021-06-09 16:31:20) with PHP 7.4.20 on Linux / 5.4.116-64.217.amzn2int.x86_64
     [exec] Failed to initialize global composer: Composer could not find the config file: /home/dima/.config/composer/composer.json
     [exec] To initialize a project, please create a composer.json file as described in the https://getcomposer.org/ "Getting Started" section
     [exec] Reading ./composer.json (/project/src/composer.json)
     [exec] Loading config file ./composer.json (/project/src/composer.json)
     [exec] Checked CA file /etc/pki/ca-trust/extracted/pem/tls-ca-bundle.pem: valid
     [exec] Executing command (/project/src): git branch -a --no-color --no-abbrev -v
     [exec] Executing command (/project/src): git describe --exact-match --tags
     [exec] Executing command (CWD): git --version
     [exec] Executing command (/project/src): git log --pretty="%H" -n1 HEAD
     [exec] Executing command (/project/src): hg branch
     [exec] Executing command (/project/src): fossil branch list
     [exec] Executing command (/project/src): fossil tag list
     [exec] Executing command (/project/src): svn info --xml
     [exec] Failed to initialize global composer: Composer could not find the config file: /home/dima/.config/composer/composer.json
     [exec]
     [exec] Downloading https://repo.packagist.org/packages.json
     [exec] [200] https://repo.packagist.org/packages.json
     [exec] Writing /home/dima/.cache/composer/repo/https---repo.packagist.org/packages.json into cache
     [exec] Reading /home/dima/.cache/composer/repo/https---repo.packagist.org/provider-doctrine~cache.json from cache
     [exec] Downloading https://repo.packagist.org/p2/doctrine/cache.json if modified
     [exec] [304] https://repo.packagist.org/p2/doctrine/cache.json
     [exec] Using version ^2.0 for doctrine/cache
     [exec] ./composer.json has been created
     [exec] Reading ./composer.json (/project/src/composer.json)
     [exec] Loading config file ./composer.json (/project/src/composer.json)
     [exec] Executing command (/project/src): git branch -a --no-color --no-abbrev -v
     [exec] Executing command (/project/src): git describe --exact-match --tags
     [exec] Executing command (/project/src): git log --pretty="%H" -n1 HEAD
     [exec] Executing command (/project/src): hg branch
     [exec] Executing command (/project/src): fossil branch list
     [exec] Executing command (/project/src): fossil tag list
     [exec] Executing command (/project/src): svn info --xml
     [exec] Failed to initialize global composer: Composer could not find the config file: /home/dima/.config/composer/composer.json
     [exec]
     [exec] Running composer update doctrine/cache
     [exec] Loading composer repositories with package information
     [exec] Downloading https://repo.packagist.org/packages.json
     [exec] [200] https://repo.packagist.org/packages.json
     [exec] Writing /home/dima/.cache/composer/repo/https---repo.packagist.org/packages.json into cache
     [exec] Reading /home/dima/.cache/composer/repo/https---repo.packagist.org/provider-doctrine~cache.json from cache
     [exec] Downloading https://repo.packagist.org/p2/doctrine/cache.json if modified
     [exec] [304] https://repo.packagist.org/p2/doctrine/cache.json
     [exec] Updating dependencies
     [exec] Generating rules
     [exec] Resolving dependencies through SAT
     [exec] Looking at all rules.
     [exec]
     [exec] Dependency resolution completed in 0.000 seconds
     [exec] Analyzed 65 packages to resolve dependencies
     [exec] Analyzed 67 rules to resolve dependencies
     [exec] Lock file operations: 1 install, 0 updates, 0 removals
     [exec] Installs: doctrine/cache:2.0.3
     [exec]   - Locking doctrine/cache (2.0.3)
     [exec] Writing lock file
     [exec] Installing dependencies from lock file (including require-dev)
     [exec] Reading ./composer.lock (/project/src/composer.lock)
     [exec] Package operations: 1 install, 0 updates, 0 removals
     [exec] Installs: doctrine/cache:2.0.3
     [exec] Reading /home/dima/.cache/composer/files/doctrine/cache/92b7dbb84ca3ba3ec5ad280db72a4b3d0732957e.zip from cache
     [exec]   - Loading doctrine/cache (2.0.3) from cache
     [exec]   - Installing doctrine/cache (2.0.3): Extracting archive
     [exec] Executing async command (CWD): '/usr/bin/unzip' -qq '/project/src/vendor/composer/tmp-af412d4a77b0c99b988402177a6409ae' -d '/project/src/vendor/composer/0b0c048b'
     [exec] Executing command (CWD): rm -rf '/project/src/vendor/composer/0b0c048b'
     [exec] Executing command (CWD): rm -rf '/project/src/vendor/doctrine/cache'
     [exec]     Install of doctrine/cache failed
     [exec] Downloading https://packagist.org/downloads/
     [exec] [201] https://packagist.org/downloads/
     [exec]
     [exec] Installation failed, deleting ./composer.json.
     [exec]
     [exec]
     [exec]   [RuntimeException]
     [exec]   Failed to extract doctrine/cache: (-1) '/usr/bin/unzip' -qq '/project/src/vendor/composer/tmp-af412d4a77b0c99b988402177a6409ae' -d '/project/src/vendor/composer/0b0c048b'
     [exec]
     [exec]
     [exec] Exception trace:
     [exec]  () at phar:///build/composer.phar/src/Composer/Downloader/ZipDownloader.php:126
     [exec]  Composer\Downloader\ZipDownloader->Composer\Downloader\{closure}() at n/a:n/a
     [exec]  call_user_func() at phar:///build/composer.phar/vendor/react/promise/src/React/Promise/FulfilledPromise.php:20
     [exec]  React\Promise\FulfilledPromise->then() at phar:///build/composer.phar/vendor/react/promise/src/React/Promise/Deferred.php:74
     [exec]  React\Promise\Deferred->React\Promise\{closure}() at n/a:n/a
     [exec]  call_user_func() at phar:///build/composer.phar/vendor/react/promise/src/React/Promise/Deferred.php:166
     [exec]  React\Promise\Deferred->processQueue() at phar:///build/composer.phar/vendor/react/promise/src/React/Promise/Deferred.php:95
     [exec]  React\Promise\Deferred->resolve() at n/a:n/a
     [exec]  call_user_func() at phar:///build/composer.phar/vendor/react/promise/src/React/Promise/FulfilledPromise.php:20
     [exec]  React\Promise\FulfilledPromise->then() at phar:///build/composer.phar/vendor/react/promise/src/React/Promise/Deferred.php:76
     [exec]  React\Promise\Deferred->React\Promise\{closure}() at n/a:n/a
     [exec]  call_user_func() at phar:///build/composer.phar/vendor/react/promise/src/React/Promise/Deferred.php:166
     [exec]  React\Promise\Deferred->processQueue() at phar:///build/composer.phar/vendor/react/promise/src/React/Promise/Deferred.php:95
     [exec]  React\Promise\Deferred->resolve() at phar:///build/composer.phar/vendor/react/promise/src/React/Promise/Promise.php:42
     [exec]  React\Promise\Promise->React\Promise\{closure}() at n/a:n/a
     [exec]  call_user_func() at phar:///build/composer.phar/src/Composer/Util/ProcessExecutor.php:316
     [exec]  Composer\Util\ProcessExecutor->countActiveJobs() at phar:///build/composer.phar/src/Composer/Util/Loop.php:92
     [exec]  Composer\Util\Loop->wait() at phar:///build/composer.phar/src/Composer/Installer/InstallationManager.php:462
     [exec]  Composer\Installer\InstallationManager->waitOnPromises() at phar:///build/composer.phar/src/Composer/Installer/InstallationManager.php:440
     [exec]  Composer\Installer\InstallationManager->executeBatch() at phar:///build/composer.phar/src/Composer/Installer/InstallationManager.php:367
     [exec]  Composer\Installer\InstallationManager->downloadAndExecuteBatch() at phar:///build/composer.phar/src/Composer/Installer/InstallationManager.php:266
     [exec]  Composer\Installer\InstallationManager->execute() at phar:///build/composer.phar/src/Composer/Installer.php:706
     [exec]  Composer\Installer->doInstall() at phar:///build/composer.phar/src/Composer/Installer.php:543
     [exec]  Composer\Installer->doUpdate() at phar:///build/composer.phar/src/Composer/Installer.php:247
     [exec]  Composer\Installer->run() at phar:///build/composer.phar/src/Composer/Command/RequireCommand.php:383
     [exec]  Composer\Command\RequireCommand->doUpdate() at phar:///build/composer.phar/src/Composer/Command/RequireCommand.php:266
     [exec]  Composer\Command\RequireCommand->execute() at phar:///build/composer.phar/vendor/symfony/console/Command/Command.php:245
     [exec]  Symfony\Component\Console\Command\Command->run() at phar:///build/composer.phar/vendor/symfony/console/Application.php:835
     [exec]  Symfony\Component\Console\Application->doRunCommand() at phar:///build/composer.phar/vendor/symfony/console/Application.php:185
     [exec]  Symfony\Component\Console\Application->doRun() at phar:///build/composer.phar/src/Composer/Console/Application.php:312
     [exec]  Composer\Console\Application->doRun() at phar:///build/composer.phar/vendor/symfony/console/Application.php:117
     [exec]  Symfony\Component\Console\Application->run() at phar:///build/composer.phar/src/Composer/Console/Application.php:125
     [exec]  Composer\Console\Application->run() at phar:///build/composer.phar/bin/composer:64
     [exec]  require() at /build/composer.phar:24
     [exec]
     [exec] require [--dev] [--dry-run] [--prefer-source] [--prefer-dist] [--prefer-install PREFER-INSTALL] [--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>]...
     [exec]

And I expected this to happen:

  • should not fail
started
started time in 21 hours ago
Activity icon
issue

JParkinson1991 issue comment composer/package-versions-deprecated

JParkinson1991
JParkinson1991

Package "vimeo/psalm" is not installed.

Hello,

Trying to install and use vimeo/psalm in a local project but keep getting OutOfBoundsException when trying to access it's binary.

Composer Version: 1.10.22 PHP Version: 7.3.28 | 7.4.20

Having dug into this a little further it seems to be the cause of the issue is in 'composer/composer'. (So apologies if this is not the right place)

Steps To Reproduce

$ composer require --dev composer/composer:^2.0
$ composer require --dev vimeo/psalm
$ ./vendor/bin/psalm
Uncaught OutOfBoundsException: Package "vimeo/psalm" is not installed in...

Working Example

$ composer require --dev composer/composer:^1.10
$ composer require --dev vimeo/psalm
$ ./vendor/bin/psalm

Is it the case that psalm is not compatible with composer/compose 1? Anything that we can do here?

JParkinson1991
JParkinson1991

Looking into this, it seems the package version does exist as expected in \PackageVersions\Versions.

However it's call to the Composer\InstalledVersions class methods are where these exceptions are originating from.

Could we not catch these exceptions, and fallback to available versions within this package returning those where available or allowing the exception to bubble where they're not?

Something akin to..

final class Versions
{
   ...

    /**
     * @throws OutOfBoundsException If a version cannot be located.
     *
     * @psalm-param key-of<self::VERSIONS> $packageName
     * @psalm-pure
     *
     * @psalm-suppress ImpureMethodCall we know that {@see InstalledVersions} interaction does not
     *                                  cause any side effects here.
     */
    public static function getVersion(string $packageName): string
    {
        if (class_exists(InstalledVersions::class, false) && (method_exists(InstalledVersions::class, 'getAllRawData') ? InstalledVersions::getAllRawData() : InstalledVersions::getRawData())) {
            try {
                return InstalledVersions::getPrettyVersion($packageName)
                    . '@' . InstalledVersions::getReference($packageName);
            }
            catch (OutOfBoundsException $e) {
                if (isset(self::VERSIONS[$packageName])) {
                    return self::VERSIONS[$packageName];
                }

                throw $e;
            }
        }

        if (isset(self::VERSIONS[$packageName])) {
            return self::VERSIONS[$packageName];
        }

        throw new OutOfBoundsException(
            'Required package "' . $packageName . '" is not installed: check your ./vendor/composer/installed.json and/or ./composer.lock files'
        );
    }
}

This seems to fix the issue, but approach could probably be rewritten/reworked.

Activity icon
issue

JParkinson1991 issue composer/package-versions-deprecated

JParkinson1991
JParkinson1991

Package "vimeo/psalm" is not installed.

Hello,

Trying to install and use vimeo/psalm in a local project but keep getting OutOfBoundsException when trying to access it's binary.

Composer Version: 1.10.22 PHP Version: 7.3.28 | 7.4.20

Having dug into this a little further it seems to be the cause of the issue is in 'composer/composer'. (So apologies if this is not the right place)

Steps To Reproduce

composer require --dev composer/composer:^2.0
composer require --dev vimeo/psalm
./vendor/bin/psalm

Working Example

composer require --dev composer/composer:^1.10
composer require --dev vimeo/psalm
./vendor/bin/psalm

Is it the case that psalm is not compatible with composer/compose 1? Anything that we can do here?

started
started time in 22 hours ago
Activity icon
fork

Breezooo forked composer/composer

⚡ Dependency Manager for PHP
Breezooo MIT License Updated
fork time in 22 hours ago
started
started time in 23 hours ago
started
started time in 23 hours ago
started
started time in 1 day ago
started
started time in 1 day ago
Activity icon
issue

alcohol issue composer/docker

alcohol
alcohol

phpstan qa failure since last release

My circeci phpstan qa stopped functioning with last composer release (2.1.1). Tagging an older composer release resolve the issue.

I don't really know what happen, but I have the following output:

$ ./vendor/bin/phpstan analyze --level=5 --memory-limit=-1 --debug src

Note: Using configuration file /root/project/phpstan.neon.
Invalid configuration:
Service '0282': Class or interface 'PHPStan\Type\Doctrine\DescriptorRegistry' not found.

Exited with code exit status 1