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

Connection fails with IPv6 without clear error message #4950

Closed
1 of 5 tasks
pre opened this issue Oct 1, 2021 · 4 comments
Closed
1 of 5 tasks

Connection fails with IPv6 without clear error message #4950

pre opened this issue Oct 1, 2021 · 4 comments
Labels

Comments

@pre
Copy link

pre commented Oct 1, 2021

When IPv6 nameservers are listed before IPv4 servers in /etc/resolv.conf, connection to Rubygems fail with

❯ bundle
Fetching source index from https://rubygems.org/
[..]
Retrying fetcher due to error (2/4): Bundler::HTTPError Could not fetch specs from https://rubygems.org/
[..]

Connection was established by moving IPv4 nameservers to be listed before the IPv6 nameservers in /etc/resolv.conf .

The error message did not give any hints about this. The solution was found by obscure googling around. The issue started 6 hours ago and rebooting the machine did not fix it. Root cause may or may not be in my IPv6 connection, but the issue here is the unhelpful error message.

At minimum, the error message could display some kind of technical reason what failed. Currently there are no tips what the developer should be looking for in this kind of obscure error.

This issue is related to:

  • Network problems
  • Installing a library
  • Publishing a library
  • The command line gem
  • Other

Here are my current environment details:

$ gem env
RubyGems Environment:
  - RUBYGEMS VERSION: 3.1.6
  - RUBY VERSION: 2.7.3 (2021-04-05 patchlevel 183) [x86_64-darwin20]
  - INSTALLATION DIRECTORY: /Users/pre/.rvm/gems/ruby-2.7.3@appgyver_platform
  - USER INSTALLATION DIRECTORY: /Users/pre/.gem/ruby/2.7.0
  - RUBY EXECUTABLE: /Users/pre/.rvm/rubies/ruby-2.7.3/bin/ruby
  - GIT EXECUTABLE: /usr/local/bin/git
  - EXECUTABLE DIRECTORY: /Users/pre/.rvm/gems/ruby-2.7.3@appgyver_platform/bin
  - SPEC CACHE DIRECTORY: /Users/pre/.gem/specs
  - SYSTEM CONFIGURATION DIRECTORY: /Users/pre/.rvm/rubies/ruby-2.7.3/etc
  - RUBYGEMS PLATFORMS:
    - ruby
    - x86_64-darwin-20

I will abide by the code of conduct.

@pre pre added the RubyGems label Oct 1, 2021
@pre pre changed the title Connection fails with IPv6 Connection fails with IPv6 without clear error message Oct 1, 2021
@duckinator
Copy link
Member

This is a duplicate of #3805, which was fixed in #4061. As best I can tell, this fix first shipped with Bundler 2.2.0, which was released in December 2020.

@pre please try using the latest version of Bundler and let me know if this problem persists.

@pre
Copy link
Author

pre commented Oct 9, 2021

Thanks! It might be the case that I was running Bundler 2.1.x - I have upgraded to Bundler 2.2.x which might have happened during or right after trying to solve this connectivity issue.

I'll report back if this problem re-appears and Bundler 2.2.x doesn't provide details about the error.

@pre pre closed this as completed Oct 9, 2021
@pre
Copy link
Author

pre commented Oct 11, 2021

With bundler 2.2.28:

❯ bundle update spring
Fetching source index from https://rubygems.org/
Resolving dependencies...
Network error while fetching https://rubygems.org/quick/Marshal.4.8/nokogiri-1.12.5.gemspec.rz (execution expired)

❯ bundle update
Fetching source index from https://rubygems.org/


Retrying fetcher due to error (2/4): Bundler::HTTPError Could not fetch specs from https://rubygems.org/ due to underlying error <timed out (https://rubygems.org/specs.4.8.gz)>

Resolving dependencies...
Network error while fetching https://rubygems.org/quick/Marshal.4.8/rails-7.0.0.alpha2.gemspec.rz (execution expired)

❯ bundle --version
Bundler version 2.2.28

@deivid-rodriguez
Copy link
Member

Can you try upgrading rubygems (https://rubygems.org/pages/download), and then passing the IPV4_FALLBACK_ENABLED=1 environment variable to the bundle update command?

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

3 participants