tag:help.rubygems.org,2010-01-19:/discussions/problems/31074-timeout-errorRubyGems.org: Discussion 2020-09-29T12:45:50Ztag:help.rubygems.org,2010-01-19:Comment/450669182018-04-22T12:53:53Z2018-04-22T12:53:53ZTimeout error<div><p>hi guard.16,</p>
<p>Looks like api.rubygems.org is not resolvable/reachable from your host. Can you please try to download spec file using wget or curl and see what error comes up?</p></div>sonalkr132tag:help.rubygems.org,2010-01-19:Comment/450669182018-04-23T19:28:34Z2018-04-23T19:28:36ZTimeout error<div><p>Hi, I'm having the exact same issue as guard.16. It is on one specific server, and I can't find any indication anywhere of what may be happening.</p>
<p>/opt/rubies$ ./ruby-2.3.7/bin/gem install bundler ERROR: Could not find a valid gem 'bundler' (>= 0), here is why:<br>
Unable to download data from <a href="https://rubygems.org/">https://rubygems.org/</a> - timed out (<a href="https://api.rubygems.org/specs.4.8.gz">https://api.rubygems.org/specs.4.8.gz</a>)</p>
<p>However, curl works fine:</p>
<p>curl <a href="https://api.rubygems.org/specs.4.8.gz">https://api.rubygems.org/specs.4.8.gz</a> > specs.4.8.gz</p>
<p>No problems with that!</p></div>William Makleytag:help.rubygems.org,2010-01-19:Comment/450669182018-04-24T14:40:56Z2018-04-24T14:40:58ZTimeout error<div><p>*This is on a fully updated Debian 8 server. I have other servers with the same OS at the same host without this issue. I used ruby-build to install ruby 2.3.7 and ruby 2.4.4, and I can't find a single error in any system log (including the firewall). I'd be ecstatic if anyone has any idea of where to look or what to check. All rubies on this server suddenly started having the same issue as OP a couple weeks ago.</p></div>William Makleytag:help.rubygems.org,2010-01-19:Comment/450669182018-04-25T02:47:58Z2018-04-25T02:47:59ZTimeout error<div><p>I'm experiencing the same problem, running NixOS and I've tried ruby 2.4.1 and 2.5.0. It seems to affect every gem I've tried so far (ffi, coderay, rouge, spoon). I've tried https and http. I'm able to curl a specific gem (e.g. <code>curl http://rubygems.org/gems/ffi-1.9.23.gem -o outfile</code>) successfully.</p></div>Ivantag:help.rubygems.org,2010-01-19:Comment/450669182018-05-04T17:35:31Z2018-05-04T17:35:31ZTimeout error<div><p>Checking in: is this still an issue for you?</p></div>kerrizortag:help.rubygems.org,2010-01-19:Comment/450669182018-05-08T00:44:54Z2018-05-08T00:44:56ZTimeout error<div><p>I'm having the same issue, i'm able to <code>curl https://api.rubygems.org/specs.4.8.gz > specs.4.8.gz</code> but running <code>wget https://api.rubygems.org/specs.4.8.gz</code> times out.</p>
<p>Running debian 9.4 on this machine, but on a macbook pro (running High Sierra) it works perfectly. The problem started around mid april for me</p></div>cabasptag:help.rubygems.org,2010-01-19:Comment/450669182018-05-09T08:59:25Z2018-05-09T08:59:28ZTimeout error<div><p>The issue seems to be that <a href="https://api.rubygems.org/">https://api.rubygems.org/</a> is unreachable by IPv6.</p></div>Alexei Khlebnikovtag:help.rubygems.org,2010-01-19:Comment/450669182018-05-09T09:05:09Z2018-05-09T09:05:10ZTimeout error<div><p>Here is (part of) Nmap report for IPv6 addresses of api.rubygems.com:</p>
<pre>
<code># Nmap 7.70 scan initiated Wed May 9 10:50:14 2018 as: nmap -p 443 -6 -Pn -v -oG - 2a04:4e42::514 2a04:4e42:600::514 2a04:4e42:400::514 2a04:4e42:200::514
Host: 2a04:4e42::514 () Ports: 443/filtered/tcp//https///
Host: 2a04:4e42:600::514 () Ports: 443/filtered/tcp//https///
Host: 2a04:4e42:400::514 () Ports: 443/filtered/tcp//https///
Host: 2a04:4e42:200::514 () Ports: 443/filtered/tcp//https///</code>
</pre>
<p>Report for IPv4 looks fine though:</p>
<pre>
<code># Nmap 7.70 scan initiated Wed May 9 10:56:22 2018 as: nmap -p 443 -4 -Pn -v -oG - 151.101.130.2 151.101.194.2 151.101.2.2
Host: 151.101.130.2 () Ports: 443/open/tcp//https///
Host: 151.101.194.2 () Ports: 443/open/tcp//https///
Host: 151.101.2.2 () Ports: 443/open/tcp//https///</code>
</pre></div>Alexei Khlebnikovtag:help.rubygems.org,2010-01-19:Comment/450669182018-05-10T02:55:22Z2018-05-10T02:55:26ZTimeout error<div><p>I just tried the same nmap commands and IPv6 looks fine now as well. I'm also now able to fetch dependencies successfully. It's not quite definitive evidence, but does lend support to the theory that IPv6 was the issue. Thanks for pointing that out, Alexei!</p></div>Ivantag:help.rubygems.org,2010-01-19:Comment/450669182018-05-10T16:01:42Z2018-05-10T16:01:43ZTimeout error<div><p>I'm still having the same problem with my Rackspace server, but I will look into IPv6 when I get a chance.</p></div>William Makleytag:help.rubygems.org,2010-01-19:Comment/450669182018-05-10T20:16:43Z2018-05-10T20:16:48ZTimeout error<div><p>The same problem is currently being experienced by me.</p>
<p>Rubygems is unable to download from <a href="https://api.rubygems.org/specs.4.8.gz">https://api.rubygems.org/specs.4.8.gz</a>, yet that address is reachable by me (via ping) and I can download the file using my browser without problem.<br>
I only just now updated to the latest rubygems (2.7.6, using Ruby 2.4.4p296) (had issues before and after update).</p></div>David Baileytag:help.rubygems.org,2010-01-19:Comment/450669182018-05-11T10:37:19Z2018-05-11T10:37:19ZTimeout error<div><p>I am still experiencing the issue. And nmap still shows "filtered" for IPv6 addresses of api.rubygems.org. If I disable IPv6 - everything works fine, gem's remote commands work as expected.</p></div>Alexei Khlebnikovtag:help.rubygems.org,2010-01-19:Comment/450669182018-05-11T10:44:41Z2018-05-11T10:44:42ZTimeout error<div><blockquote>
<p>yet that address is reachable by me (via ping)</p>
</blockquote>
<p>Your ping may have chosen the IPv4 address maybe? My ping fails to reach api.rubygems.org via IPv6. Succeeds via IPv4 though.</p></div>Alexei Khlebnikovtag:help.rubygems.org,2010-01-19:Comment/450669182018-05-11T11:18:48Z2018-05-11T11:18:49ZTimeout error<div><blockquote>
<p>I can download the file using my browser</p>
</blockquote>
<p>Many browsers implement Happy Eyeballs algorithm (fast fallback to IPv4, <a href="https://en.wikipedia.org/wiki/Happy_Eyeballs">https://en.wikipedia.org/wiki/Happy_Eyeballs</a> ). Thus a browser may work, but gem may not.</p></div>Alexei Khlebnikovtag:help.rubygems.org,2010-01-19:Comment/450669182018-05-11T11:25:12Z2018-05-11T11:25:13ZTimeout error<div><blockquote>
<p>I'm having the same issue ... Running debian 9.4 on this machine, but on a macbook pro (running High Sierra) it works perfectly</p>
</blockquote>
<p>OS X implements Happy Eyeballs on the system level. Linux does not.</p>
<p>Ruby could implement Happy Eyeballs in its standard library (in TCPClient?), but so far it didn't happen.</p></div>Alexei Khlebnikovtag:help.rubygems.org,2010-01-19:Comment/450669182018-05-11T11:27:56Z2018-05-11T11:27:57ZTimeout error<div><p>Dear Support Staff members. It would be nice if you fixed this issue soon. Now, when Ubuntu 18.04 has been released, many people are upgrading their gems and having this issue.</p></div>Alexei Khlebnikovtag:help.rubygems.org,2010-01-19:Comment/450669182018-05-19T21:28:17Z2018-05-19T21:28:17ZTimeout error<div><p>Hi Alexei,</p>
<p>Thanks for pointing out that our ipv6 isn't work. We will try to fix it as soon as possible. It shouldn't cause your gem install to fail or timeout tho. rubygems client uses ipv4 addresses. Can you please verify you see ipv6 requests are being made when you run gem install ?</p></div>sonalkr132tag:help.rubygems.org,2010-01-19:Comment/450669182018-05-20T09:57:14Z2018-05-20T09:57:16ZTimeout error<div><p>Got the same issue, disable ipv6 for now as a temporary solution:<br>
<a href="https://wiki.archlinux.org/index.php/IPv6#Disable_IPv6">https://wiki.archlinux.org/index.php/IPv6#Disable_IPv6</a></p></div>Tien Dotag:help.rubygems.org,2010-01-19:Comment/450669182018-05-22T12:08:44Z2018-05-22T12:08:45ZTimeout error<div><p>I also published another temporary solution on StackOverflow, that selectively deprioritizes IPv6 addresses of api.rubygems.org only:</p>
<p><a href="https://stackoverflow.com/a/50349235/1016580">https://stackoverflow.com/a/50349235/1016580</a></p></div>Alexei Khlebnikovtag:help.rubygems.org,2010-01-19:Comment/450669182018-05-22T12:27:49Z2018-05-22T12:27:51ZTimeout error<div><p>Hi Aditya,</p>
<p>I have made a small test that you asked me to do. I used <code>gem search</code> instead of <code>gem install</code> though.</p>
<p>In one terminal I am running <code>gem</code>:</p>
<pre>
<code>$ gem search --remote rails
*** REMOTE GEMS ***</code>
</pre>
<p><code>gem</code> is stalling for ~1 minute in this terminal.</p>
<p>While <code>gem</code> is stalling, I am running <code>netstat</code> in another terminal:</p>
<pre>
<code># netstat -tnp | grep ruby
tcp6 0 1 (my ipv6 address here):39080 2a04:4e42:400::514:443 SYN_SENT 16339/ruby2.5</code>
</pre>
<p>And <code>2a04:4e42:400::514</code> is one of the addresses of <code>api.rubygems.org</code>.</p>
<p>My conclusion is that <code>gem</code> uses IPv6 when it can.</p></div>Alexei Khlebnikovtag:help.rubygems.org,2010-01-19:Comment/450669182018-05-22T12:44:42Z2018-05-22T12:44:43ZTimeout error<div><p>Here is <code>gem</code>'s debug output, if it will be helpful:</p>
<pre>
<code>$ time gem search --remote --verbose --debug rails
NOTE: Debugging mode prints all exceptions even when rescued
Exception `LoadError' at /usr/lib/ruby/2.5.0/resolv.rb:170 - LoadError
*** REMOTE GEMS ***
Exception `Errno::EEXIST' at /usr/lib/ruby/2.5.0/fileutils.rb:232 - File exists @ dir_s_mkdir - /home/alexei/.gem/specs/api.rubygems.org%443
Exception `Errno::ENOENT' at /usr/lib/ruby/2.5.0/rubygems/remote_fetcher.rb:325 - No such file or directory @ rb_file_s_stat - /home/alexei/.gem/specs/api.rubygems.org%443/latest_specs.4.8
Exception `Net::OpenTimeout' at /usr/lib/ruby/2.5.0/net/http.rb:937 - execution expired
Exception `Net::OpenTimeout' at /usr/lib/ruby/2.5.0/net/http.rb:939 - execution expired
Exception `Net::OpenTimeout' at /usr/lib/ruby/2.5.0/timeout.rb:114 - execution expired
Exception `Net::OpenTimeout' at /usr/lib/ruby/2.5.0/net/http.rb:997 - execution expired
Exception `Gem::RemoteFetcher::UnknownHostError' at /usr/lib/ruby/2.5.0/rubygems/remote_fetcher.rb:306 - timed out (https://api.rubygems.org/latest_specs.4.8.gz)
Exception `Gem::RemoteFetcher::UnknownHostError' at /usr/lib/ruby/2.5.0/rubygems/spec_fetcher.rb:269 - timed out (https://api.rubygems.org/latest_specs.4.8.gz)
real 1m0,176s
user 0m0,139s
sys 0m0,011s</code>
</pre></div>Alexei Khlebnikovtag:help.rubygems.org,2010-01-19:Comment/450669182018-07-17T02:33:16Z2018-07-17T02:33:18ZTimeout error<div><p>I also just hit this issue, disabling IPV6 on my workstation fixed it.</p></div>Zach Huntington-Meathtag:help.rubygems.org,2010-01-19:Comment/450669182018-07-22T17:11:35Z2018-07-22T17:11:35ZTimeout error<div><p>Closing for now. We can follow up on IPV6 work on the project, I believe, as at this point we're not really providing support in this thread.</p></div>kerrizortag:help.rubygems.org,2010-01-19:Comment/450669182020-08-25T06:15:19Z2020-08-25T06:15:19ZTimeout error<div><p>Hi everyone,</p>
<p>Sorry about the delay in getting this resolved. I have filed a support ticket on Fastly and hopefully, we will get this resolved soon.</p>
<p>It would be very helpful if any of you can take some to run some commands for debugging info. Specifically, what is the output of the following commands when running from the host which has IPv6 connection issue to rubygems.org:<br></p>
<pre>
<code>$ wget -6 rubygems.org
$ wget -6 www.ttora.com
$ traceroute 2a04:4e42::70</code>
</pre>
If you are feeling particularly generous, please add send pcap file for requests to rubygems.org over IPv6 as well. You can use <code>tshark -i any -f "host rubygems.org" -w rubygems.pcap</code> or <code>sudo tcpdump -i any host rubygems.org -w rubygems.pcap</code></div>sonalkr132tag:help.rubygems.org,2010-01-19:Comment/450669182020-08-27T03:38:45Z2020-08-27T03:38:48ZTimeout error<div><p>Thanks sonalkr132 for following up!</p>
<p>Using latest Ruby from an up-to-date Homebrew installation:</p>
<p>$ sw_vers ProductName: Mac OS X<br>
ProductVersion: 10.14.6<br>
BuildVersion: 18G6020</p>
<p>$ ruby --version ruby 2.7.1p83 (2020-03-31 revision a0c7c23c9c) [x86_64-darwin18]</p>
<p>$ wget -6 rubygems.org --2020-08-26 22:24:39-- <a href="http://rubygems.org/">http://rubygems.org/</a> Resolving rubygems.org (rubygems.org)... 2a04:4e42::70<br>
Connecting to rubygems.org (rubygems.org)|2a04:4e42::70|:80... failed: Operation timed out.<br>
Retrying.</p>
<p>--2020-08-26 22:25:55-- (try: 2) <a href="http://rubygems.org/">http://rubygems.org/</a> Connecting to rubygems.org (rubygems.org)|2a04:4e42::70|:80... ^C</p>
<p>$ wget -6 <a href="http://www.ttora.com">www.ttora.com</a> --2020-08-26 22:26:08-- <a href="http://www.ttora.com/">http://www.ttora.com/</a> Resolving <a href="http://www.ttora.com">www.ttora.com</a> (<a href="http://www.ttora.com">www.ttora.com</a>)... 2606:4700::6810:ad66, 2606:4700::6810:4552<br>
Connecting to <a href="http://www.ttora.com">www.ttora.com</a> (<a href="http://www.ttora.com)|2606:4700::6810:ad66|:80">www.ttora.com)|2606:4700::6810:ad66|:80</a>... failed: Operation timed out.<br>
Connecting to <a href="http://www.ttora.com">www.ttora.com</a> (<a href="http://www.ttora.com)|2606:4700::6810:4552|:80">www.ttora.com)|2606:4700::6810:4552|:80</a>... ^C</p>
<p>$ traceroute 2a04:4e42::70 traceroute: unknown host 2a04:4e42::70</p>
<p>$ traceroute6 2a04:4e42::70 traceroute6 to 2a04:4e42::70 (2a04:4e42::70) from 2600:6c44:97f:fa4a:6010:8efa:2829:ed0f, 64 hops max, 12 byte packets<br>
1 2600:6c44:97f:fa4a:6238:e0ff:fe73:2187 2.125 ms 2.838 ms 2.362 ms 2 * * * 3 2001-0506-0100-2216-0000-0000-0000-0005.inf6.spectrum.com 18.902 ms 13.942 ms 12.446 ms 4 2001-0506-0100-80ba-0000-0000-0000-0001.inf6.spectrum.com 14.032 ms 15.166 ms * 5 2001-0506-0100-206c-0000-0000-0000-0001.inf6.spectrum.com 20.474 ms 17.439 ms * 6 2001-0506-0100-2076-0000-0000-0000-0005.inf6.spectrum.com 22.806 ms 19.869 ms * 7 2001-0506-0100-0202-0000-0000-0000-0009.inf6.spectrum.com 33.397 ms * 26.311 ms 8 2001-0506-0100-0013-0000-0000-0000-0005.inf6.spectrum.com 24.628 ms * 30.159 ms 9 * * * 10 * * *<br>
11 * * *<br>
12 * * *<br>
13 * * *<br>
14 * * *<br>
15 * * *<br>
16 * * *<br>
17 * * *<br>
18 * * *<br>
19 * * *<br>
^C</p>
<p>... meanwhile ...</p>
<p>$ sudo tcpdump -i any host rubygems.org -w rubygems.pcap tcpdump: data link type PKTAP<br>
tcpdump: listening on any, link-type PKTAP (Apple DLT_PKTAP), capture size 262144 bytes<br>
^C72 packets captured 16797 packets received by filter<br>
0 packets dropped by kernel</p>
<p>$ ls -l rubygems.pcap -rw-r--r-- 1 root admin 10988 Aug 26 22:33 rubygems.pcap</p></div>Curtis Ruedentag:help.rubygems.org,2010-01-19:Comment/450669182020-08-27T11:38:50Z2020-08-27T11:38:50ZTimeout error<div><p>Hi Curtis,</p>
<p>Thank you for taking the time to send us this.<br>
Unfortunately, your issue seems to be specific to your host/network.</p>
<blockquote>
<p>$ wget -6 <a href="http://www.ttora.com">www.ttora.com</a> --2020-08-26 22:26:08-- <a href="http://www.ttora.com/">http://www.ttora.com/</a> Resolving <a href="http://www.ttora.com">www.ttora.com</a> (<a href="http://www.ttora.com">www.ttora.com</a>)... 2606:4700::6810:ad66, 2606:4700::6810:4552<br>
Connecting to <a href="http://www.ttora.com">www.ttora.com</a> (<a href="http://www.ttora.com)|2606:4700::6810:ad66|:80">www.ttora.com)|2606:4700::6810:ad66|:80</a>... failed: Operation timed out.<br>
Connecting to <a href="http://www.ttora.com">www.ttora.com</a> (<a href="http://www.ttora.com)|2606:4700::6810:4552|:80">www.ttora.com)|2606:4700::6810:4552|:80</a>... ^C</p>
</blockquote>
<p>users who have the issue with accessing rubygems.org specifically are able to access other sites on IPv6. Even <code>wget -6 google.com</code> will timeout for you. Perhaps you can run some tests on your network about why you are not able to connect to IPv6 sites when you have an IPv6 address on your host <a href="https://test-ipv6.com/">https://test-ipv6.com/</a>.</p>
<p>Please feel free to let us know if you are abl to access sites beside rubygems.org on IPv6 but not rubygems.org.</p>
<p>At this time I am intrested debug output from user who can't access rubygems.org specifically.</p>
<p>If you are interested in knowing why <code>gem install</code> is timing out even tho you have IPv4 connectivity, please check <a href="https://github.com/rubygems/rubygems/pull/2662">this</a>.</p></div>sonalkr132tag:help.rubygems.org,2010-01-19:Comment/450669182020-08-27T14:35:00Z2020-09-29T12:40:35ZTimeout error<div><p>Thanks sonalkr132 for the quick reply, and sorry that I can't provide the data you need.</p>
<p>I look forward to your PR being finalized and merged, so that people with broken IPv6 support (I'm guessing there are many besides only me) can still have working gem commands out of the box. I greatly appreciate your efforts in driving this forward!</p></div>Curtis Ruedentag:help.rubygems.org,2010-01-19:Comment/450669182020-09-29T12:45:49Z2020-09-29T12:45:49ZTimeout error<div><p>No problem. I am hopeful that the fix will be included in the next release.<br>
You can help us test it and confirm that it fixed your issue, either right from my branch or you can wait until it has a rc.</p></div>sonalkr132