Composer - connection timed out


#1

I’ve tried to install a package through composer using the following shell command:

but the process failed with the following message

[Composer\Downloader\TransportException] The "http://packagist.org/p/provider-archived%243b25e0fefa01b5b39dacbe96e84 3cc692e932477620f8823893a33603142a090.json" file could not be downloaded: f ailed to open stream: Connection timed out

what am I doing wrong?


#2

Nothing.
[hr]
I’ve been working with support to get this fixed and haven’t gotten anywhere. Perhaps a second complaint would help :slight_smile:

Composer doesn’t work at all for me right now on Dreamhost, but it did a couple of months ago when I tried. Here’s what I get:

On Dreamhost

[carpet]$ composer require dibi/dibi -vvv
Reading ./composer.json
Loading config file /home/user/.composer/config.json

Downloading https://packagist.org/packages.json
Downloading https://packagist.org/packages.json
Downloading https://packagist.org/packages.json
[Composer\Downloader\TransportException]
The “https://packagist.org/packages.json” file could not be downloaded: failed to open stream: Connection timed out


On Windows

λ composer require dibi/dibi -vvv
Reading ./composer.json
Loading config file ./composer.json

Downloading https://packagist.org/packages.json
Writing C:/Users/user/AppData/Local/Composer/repo/https—packagist.org/packages.json into cache
Downloading http://packagist.org/p/provider-2013$d6f312c6c1b3acd73f706a50e1ed8093c5b9d0509875b3baf55f294230f19895.js
Writing C:/Users/user/AppData/Local/Composer/repo/https—packagist.org/p-provider-2013.json into cache
Downloading http://packagist.org/p/provider-2014$c42dd36a62bcc4959c035d71946232aa44b59bfd339fd66fb7d8002640dc9cf3.js

Using version ^2.3 for dibi/dibi
./composer.json has been updated

Updating dependencies (including require-dev)

Analyzed 98 packages to resolve dependencies
Analyzed 74 rules to resolve dependencies


you can also try this a few times and get different failures:

[carpet]$ 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 rate limit: OK
Checking disk free space: OK
Checking composer version:

[Composer\Downloader\TransportException]
The “https://getcomposer.org/version” file could not be downloaded: failed to open stream: Connection timed out


#3

Sweet, looks like they got it fixed (for me at least). Highlights from the conversation:

Me - Using composer on my dreamhost account does not work where it recently did. Running it on my local computer works fine.
My guess is it’s this problem that people are talking about, where communications using ipv6 are unreliable. Using v4 addressing works fine, so people are modifying their hosts file to force packagist.org to be requested using v4.


Me - “I see it showing the correct IP for both v4 and v6. The problem people were mentioning was that communications would switch between v4 and v6 for some reason and often fail when v6 came into play. So the hosts file entry was to force exclusively v4 usage.”

DH - “I did confirm there’s an IPv6 issue at our Virginia data center. We’re currently working on resolving the issue.”

DH - “Can you please give it one more try? There was only one broken customer ipv6 on the entire machine, which is now cleaned up and ipv6 is re-configured now. If something cannot connect via ipv6 now it should switch to ipv4 automatically.”

I don’t know what they ended up doing to fix it, but I hope this saves someone else the many many hours I spent fighting this issue.