Skip to content

curl error 56 during composer install

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: LaminasDependencyPluginDependencyRewriterPluginDelegator->onPrePackageInstallOrUpdate
In LaminasDependencyPluginDependencyRewriterV2::onPrePackageInstallOrUpdate
Exiting; package "techdivision/import-category" does not have a replacement
> pre-package-update: MagentoComposerDependencyVersionAuditPluginPlugin->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:
                                                                                                                   
  [ComposerDownloaderTransportException]                                                                         
  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
 ComposerUtilHttpCurlDownloader->tick() at phar:///usr/local/bin/composer2/src/Composer/Util/HttpDownloader.php:371
 ComposerUtilHttpDownloader->countActiveJobs() at phar:///usr/local/bin/composer2/src/Composer/Util/Loop.php:89
 ComposerUtilLoop->wait() at phar:///usr/local/bin/composer2/src/Composer/Repository/ComposerRepository.php:1058
 ComposerRepositoryComposerRepository->loadAsyncPackages() at phar:///usr/local/bin/composer2/src/Composer/Repository/ComposerRepository.php:531
 ComposerRepositoryComposerRepository->loadPackages() at phar:///usr/local/bin/composer2/src/Composer/Repository/RepositorySet.php:197
 ComposerRepositoryRepositorySet->findPackages() at phar:///usr/local/bin/composer2/src/Composer/Package/Version/VersionSelector.php:85
 ComposerPackageVersionVersionSelector->findBestCandidate() at /var/www/html/magento2/web/vendor/magento/composer-dependency-version-audit-plugin/src/Utils/Version.php:90
 MagentoComposerDependencyVersionAuditPluginUtilsVersion->findBestCandidateComposer2() at /var/www/html/magento2/web/vendor/magento/composer-dependency-version-audit-plugin/src/Utils/Version.php:40
 MagentoComposerDependencyVersionAuditPluginUtilsVersion->findBestCandidate() at /var/www/html/magento2/web/vendor/magento/composer-dependency-version-audit-plugin/src/Plugin.php:139
 MagentoComposerDependencyVersionAuditPluginPlugin->packageUpdate() at phar:///usr/local/bin/composer2/src/Composer/EventDispatcher/EventDispatcher.php:200
 ComposerEventDispatcherEventDispatcher->doDispatch() at phar:///usr/local/bin/composer2/src/Composer/EventDispatcher/EventDispatcher.php:142
 ComposerEventDispatcherEventDispatcher->dispatchPackageEvent() at phar:///usr/local/bin/composer2/src/Composer/Installer/InstallationManager.php:380
 ComposerInstallerInstallationManager->executeBatch() at phar:///usr/local/bin/composer2/src/Composer/Installer/InstallationManager.php:334
 ComposerInstallerInstallationManager->downloadAndExecuteBatch() at phar:///usr/local/bin/composer2/src/Composer/Installer/InstallationManager.php:242
 ComposerInstallerInstallationManager->execute() at phar:///usr/local/bin/composer2/src/Composer/Installer.php:787
 ComposerInstaller->doInstall() at phar:///usr/local/bin/composer2/src/Composer/Installer.php:283
 ComposerInstaller->run() at phar:///usr/local/bin/composer2/src/Composer/Command/InstallCommand.php:144
 ComposerCommandInstallCommand->execute() at phar:///usr/local/bin/composer2/vendor/symfony/console/Command/Command.php:298
 SymfonyComponentConsoleCommandCommand->run() at phar:///usr/local/bin/composer2/vendor/symfony/console/Application.php:1024
 SymfonyComponentConsoleApplication->doRunCommand() at phar:///usr/local/bin/composer2/vendor/symfony/console/Application.php:299
 SymfonyComponentConsoleApplication->doRun() at phar:///usr/local/bin/composer2/src/Composer/Console/Application.php:343
 ComposerConsoleApplication->doRun() at phar:///usr/local/bin/composer2/vendor/symfony/console/Application.php:171
 SymfonyComponentConsoleApplication->run() at phar:///usr/local/bin/composer2/src/Composer/Console/Application.php:138
 ComposerConsoleApplication->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.

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