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

bind: name or service not known when trying to resolve DNS names #3900

Closed
perlun opened this issue May 18, 2016 · 3 comments
Closed

bind: name or service not known when trying to resolve DNS names #3900

perlun opened this issue May 18, 2016 · 3 comments

Comments

@perlun
Copy link
Contributor

perlun commented May 18, 2016

Environment

  • JRuby 1.7.25
  • Java version:
    • java version "1.8.0_05"
    • Java(TM) SE Runtime Environment (build 1.8.0_05-b13)
      ** Java HotSpot(TM) 64-Bit Server VM (build 25.5-b02, mixed mode)
  • OS X:
    • Darwin ecvaawjback.local 15.4.0 Darwin Kernel Version 15.4.0: Fri Feb 26 22:08:05 PST 2016; root:xnu-3248.40.184~3/RELEASE_X86_64 x86_64

Expected behavior

Being able to use resolver.getaddresses without exceptions.

Actual Behavior

An exception like below:

ERROR [2016-05-18 09:05:48.004] ConsoleLogger: Error message: bind: name or service not known
ERROR [2016-05-18 09:05:48.004] ConsoleLogger: Stack trace:
ERROR [2016-05-18 09:05:48.004] ConsoleLogger:         org/jruby/ext/socket/RubyUDPSocket.java:160:in `bind'
ERROR [2016-05-18 09:05:48.004] ConsoleLogger:         /Users/jakobbacklund/git/eCraft.uxFactory.Server/src/server/jruby/jruby-complete-1.7.25.jar!/META-INF/jruby.home/lib/ruby/1.9/resolv.rb:638:in `bind_random_port'
ERROR [2016-05-18 09:05:48.004] ConsoleLogger:         /Users/jakobbacklund/git/eCraft.uxFactory.Server/src/server/jruby/jruby-complete-1.7.25.jar!/META-INF/jruby.home/lib/ruby/1.9/resolv.rb:723:in `initialize'
ERROR [2016-05-18 09:05:48.004] ConsoleLogger:         org/jruby/RubyArray.java:1613:in `each'
ERROR [2016-05-18 09:05:48.004] ConsoleLogger:         /Users/jakobbacklund/git/eCraft.uxFactory.Server/src/server/jruby/jruby-complete-1.7.25.jar!/META-INF/jruby.home/lib/ruby/1.9/resolv.rb:707:in `initialize'
ERROR [2016-05-18 09:05:48.004] ConsoleLogger:         /Users/jakobbacklund/git/eCraft.uxFactory.Server/src/server/jruby/jruby-complete-1.7.25.jar!/META-INF/jruby.home/lib/ruby/1.9/resolv.rb:545:in `make_udp_requester'
ERROR [2016-05-18 09:05:48.005] ConsoleLogger:         /Users/jakobbacklund/git/eCraft.uxFactory.Server/src/server/jruby/jruby-complete-1.7.25.jar!/META-INF/jruby.home/lib/ruby/1.9/resolv.rb:500:in `each_resource'
ERROR [2016-05-18 09:05:48.005] ConsoleLogger:         /Users/jakobbacklund/git/eCraft.uxFactory.Server/src/server/jruby/jruby-complete-1.7.25.jar!/META-INF/jruby.home/lib/ruby/1.9/resolv.rb:396:in `each_address'
ERROR [2016-05-18 09:05:48.005] ConsoleLogger:         /Users/jakobbacklund/git/eCraft.uxFactory.Server/src/server/jruby/jruby-complete-1.7.25.jar!/META-INF/jruby.home/lib/ruby/1.9/resolv.rb:384:in `getaddresses'
ERROR [2016-05-18 09:05:48.005] ConsoleLogger:         /Users/jakobbacklund/git/eCraft.uxFactory.Server/src/server/core/lib/extensions/mongo/uri_parser.rb:81:in `resolve_dns_aliases'

I've looked in the JRuby source code for the failing method (bind_random_port) and it looks like this:

    def self.bind_random_port(udpsock, bind_host="0.0.0.0") # :nodoc:
      begin
        port = rangerand(1024..65535)
        udpsock.bind(bind_host, port)
      rescue Errno::EADDRINUSE
        retry
      end
    end

Note: works for some people but fails for others. Tried rebooting machine with no success.

We tried making a repro case but it unfortunately works even on the machines where the full integrated test fails...

require 'resolv'
resolver = Resolv::DNS.new
puts resolver.getaddresses('localhost').inspect

Any suggestions for how we can debug this more?

@headius
Copy link
Member

headius commented May 18, 2016

I believe I fixed this on master, so it may be possible to backport for 1.7.26.

@headius
Copy link
Member

headius commented May 18, 2016

Duplicate of #3659.

@headius headius closed this as completed May 18, 2016
@headius headius added this to the Invalid or Duplicate milestone May 18, 2016
@headius
Copy link
Member

headius commented May 18, 2016

@perlun If you get a chance you might try a 1.7.26 snapshot from http://ci.jruby.org. Let us know right away if it doesn't Resolv your issues 😄

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