This help site has been deprecated. Please send your requests to support@rubygems.org
Timeout error
Hey - I am getting a timeout error on every gem update I am trying to do. after doing some reading - some peopel had this issue but it was specific to their projects. I removed the project from my computer, uninstalled rails - and then attempted to update the gems. I can download and install each gem individually if I go to a specific gem URL after the timeout happens. if I run gem update I get the following:
ERROR: While executing gem ... (Gem::RemoteFetcher::UnknownHostError)
timed out (https://api.rubygems.org/latest_specs.4.8.gz)
gem install rails gives me:
ERROR: Could not find a valid gem 'rails' (>= 0), here is why:
Unable to download data from https://rubygems.org/ - timed out (https://api.rubygems.org/specs.4.8.gz)
All help related to this issue will be appreciated -it's been going on for about 2 weeks but is only now a critical issue.
Discussions are closed to public comments.
If you need help with RubyGems.org please
start a new discussion.
Keyboard shortcuts
Generic
? | Show this help |
---|---|
ESC | Blurs the current field |
Comment Form
r | Focus the comment reply box |
---|---|
^ + ↩ | Submit the comment |
You can use Command ⌘
instead of Control ^
on Mac
Support Staff 1 Posted by sonalkr132 on 22 Apr, 2018 12:53 PM
hi guard.16,
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?
2 Posted by William Makley on 23 Apr, 2018 07:28 PM
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.
/opt/rubies$ ./ruby-2.3.7/bin/gem install bundler
ERROR: Could not find a valid gem 'bundler' (>= 0), here is why:
Unable to download data from https://rubygems.org/ - timed out (https://api.rubygems.org/specs.4.8.gz)
However, curl works fine:
curl https://api.rubygems.org/specs.4.8.gz > specs.4.8.gz
No problems with that!
3 Posted by William Makley on 24 Apr, 2018 02:40 PM
*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.
4 Posted by Ivan on 25 Apr, 2018 02:47 AM
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. `curl http://rubygems.org/gems/ffi-1.9.23.gem -o outfile`) successfully.
Support Staff 5 Posted by kerrizor on 04 May, 2018 05:35 PM
Checking in: is this still an issue for you?
6 Posted by cabasp on 08 May, 2018 12:44 AM
I'm having the same issue, i'm able to
curl https://api.rubygems.org/specs.4.8.gz > specs.4.8.gz
but runningwget https://api.rubygems.org/specs.4.8.gz
times out.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
7 Posted by Alexei Khlebnik... on 09 May, 2018 08:59 AM
The issue seems to be that https://api.rubygems.org/ is unreachable by IPv6.
8 Posted by Alexei Khlebnik... on 09 May, 2018 09:05 AM
Here is (part of) Nmap report for IPv6 addresses of api.rubygems.com:
Report for IPv4 looks fine though:
9 Posted by Ivan on 10 May, 2018 02:55 AM
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!
10 Posted by William Makley on 10 May, 2018 04:01 PM
I'm still having the same problem with my Rackspace server, but I will look into IPv6 when I get a chance.
11 Posted by David Bailey on 10 May, 2018 08:16 PM
The same problem is currently being experienced by me.
Rubygems is unable to download from https://api.rubygems.org/specs.4.8.gz, yet that address is reachable by me (via ping) and I can download the file using my browser without problem.
I only just now updated to the latest rubygems (2.7.6, using Ruby 2.4.4p296) (had issues before and after update).
12 Posted by Alexei Khlebnik... on 11 May, 2018 10:37 AM
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.
13 Posted by Alexei Khlebnik... on 11 May, 2018 10:44 AM
Your ping may have chosen the IPv4 address maybe? My ping fails to reach api.rubygems.org via IPv6. Succeeds via IPv4 though.
14 Posted by Alexei Khlebnik... on 11 May, 2018 11:18 AM
Many browsers implement Happy Eyeballs algorithm (fast fallback to IPv4, https://en.wikipedia.org/wiki/Happy_Eyeballs ). Thus a browser may work, but gem may not.
15 Posted by Alexei Khlebnik... on 11 May, 2018 11:25 AM
OS X implements Happy Eyeballs on the system level. Linux does not.
Ruby could implement Happy Eyeballs in its standard library (in TCPClient?), but so far it didn't happen.
16 Posted by Alexei Khlebnik... on 11 May, 2018 11:27 AM
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.
Support Staff 17 Posted by sonalkr132 on 19 May, 2018 09:28 PM
Hi Alexei,
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 ?
18 Posted by Tien Do on 20 May, 2018 09:57 AM
Got the same issue, disable ipv6 for now as a temporary solution:
https://wiki.archlinux.org/index.php/IPv6#Disable_IPv6
19 Posted by Alexei Khlebnik... on 22 May, 2018 12:08 PM
I also published another temporary solution on StackOverflow, that selectively deprioritizes IPv6 addresses of api.rubygems.org only:
https://stackoverflow.com/a/50349235/1016580
20 Posted by Alexei Khlebnik... on 22 May, 2018 12:27 PM
Hi Aditya,
I have made a small test that you asked me to do. I used
gem search
instead ofgem install
though.In one terminal I am running
gem
:gem
is stalling for ~1 minute in this terminal.While
gem
is stalling, I am runningnetstat
in another terminal:And
2a04:4e42:400::514
is one of the addresses ofapi.rubygems.org
.My conclusion is that
gem
uses IPv6 when it can.21 Posted by Alexei Khlebnik... on 22 May, 2018 12:44 PM
Here is
gem
's debug output, if it will be helpful:22 Posted by Zach Huntington... on 17 Jul, 2018 02:33 AM
I also just hit this issue, disabling IPV6 on my workstation fixed it.
Support Staff 23 Posted by kerrizor on 22 Jul, 2018 05:11 PM
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.
kerrizor closed this discussion on 22 Jul, 2018 05:11 PM.
sonalkr132 re-opened this discussion on 25 Aug, 2020 06:13 AM
Support Staff 24 Posted by sonalkr132 on 25 Aug, 2020 06:15 AM
Hi everyone,
Sorry about the delay in getting this resolved. I have filed a support ticket on Fastly and hopefully, we will get this resolved soon.
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:
If you are feeling particularly generous, please add send pcap file for requests to rubygems.org over IPv6 as well. You can usetshark -i any -f "host rubygems.org" -w rubygems.pcap
orsudo tcpdump -i any host rubygems.org -w rubygems.pcap
25 Posted by Curtis Rueden on 27 Aug, 2020 03:38 AM
Thanks sonalkr132 for following up!
Using latest Ruby from an up-to-date Homebrew installation:
$ sw_vers
ProductName: Mac OS X
ProductVersion: 10.14.6
BuildVersion: 18G6020
$ ruby --version
ruby 2.7.1p83 (2020-03-31 revision a0c7c23c9c) [x86_64-darwin18]
$ wget -6 rubygems.org
--2020-08-26 22:24:39-- http://rubygems.org/
Resolving rubygems.org (rubygems.org)... 2a04:4e42::70
Connecting to rubygems.org (rubygems.org)|2a04:4e42::70|:80... failed: Operation timed out.
Retrying.
--2020-08-26 22:25:55-- (try: 2) http://rubygems.org/
Connecting to rubygems.org (rubygems.org)|2a04:4e42::70|:80... ^C
$ wget -6 www.ttora.com
--2020-08-26 22:26:08-- http://www.ttora.com/
Resolving www.ttora.com (www.ttora.com)... 2606:4700::6810:ad66, 2606:4700::6810:4552
Connecting to www.ttora.com (www.ttora.com)|2606:4700::6810:ad66|:80... failed: Operation timed out.
Connecting to www.ttora.com (www.ttora.com)|2606:4700::6810:4552|:80... ^C
$ traceroute 2a04:4e42::70
traceroute: unknown host 2a04:4e42::70
$ 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
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 * * *
11 * * *
12 * * *
13 * * *
14 * * *
15 * * *
16 * * *
17 * * *
18 * * *
19 * * *
^C
... meanwhile ...
$ sudo tcpdump -i any host rubygems.org -w rubygems.pcap
tcpdump: data link type PKTAP
tcpdump: listening on any, link-type PKTAP (Apple DLT_PKTAP), capture size 262144 bytes
^C72 packets captured
16797 packets received by filter
0 packets dropped by kernel
$ ls -l rubygems.pcap
-rw-r--r-- 1 root admin 10988 Aug 26 22:33 rubygems.pcap
Support Staff 26 Posted by sonalkr132 on 27 Aug, 2020 11:38 AM
Hi Curtis,
Thank you for taking the time to send us this.
Unfortunately, your issue seems to be specific to your host/network.
users who have the issue with accessing rubygems.org specifically are able to access other sites on IPv6. Even
wget -6 google.com
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 https://test-ipv6.com/.Please feel free to let us know if you are abl to access sites beside rubygems.org on IPv6 but not rubygems.org.
At this time I am intrested debug output from user who can't access rubygems.org specifically.
If you are interested in knowing why
gem install
is timing out even tho you have IPv4 connectivity, please check this.27 Posted by Curtis Rueden on 27 Aug, 2020 02:35 PM
Thanks sonalkr132 for the quick reply, and sorry that I can't provide the data you need.
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!
Support Staff 28 Posted by sonalkr132 on 29 Sep, 2020 12:45 PM
No problem. I am hopeful that the fix will be included in the next release.
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.