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

gem install bundler (or any gem) fails with Errno::ECONNREFUSED: Connection refused - connect(2) for "your-dns-needs-immediate-attention.dev" port 443 #834

Closed
akshah123 opened this issue Jan 6, 2015 · 4 comments

Comments

@akshah123
Copy link

It looks like with latest ruby version 2.2.0, I am unable to install any gems as they all fail with:

ERROR:  While executing gem ... (Gem::RemoteFetcher::FetchError)
    Errno::ECONNREFUSED: Connection refused - connect(2) for "your-dns-needs-immediate-attention.dev" port 443 (https://your-dns-needs-immediate-attention.dev/quick/Marshal.4.8/bundler-1.7.11.gemspec.rz)

I am able to install all the gems with ruby version 2.1.1 just fine on the same machine/network. I am using rvm version 1.26.8.

I have looked at this ticket rubygems/rubygems#1001 but it doesnt seem to apply since ISP is not comcast.

I also tried debugging this further with:

gem install bundler --debug -V

I noticed that I get following additional error:

Exception `Resolv::DNS::Config::NXDomain' at /home/vagrant/.rvm/rubies/ruby-2.2.0/lib/ruby/2.2.0/resolv.rb:546 - _rubygems._tcp.api.rubygems.org
Exception `Errno::ECONNREFUSED' at /home/vagrant/.rvm/rubies/ruby-2.2.0/lib/ruby/2.2.0/net/http.rb:879 - Connection refused - connect(2) for "your-dns-needs-immediate-attention.dev" port 443
Exception `Gem::RemoteFetcher::FetchError' at /home/vagrant/.rvm/rubies/ruby-2.2.0/lib/ruby/2.2.0/rubygems/remote_fetcher.rb:286 - Errno::ECONNREFUSED: Connection refused - connect(2) for "your-dns-needs-immediate-attention.dev" port 443 (https://your-dns-needs-immediate-attention.dev/quick/Marshal.4.8/bundler-1.7.11.gemspec.rz)
ERROR:  While executing gem ... (Gem::RemoteFetcher::FetchError)

I noticed that it is checking SRV record for _rubygems._tcp.api.rubygems.org which doesn't exist.

Shouldn't it be instead checking for _rubygems._tcp.rubygems.org which does exist? Notice the missing api.

I verified this with directly running the ruby command:

vagrant@vagrant:~$ ruby -rresolv -e "puts (Resolv::DNS.new.getresource '_rubygems._tcp.api.rubygems.org', Resolv::DNS::Resource::IN::SRV).target"
your-dns-needs-immediate-attention.dev
vagrant@vagrant:~$ ruby -rresolv -e "puts (Resolv::DNS.new.getresource '_rubygems._tcp.rubygems.org', Resolv::DNS::Resource::IN::SRV).target"
api.rubygems.org

Any help is greatly appreciated.

@indirect
Copy link
Member

indirect commented Jan 6, 2015

"your-dns-needs-immediate-attention”, perhaps?

@akshah123
Copy link
Author

@indirect 😄
Perhaps.

However, I used http://mxtoolbox.com/SRVLookup.aspx to see if it indeed the DNS config here and even that tool is unable to find the SRV lookup with api in it _rubygems._tcp.api.rubygems.org.

capture

It works just fine for _rubygems._tcp.rubygems.org

image

@akshah123
Copy link
Author

Also, as I mentioned, when I switch to ruby 2.1.1 with RVM, I don't have any problem installing gems.

@akshah123
Copy link
Author

I narrowed down the problem with vagrant. For whatever reason, the vagrant box was not properly working.

I resolved the problem by turning on the natdnshostresolver for the vm box.

http://serverfault.com/questions/453185/vagrant-virtualbox-dns-10-0-2-3-not-working

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

2 participants