2

We have have recently upgraded Magento from 2.3.5 to 2.4.4 and trying do deploy the update to our staging server. During the composer install we get the following error after a while:

$ php8.1 /usr/local/bin/composer install
[...]
  - Installing techdivision/import-product-bundle (25.0.0): Extracting archive
  - Installing techdivision/import-product-bundle-ee (27.0.0): Extracting archive
  - Installing techdivision/import-customer (17.0.1): Extracting archive
  - Installing techdivision/import-customer-address (17.0.1): Extracting archive
  - Installing techdivision/import-converter (11.0.0): Extracting archive
https://repo.packagist.org could not be fully loaded (curl error 56 while downloading https://repo.packagist.org/p2/techdivision/import-category.json: Unexpected EOF), package information was loaded from the local cache and may be out of date
    Install of sebastian/version failed
    Install of sebastian/type failed
    Install of sebastian/resource-operations failed
    Install of sebastian/recursion-context failed
    Install of sebastian/object-reflector failed
[...]

In CurlDownloader.php line 358:
                                                                                                                   
  curl error 56 while downloading https://repo.packagist.org/p2/techdivision/import-category.json: Unexpected EOF  
                                                                                                                   

When I open the link, the file does not have any errors. Trying the composer install again it will succeed with this file but fail again at the next. Further repeating the step just brings us seemingly one module further. Until now it always fails at the same module shown above.

OS: Ubuntu 18.04.6 LTS
PHP Version: 8.1.9
Composer Version: 2.4.1 2022-08-20 11:44:50
cURL Information: 7.58.0

The verbose output of the error is:

$ php8.1 /usr/local/bin/composer install -vvv
[...]
> pre-package-update: Laminas\DependencyPlugin\DependencyRewriterPluginDelegator->onPrePackageInstallOrUpdate
In Laminas\DependencyPlugin\DependencyRewriterV2::onPrePackageInstallOrUpdate
Exiting; package "techdivision/import-category" does not have a replacement
> pre-package-update: Magento\ComposerDependencyVersionAuditPlugin\Plugin->packageUpdate
Downloading https://repo.packagist.org/p2/techdivision/import-category.json
Reading /home/www-data/.composer/cache/repo/https---repo.packagist.org/provider-techdivision~import-category~dev.json from cache
Downloading https://repo.packagist.org/p2/techdivision/import-category~dev.json if modified
https://repo.packagist.org could not be fully loaded (curl error 56 while downloading https://repo.packagist.org/p2/techdivision/import-category.json: Unexpected EOF), package information was loaded from the local cache and may be out of date
[304] https://repo.packagist.org/p2/techdivision/import-category~dev.json
[...]
In CurlDownloader.php line 358:
                                                                                                                   
  [Composer\Downloader\TransportException]                                                                         
  curl error 56 while downloading https://repo.packagist.org/p2/techdivision/import-category.json: Unexpected EOF  
                                                                                                                   

Exception trace:
  at phar:///usr/local/bin/composer2/src/Composer/Util/Http/CurlDownloader.php:358
 Composer\Util\Http\CurlDownloader->tick() at phar:///usr/local/bin/composer2/src/Composer/Util/HttpDownloader.php:371
 Composer\Util\HttpDownloader->countActiveJobs() at phar:///usr/local/bin/composer2/src/Composer/Util/Loop.php:89
 Composer\Util\Loop->wait() at phar:///usr/local/bin/composer2/src/Composer/Repository/ComposerRepository.php:1058
 Composer\Repository\ComposerRepository->loadAsyncPackages() at phar:///usr/local/bin/composer2/src/Composer/Repository/ComposerRepository.php:531
 Composer\Repository\ComposerRepository->loadPackages() at phar:///usr/local/bin/composer2/src/Composer/Repository/RepositorySet.php:197
 Composer\Repository\RepositorySet->findPackages() at phar:///usr/local/bin/composer2/src/Composer/Package/Version/VersionSelector.php:85
 Composer\Package\Version\VersionSelector->findBestCandidate() at /var/www/html/magento2/web/vendor/magento/composer-dependency-version-audit-plugin/src/Utils/Version.php:90
 Magento\ComposerDependencyVersionAuditPlugin\Utils\Version->findBestCandidateComposer2() at /var/www/html/magento2/web/vendor/magento/composer-dependency-version-audit-plugin/src/Utils/Version.php:40
 Magento\ComposerDependencyVersionAuditPlugin\Utils\Version->findBestCandidate() at /var/www/html/magento2/web/vendor/magento/composer-dependency-version-audit-plugin/src/Plugin.php:139
 Magento\ComposerDependencyVersionAuditPlugin\Plugin->packageUpdate() at phar:///usr/local/bin/composer2/src/Composer/EventDispatcher/EventDispatcher.php:200
 Composer\EventDispatcher\EventDispatcher->doDispatch() at phar:///usr/local/bin/composer2/src/Composer/EventDispatcher/EventDispatcher.php:142
 Composer\EventDispatcher\EventDispatcher->dispatchPackageEvent() at phar:///usr/local/bin/composer2/src/Composer/Installer/InstallationManager.php:380
 Composer\Installer\InstallationManager->executeBatch() at phar:///usr/local/bin/composer2/src/Composer/Installer/InstallationManager.php:334
 Composer\Installer\InstallationManager->downloadAndExecuteBatch() at phar:///usr/local/bin/composer2/src/Composer/Installer/InstallationManager.php:242
 Composer\Installer\InstallationManager->execute() at phar:///usr/local/bin/composer2/src/Composer/Installer.php:787
 Composer\Installer->doInstall() at phar:///usr/local/bin/composer2/src/Composer/Installer.php:283
 Composer\Installer->run() at phar:///usr/local/bin/composer2/src/Composer/Command/InstallCommand.php:144
 Composer\Command\InstallCommand->execute() at phar:///usr/local/bin/composer2/vendor/symfony/console/Command/Command.php:298
 Symfony\Component\Console\Command\Command->run() at phar:///usr/local/bin/composer2/vendor/symfony/console/Application.php:1024
 Symfony\Component\Console\Application->doRunCommand() at phar:///usr/local/bin/composer2/vendor/symfony/console/Application.php:299
 Symfony\Component\Console\Application->doRun() at phar:///usr/local/bin/composer2/src/Composer/Console/Application.php:343
 Composer\Console\Application->doRun() at phar:///usr/local/bin/composer2/vendor/symfony/console/Application.php:171
 Symfony\Component\Console\Application->run() at phar:///usr/local/bin/composer2/src/Composer/Console/Application.php:138
 Composer\Console\Application->run() at phar:///usr/local/bin/composer2/bin/composer:88
 require() at /usr/local/bin/composer2:29

