-
-
Notifications
You must be signed in to change notification settings - Fork 4.5k
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
Composer 2.0.3 can not connect to packagist #9376
Comments
That was probably just a temporary issue? Can't reproduce :) |
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. |
Resolving timed out sounds like DNS issue. I don't know if you can try another DNS resolver perhaps? |
I have the same issue since updating to 2.0.0, now at 2.0.3.
|
it does not only fail to connect to packagist but also to github.com |
I found the problem, there was indeed a DNS issue that composer 1.x.x apparently didn't have an issue with.
The first entry was a pihole rpi, that I haven't used for some time now. After I deleted it everything works fine. |
maybe curl resolves DNS different that when using PHP streams. Composer 2 now uses curl by default. |
@joergmoldenhauer have you checked your machine's DNS servers? It might be that it works in docker because it's using another DNS resolver there? |
I had the same exact issue and adjusting my DNS settings (also a faulty first entry) has now solved it. |
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. |
Also weird that curl would fail over ipv6 but that Composer 1 using php streams was doing fine.. networks are hell :/ |
I do not want to turn IPV6 fully off. I found this solution: composer/packagist#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? |
If you're gonna hardcode an IP (which may bite you in the ass later if we ever rotate it out..), please at least run a You can do the same for flex.symfony.com, and then github.com, etc.. but that seems really suboptimal. It'd be better to resolve the ipv6 issues. |
I just talked to our network admin here at work. It seems to be an internal problem with our network. He advised me to turn IPv6 off (like I did before). Composer now works fine and is super fast. Thank you all for your help! |
same problem. thanks |
I ran in to a similar problem. My primary DNS was my Pi-hole (192.168.2.2), secondary 1.1.1.1. Everything in my networked seemed to work just fine, except for Composer. |
Checking platform settings: OK what is the problem |
@MohammadShakilCSE I don't know if that's your case but I had an antivirus Proxy (ESET) that was blocking the installation. I disabled it and it's working like a charm. I don't really know how you're supposed to deal with it .. but I was planning on changing antivirus anyway so... |
Since nothing else worked and I don't actually have control over the machines/networks that are giving me grief I have changed the curl connect timeout in /usr/share/php/Composer/Util/Http/CurlDownloader.php . 10 seconds was not enough to reliably get through all the packet filtering. I bumped it to 30 and now it works like a charm. Your mileage may vary. |
Really? 10 seconds not enough to connect? :/ |
Correct. My biggest problems incidentally appear to be within the Drupal project infrastructure someplace but it might be a combinatorial effect related to our service provider (Telstra/Australia) and the fact that I'm somewhat remote even for Australia. Access to everything goes across slower links and trans-Pacific packets naturally take a bit longer in the best of cases. And quite possibly I'm getting routed through a satellite link somewhere in the chain. I'm not assigning blame because frankly I have other priorities beyond investigating to that level. I'm just saying it's outside my control and 30 seconds works. |
@redmatrix ok I see. I would say maybe try Private Packagist otherwise, we do have servers in Singapore so using the mirroring there probably would help. |
I saw this issue |
I think it's not error (maybe bug). In my case, i run this command |
im facing the same issue with this. |
$ composer require laravel/jetstream [Composer\Downloader\TransportException] require [--dev] [--dry-run] [--prefer-source] [--prefer-dist] [--prefer-install PREFER-INSTALL] [--fixed] [--no-suggest] [--no-progress] [--no-update] [--no-install] [--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] [--] []... |
Had same problem on composer 2.2.5 inside docker container. Note: I'm using php 8.0, but docker image contains some packages from php 8.1 The following packages will be upgraded:
libsystemd0 libudev1 php8.1-cli php8.1-common php8.1-opcache php8.1-phpdbg php8.1-readline
|
Hello!, in my case was the port 8080, was taked, so I killed the process with TASKKILL /PID NumberOfTheProcess /F. And after that I tried again and it works. |
|
I'm having the same issue when trying to install Laravel 9, PHP 8.1 getting the error message [Composer\Downloader\TransportException] I've reached out to our cloud engineer regarding this issue and both ports 80 and 443 is enabled Hope someone can help on this. |
composer diagnose Checking git settings: OK |
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] [--] [ [ []]] Any help why its Timeout. |
Checking composer.json: WARNING What is the problem ? |
This NSS is wrong? |
That solved my problem |
thanks |
The problem in my case was caused by a running proxy app - Progress Telerik Fiddler Classic. Switched it off and the "composer update" worked. |
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. |
@oliiix bye bye Composer? Are you writing your own package manager for PHP? |
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 :'D 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... |
Could always use PHAR or PEAR 😉 .... Composer just gets better and more secure with each version. If you're having issues, it's likely because of SSL or access problems. My suggestion would be to...
|
Don't underestimate the complexity which is covered by Composer. |
please check if you have "mod_security" or "mod_security2" enabled in your apache2 mcedit /etc/modsecurity/crs/packagist.conf
then
and have fun |
My solution to this error, when I was trying to build a Laravel app with docker, was to change the MTU on the network configuration of the docker container. This depends on the MTU configuration that the host has, in our case was 1400. We had to apply this configuration for the network on the docker-compose.yaml file: As suggested in this article: https://help.nordlayer.com/docs/docker-mtu-configuration And then applied this network to all images in the file like this: |
I have same issue on my Laravel app, when thy to install packages. $ php composer.phar diagnose
Checking platform settings: OK
Checking git settings: OK git version 2.34.1
Checking http connectivity to packagist: OK
Checking https connectivity to packagist: OK
Checking github.com rate limit: FAIL
[Composer\Downloader\TransportException] curl error 60 while downloading https://api.github.com/rate_limit: SSL: no alternative certificate subject name matches target host name 'api.github.com'
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
Composer version: 2.6-dev+c1f2964105f75d2123783b1a649d6c0260316785
PHP version: 8.2.8
PHP binary path: /usr/bin/php8.2
OpenSSL version: OpenSSL 3.0.2 15 Mar 2022
cURL version: 7.81.0 libz 1.2.11 ssl OpenSSL/3.0.2
zip: extension present, unzip present, 7-Zip present (7z) Creating personal access token form github don't give solution for that situation. |
php 8.2.4 Failed to download symfony/polyfill-ctype from dist: curl error 28 while downloading https://api.github.com/repos/symfony/polyfill-ctype/zipball/5bbc823adecdae860bb64756d639ecfec17b050a: SSL connection timeout |
I have problem when try to install laravel. The problem is : How to fix it? |
Since I updated from version 1 to version 2.0.3 I can not connect to packagist anymore.
Output of
composer diagnose
:When I run this command:
I get the following output:
The text was updated successfully, but these errors were encountered: