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

ENETRESET in remote_fetcher:api_endpoint on Windows 7 / ruby 2.2 / gems 2.4.5 #1214

Closed
altmind opened this issue Mar 27, 2015 · 13 comments
Closed

Comments

@altmind
Copy link

altmind commented Mar 27, 2015

Using rubyinstaller to install Ruby 2.2.1-x86 on windows 7 x64 machine. No proxy configured, no firewalls active, no antivirus software installed. Plain direct connection to internet.

c:\work>ruby -v
ruby 2.2.1p85 (2015-02-26 revision 49769) [i386-mingw32]
c:\work>gem -v
2.4.5

Trying to execute any gem network operation fails with

c:\work>gem install --backtrace aws-sdk
ERROR:  While executing gem ... (Errno::ENETRESET)
    The connection has been broken due to keep-alive activity detecting a failure while the operation was in progress. - recvfrom(2)
        c:/Ruby22/lib/ruby/2.2.0/resolv.rb:759:in `recvfrom'
        c:/Ruby22/lib/ruby/2.2.0/resolv.rb:759:in `recv_reply'
        c:/Ruby22/lib/ruby/2.2.0/resolv.rb:690:in `request'
        c:/Ruby22/lib/ruby/2.2.0/resolv.rb:528:in `block in fetch_resource'
        c:/Ruby22/lib/ruby/2.2.0/resolv.rb:1096:in `block (3 levels) in resolv'
        c:/Ruby22/lib/ruby/2.2.0/resolv.rb:1094:in `each'
        c:/Ruby22/lib/ruby/2.2.0/resolv.rb:1094:in `block (2 levels) in resolv'
        c:/Ruby22/lib/ruby/2.2.0/resolv.rb:1093:in `each'
        c:/Ruby22/lib/ruby/2.2.0/resolv.rb:1093:in `block in resolv'
        c:/Ruby22/lib/ruby/2.2.0/resolv.rb:1091:in `each'
        c:/Ruby22/lib/ruby/2.2.0/resolv.rb:1091:in `resolv'
        c:/Ruby22/lib/ruby/2.2.0/resolv.rb:519:in `fetch_resource'
        c:/Ruby22/lib/ruby/2.2.0/resolv.rb:509:in `each_resource'
        c:/Ruby22/lib/ruby/2.2.0/resolv.rb:490:in `getresource'
        c:/Ruby22/lib/ruby/2.2.0/rubygems/remote_fetcher.rb:92:in `api_endpoint'
        c:/Ruby22/lib/ruby/2.2.0/rubygems/source.rb:46:in `api_uri'
        c:/Ruby22/lib/ruby/2.2.0/rubygems/source.rb:85:in `dependency_resolver_set'
        c:/Ruby22/lib/ruby/2.2.0/rubygems/resolver/best_set.rb:23:in `block in pick_sets'
        c:/Ruby22/lib/ruby/2.2.0/rubygems/source_list.rb:97:in `each'
        c:/Ruby22/lib/ruby/2.2.0/rubygems/source_list.rb:97:in `each_source'
        c:/Ruby22/lib/ruby/2.2.0/rubygems/resolver/best_set.rb:22:in `pick_sets'
        c:/Ruby22/lib/ruby/2.2.0/rubygems/resolver/best_set.rb:28:in `find_all'
        c:/Ruby22/lib/ruby/2.2.0/rubygems/resolver/installer_set.rb:151:in `find_all'
        c:/Ruby22/lib/ruby/2.2.0/rubygems/resolver/installer_set.rb:54:in `add_always_install'
        c:/Ruby22/lib/ruby/2.2.0/rubygems/dependency_installer.rb:463:in `resolve_dependencies'
        c:/Ruby22/lib/ruby/2.2.0/rubygems/commands/install_command.rb:238:in `install_gem'
        c:/Ruby22/lib/ruby/2.2.0/rubygems/commands/install_command.rb:299:in `block in install_gems'
        c:/Ruby22/lib/ruby/2.2.0/rubygems/commands/install_command.rb:295:in `each'
        c:/Ruby22/lib/ruby/2.2.0/rubygems/commands/install_command.rb:295:in `install_gems'
        c:/Ruby22/lib/ruby/2.2.0/rubygems/commands/install_command.rb:202:in `execute'
        c:/Ruby22/lib/ruby/2.2.0/rubygems/command.rb:307:in `invoke_with_build_args'
        c:/Ruby22/lib/ruby/2.2.0/rubygems/command_manager.rb:168:in `process_args'
        c:/Ruby22/lib/ruby/2.2.0/rubygems/command_manager.rb:138:in `run'
        c:/Ruby22/lib/ruby/2.2.0/rubygems/gem_runner.rb:54:in `run'
        c:/Ruby22/bin/gem:21:in `<main>'

This traces back to line https://github.com/rubygems/rubygems/blob/master/lib/rubygems/remote_fetcher.rb#L94

Maybe windows dns client cannot handle SRV requests(dunno, never looked into the cause of the problem)

This can be fixed if we replace rescue Resolv::ResolvError with plain rescue or more specific dns resolve error handling.

@tenderlove
Copy link
Contributor

Wow, I've never seen that exception before. If you rescue Errno::ENETRESET, will it work?

@cyberegg
Copy link

Corporate network, Mcafee (a/v only), no software firewalls, no proxies.
Windows 7 Ult x64
Ruby 2.1.6
Rubygems 2.4.7
gem install anything gave this same error
Tried all sorts of DNS, network, ruby troubleshooting.

Came down to one simple thing: turn the Windows firewall ON.

Turn it OFF, immediately able to reproduce error. Turn it ON and the gems start flowing again. GO FIGURE.

Exact same computer hardware/software build right next to it, no issues retrieving gems with the M$ firewall up or down. Chalking this up to "user customization" of their workstation.

"Nuke it from orbit... only way to be sure." -Hicks

@altmind
Copy link
Author

altmind commented May 19, 2015

@tenderlove indeed rescue Errno::ENETRESET worked. canot retest it, thou.

@djberg96
Copy link
Contributor

I disabled my firewall, but was unable to reproduce this error. I tried various firewall configurations, too. Personally I'd blame McAfee. ;)

Anyway, closing this one out as "unable to reproduce".

@aleksey-korolev
Copy link

Reproducing it right now on Windows 7 Ult x64 SP1
ruby 2.2.1p85
gem install/update anything gives this error
Have Avast Free Antivirus, diabling it doesn't help. Windows Firewall is off.
Updating to ruby to 2.2.3 doesn't help.
ruby -v
2.2.3p173 (2015-08-18 revision 51636) [x64-mingw32]
Ruby on Windows is pain...

@aleksey-korolev
Copy link

Tried same command using same notebook with same software but from another location with another internet provider and the command worked fine, so it might be network infrastructure related thing like MTU size somewhere on a router:

D:\Work>gem update rhc
Updating installed gems
Updating rhc
Fetching: rhc-1.38.4.gem (100%)

If this is your first time installing the RHC tools, please run 'rhc setup'

Successfully installed rhc-1.38.4
Parsing documentation for rhc-1.38.4
Installing ri documentation for rhc-1.38.4
Installing darkfish documentation for rhc-1.38.4
Done installing documentation for rhc after 7 seconds
Parsing documentation for rhc-1.38.4
Done installing documentation for rhc after 3 seconds
Gems updated: rhc

@bezaworkmetropolia
Copy link

@cyberegg ur method worked for me

@rioux602
Copy link

rioux602 commented Mar 2, 2016

@cyberegg Thanks!!!

@Stromweld
Copy link

I also found @cyberegg's trick to work. I also found that 2 of my machines were in vmware that were running into this same issue and swapping out the vm nic from intel E1000 to vmxnet3 also fixed this issue with the firewall turned off.

@vivekm2017
Copy link

I was running- "gem install berkshelf", I got the same error. So when I ran "gem install bundle" first and then tried the "gem install berkshelf" - it worked!!

@BoraDev
Copy link

BoraDev commented Dec 10, 2016

Same here guys. I turned Windows Firewall ON,and it works. How is this possible I don't know. Anyway, @cyberegg ,thanks a lot.

@ppjuns
Copy link

ppjuns commented Apr 23, 2017

@cyberegg ,thx it worked for me ,I try the method three times ,after reborn my pc and permit the firewall tip window ,finally it run successfully.

@renaatdemuynck
Copy link

I had the same problem. Fixed by temporarily disabling my anti-virus (Symantec Endpoint Protection).

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

No branches or pull requests