I noticed a difference in the composer version locally and used on the server but downgrading to 2.3.5 did not help. Locally or in our docker environment we did not encounter this error before.

As per suggestion I've used curl and wget in order to verify what data I am receiving. In both cases I receive valid json and it looks completely normal:

$ curl https://repo.packagist.org/p2/techdivision/import-category.json | jsonlint-php 
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100 52929    0 52929    0     0  1013k      0 --:--:-- --:--:-- --:--:--  994k
Valid JSON (stdin)
$ wget https://repo.packagist.org/p2/techdivision/import-category.json
--2022-10-06 09:48:06--  https://repo.packagist.org/p2/techdivision/import-category.json
Resolving repo.packagist.org (repo.packagist.org)... 2001:41d0:52:600::8cf, 5.196.224.108
Connecting to repo.packagist.org (repo.packagist.org)|2001:41d0:52:600::8cf|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: unspecified [application/json]
Saving to: ‘import-category.json’

import-category.json                                               [ <=>                                                                                                                                              ]  51,69K  --.-KB/s    in 0,008s  

2022-10-06 09:48:06 (6,50 MB/s) - ‘import-category.json’ saved [52929]

$ file import-category.json 
import-category.json: ASCII text, with very long lines, with no line terminators
$ jsonlint-php import-category.json 
Valid JSON (import-category.json)

Trying to search for this error message in combination with composer did not yield any results. What could be the cause of this error?

Our current workaround is to disable php-curl.

4
  • 1
    try composer install -vvv for more verbose output
    – Alex
    Commented Sep 14, 2022 at 9:43
  • What is your OS and php8.1-curl version?
    – Alex
    Commented Sep 14, 2022 at 9:44
  • 1
    I've added the information.
    – Daniel
    Commented Sep 14, 2022 at 9:54
  • 1
    Can you please try with "composer update --ignore-platform-reqs" command and check once. i hope it'will be use full to you. Thank you. Commented Oct 3, 2022 at 10:21

3 Answers 3

1

If not did not encounter this error before in Locally environment what i do is clear the composer cache

php8.1 /usr/local/bin/composer clear-cache

and remove the composer.lock file and run again composer install command

1
  • 1
    Unfortunately that did not help.
    – Daniel
    Commented Oct 5, 2022 at 15:29
0

Colleague of Daniel here

After upgrading to Ubuntu 22.04 we cannot reproduce the problem anymore (with a fresh/empty COMPOSER_HOME)

COMPOSER_HOME=/tmp/test/composer-home php8.1 `which composer` install

runs without problems.

-1

Try to do curl or wget the URL on the server itself to see if you get more information:

wget https://repo.packagist.org/p2/techdivision/import-category.json

curl https://repo.packagist.org/p2/techdivision/import-category.json

I tried both on my local machine, and everything seems fine. But the server can yield different results. (And share results please)

1
  • 1
    I have updated my question. The data I am receiving looks fine and just like on my local environment.
    – Daniel
    Commented Oct 6, 2022 at 7:57

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.