Skip to content
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

HTTP Request Failure: http://getcomposer.org/composer.phar "Fail to Open Stream" #6515

Closed
KidA78 opened this issue Jun 30, 2017 · 11 comments
Closed
Labels

Comments

@KidA78
Copy link

KidA78 commented Jun 30, 2017

We've been seeing Composer stream errors happen around the same time every day. Around 5pm PST, we get the following errors below. Is there something that is happening during this time that causes the stream to fail?

Console/cake composer.c self-update;

I get the following output:

00:13:56 Warning Error: file_get_contents(http://getcomposer.org/composer.phar): failed to open stream: HTTP request failed!  in [/path/to/ComposerShell.php, line 82]
00:13:56 
@alcohol
Copy link
Member

alcohol commented Jun 30, 2017

@Seldaek anything in the error logs on the host of getcomposer.org ?

But on a side note, the scripts you are running don't seem to be provided/supported by us. So if you want to do more debugging on your end, we really cannot help you as we have no idea what you're doing.

@KidA78
Copy link
Author

KidA78 commented Jun 30, 2017

@alcohol thanks. What the script is doing, is just a wrapper around

php composer.phar self-update

But the latest composer.phar fails to download. And the last few failures we've had all happen around the same time on those different days. A retry a few hours later, and the phar file downloads without issue. Let's see if @Seldaek has noticed any issues in the logs?

@Seldaek
Copy link
Member

Seldaek commented Jul 5, 2017

If self-update is working fine for everyone else, I'd guess your script is doing something funky or the environment/network has issues. Check if composer self-update or composer diagnose report anything funky, if not then I'd guess it's in your script. I don't see anything in logs but without an exact UTC time to look for it's kinda hard anyway as we have lots of traffic and logs are pretty noisy.

@KidA78
Copy link
Author

KidA78 commented Jul 5, 2017

Thanks @Seldaek, if it happens again I'll provide a timestamp, and I'll run diagnose to see if composer reports anything.

@KidA78
Copy link
Author

KidA78 commented Jul 22, 2017

@Seldaek @alcohol the issue has happened again. I have a timestamp for you:

At Sat July 22, 2017 00:05:46 UTC, when downloading http://getcomposer.org/composer.phar
This error happens around this exact same time. Is this server restarting, or is some process happening on this box around this time?

@Seldaek
Copy link
Member

Seldaek commented Jul 23, 2017

Sorry but I don't see anything special in logs at that time there is nothing at all in the nginx error log and nothing odd in access log either.

@KidA78
Copy link
Author

KidA78 commented Jan 5, 2018

@Seldaek @alcohol
Just getting back to this. As we speak, the issue is still happening. Starting at 0:00:00 UTC and continuing for about 30 minutes, random HTTP failures when downloading the composer.phar file:

@local:/path/to/my/app $ composer self-update

                                                                                                
  [Composer\Downloader\TransportException]                                                      
  The "https://getcomposer.org/versions" file could not be downloaded: Failed to enable crypto  
  failed to open stream: operation failed                                                       
                                                                                                

self-update [-r|--rollback] [--clean-backups] [--no-progress] [--update-keys] [--stable] [--preview] [--snapshot] [--set-channel-only] [--] [<version>]

It's too much of a coincidence. Any time I run composer self-update at this time on various days, on various machines, the same outcome. And the only common thread is the time period between 0:00:00 UTC and around 00:30:00 UTC

@Seldaek
Copy link
Member

Seldaek commented Jan 8, 2018

I just deployed some changes to our infrastructure which should help with this. Let me know if that is not the case.

@Seldaek Seldaek closed this as completed Jan 8, 2018
@KidA78
Copy link
Author

KidA78 commented Jan 8, 2018

@Seldaek thanks for following up. Will let you know if the issue persists.

@go2amp
Copy link

go2amp commented Mar 13, 2019

Having same issue. Haven't had any problems on other dev machines during the 8-5pm EST working hours, but tonight at 7:17PM EST, getting this error. Not getting a page when simply browsing to https://getcomposer.org either.

*Update - Figured out the issue. Apparently, our firewall was blocking traffic to/from the getcomposer.org domain because their host (OVH) failed the 'reputation' check. Once we whitelisted them, everything resumed as normal.

@qcho
Copy link
Contributor

qcho commented Sep 2, 2019

Had the same error in Ubuntu 18.04.2 LTS. The issue was the local DNS service was resolving getcomposer.org into an ipv6 address instead of ipv4.

You can try if this is happening to you by simply running ping getcomposer.org. The expected output is something like this:

PING getcomposer.org (142.44.245.229) 56(84) bytes of data.
64 bytes from 142.44.245.229 (142.44.245.229): icmp_seq=1 ttl=49 time=174 ms
64 bytes from 142.44.245.229 (142.44.245.229): icmp_seq=2 ttl=49 time=173 ms
64 bytes from 142.44.245.229 (142.44.245.229): icmp_seq=3 ttl=49 time=175 ms

If you see something in the order of 2607:5300:201:2100::4:d105, then, the solution was to un-comment the following line in /etc/gai.conf:

#
#    For sites which prefer IPv4 connections change the last line to
#
precedence ::ffff:0:0/96  100

hope helps someone :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

5 participants