composer: Composer 2.0.3 can not connect to packagist
Since I updated from version 1 to version 2.0.3 I can not connect to packagist anymore.
Output of composer diagnose
:
Checking platform settings: OK
Checking git settings: OK
Checking http connectivity to packagist: [Composer\Downloader\TransportException] Resolving timed out after 10002 milliseconds
Checking https connectivity to packagist: [Composer\Downloader\TransportException] Resolving timed out after 10006 milliseconds
Checking github.com rate limit: FAIL
[Composer\Downloader\TransportException] Resolving timed out after 10004 milliseconds
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: FAIL
[Composer\Downloader\TransportException] Resolving timed out after 10003 milliseconds
Composer version: 2.0.3
PHP version: 7.4.11
PHP binary path: /usr/local/Cellar/php/7.4.11/bin/php
OpenSSL version: OpenSSL 1.1.1g 21 Apr 2020
cURL version: 7.73.0 libz 1.2.11 ssl OpenSSL/1.1.1h
zip extension: OK
When I run this command:
composer create-project symfony/skeleton test
I get the following output:
Creating a "symfony/skeleton" project at "./test"
[Composer\Downloader\TransportException]
Resolving timed out after 10002 milliseconds
create-project [-s|--stability STABILITY] [--prefer-source] [--prefer-dist] [--repository REPOSITORY] [--repository-url REPOSITORY-URL] [--add-repository] [--dev] [--no-dev] [--no-custom-installers] [--no-scripts] [--no-progress] [--no-secure-http] [--keep-vcs] [--remove-vcs] [--no-install] [--ignore-platform-req IGNORE-PLATFORM-REQ] [--ignore-platform-reqs] [--ask] [--] [<package>] [<directory>] [<version>]
About this issue
- Original URL
- State: closed
- Created 4 years ago
- Comments: 48 (10 by maintainers)
I have no problematic DNS entry in my network settings.
However, when I turn IPV6 off (like described here https://www.maximumbuilders.my/news/trouble-shooting-on-composer-timeout) Composer works again. I wonder why it does not work with IPV6.
I do not want to turn IPV6 fully off. I found this solution: https://github.com/composer/packagist/issues/950
So I entered the following line to my /etc/hosts file.
Composer now works but when installing Symfony I get the following error.
Can anybody tell me how I can enable IPV4 for the recipes server like I did for repo.packagist.org?
I found the problem, there was indeed a DNS issue that composer 1.x.x apparently didn’t have an issue with. I had these DNS servers in my network settings:
The first entry was a pihole rpi, that I haven’t used for some time now. After I deleted it everything works fine. Seems like it wouldn’t skip to the next two entries because I was able to ping
github.com
and repo.packagist.org
without problems.The problem seems to be connected to my system. In my Docker containers Composer works just fine. On my system the problem still persists. Yesterday when I had Composer 1 everything worked fine.
syr for the harsh language before, i was very frustrated after a while. had that and can’t understand it, my network and everything else are totally fine.
curl error 6 while downloading https://repo.packagist.org/packages.json: getaddrinfo() thread failed to start
reinstalled it via scoop, via choco, manually,my network is totally fine!! and i want that to work no matter if I have special configs. And if every other app can reach the destination, so should curl. i added the certificate file, checked my dns (nothing in there), tested with different dns ips, removed IPv6 networking, disabled my firewall, disabled vmware network adapters, hardcoded the ip and domain into my hosts file, reinstalled everything but my operating system, i tried literally everything. That problem is everywhere as google also says. isn’t there anything else than curl that could be used???
I’m having the same issue when trying to install Laravel 9, PHP 8.1 getting the error message
[Composer\Downloader\TransportException] curl error 35 while downloading https://repo.packagist.org/packages.json: OpenSSL SSL_connect: Connection was reset in connection to repo.packagist.org:443
I’ve reached out to our cloud engineer regarding this issue and both ports 80 and 443 is enabled Tried disabling the ipv6 but GCP instance is not using it.
Hope someone can help on this.
maybe curl resolves DNS different that when using PHP streams. Composer 2 now uses curl by default.
yes, I’m sorry for my harsh language. corrected it a little, but after a week of software problems only, it’s getting frustrating. and no i’m certainly not writing a package manager 😂 I rather download zip files and distribute them to where I need them. it’s fasterfor me and my few use cases, but i have to use composer, they don’t offer it any other way, but I asked for a zip file now…
@oliiix bye bye Composer? Are you writing your own package manager for PHP?
Also weird that curl would fail over ipv6 but that Composer 1 using php streams was doing fine… networks are hell 😕
Resolving timed out sounds like DNS issue. I don’t know if you can try another DNS resolver perhaps?
The problem in my case was caused by a running proxy app - Progress Telerik Fiddler Classic.
Switched it off and the “composer update” worked.
I am facing the same issue now in Ubuntu 20.04 and using php 7.4.
composer diagnose
Traceroute result:
That solved my problem
Checking composer.json: WARNING require.guzzlehttp/guzzle : exact version constraints (7.4.x-dev) should be avoided if the package follows semantic versioning require.psr/log : exact version constraints (3.x-dev) should be avoided if the package follows semantic versioning Checking platform settings: OK Checking git settings: OK Checking http connectivity to packagist: OK Checking https connectivity to packagist: FAIL [Composer\Downloader\TransportException] curl error 77 while downloading https://repo.packagist.org/packages.json: Problem with the SSL CA cert (path? access rights?) Checking github.com rate limit: FAIL [Composer\Downloader\TransportException] curl error 77 while downloading https://api.github.com/rate_limit: Problem with the SSL CA cert (path? access rights?) Checking disk free space: OK Checking pubkeys: FAIL Missing pubkey for tags verification Missing pubkey for dev verification Run composer self-update --update-keys to set them up Checking composer version: FAIL [Composer\Downloader\TransportException] curl error 77 while downloading https://getcomposer.org/versions: Problem with the SSL CA cert (path? access rights?) Composer version: 2.3.5 PHP version: 8.1.6 PHP binary path: /home/altwei/software/php81/bin/php OpenSSL version: OpenSSL 1.1.1f 31 Mar 2020 cURL version: 7.68.0 libz 1.2.11 ssl NSS/3.49.1 zip: extension present, unzip present, 7-Zip not available
What is the problem ?
Creating a “laravel/laravel” project at “./example-app” (Windows, Command Prompt, Terminal)
In CurlDownloader.php line 375:
curl error 28 while downloading https://repo.packagist.org/packages.json: Timeout was reached
create-project [-s|–stability STABILITY] [–prefer-source] [–prefer-dist] [–prefer-install PREFER-INSTALL] [–repository REPOSITORY] [–repository-url REPOSITORY-URL] [–add-repository] [–dev] [–no-dev] [–no-custom-installers] [–no-scripts] [–no-progress] [–no-secure-http] [–keep-vcs] [–remove-vcs] [–no-install] [–ignore-platform-req IGNORE-PLATFORM-REQ] [–ignore-platform-reqs] [–ask] [–] [<package> [<directory> [<version>]]]
Any help why its Timeout.
This mostly comes from your firewalls or ipv6.
You can disable the firewalls or disable ipv6 in youur machine for it to work.
Also you can use the following code to create your project. I hope this will assist…
composer create-project --prefer-dist laravel/laravel <app-name> --ignore-platform-req=ext-fileinfo
im facing the same issue with this.
I saw this issue [Composer\Downloader\TransportException] curl error 28 while downloading https://repo.packagist.org/packages.json: Connection timed out after 10007 millisec onds how to solve this
Really? 10 seconds not enough to connect? 😕