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

resolv fails when using IPv6 link-local #4582

Open
jordansissel opened this issue May 2, 2017 · 3 comments
Open

resolv fails when using IPv6 link-local #4582

jordansissel opened this issue May 2, 2017 · 3 comments

Comments

@jordansissel
Copy link
Contributor

Environment

Provide at least:

  • JRuby 1.7.26
  • Operating system and platform (e.g. uname -a): OSX

Other relevant info you may wish to add:
Experienced when using Logstash


User reported the following error in Logstash: (Formatted for easier reading)

 {:message=>“send: name or service not known”, :exception=>“SocketError”, :backtrace=>[
“org/jruby/ext/socket/RubyUDPSocket.java:318:in `send'", 
"/Users/chuacw/Desktop/Elastic/logstash-5.0.0/vendor/jruby/lib/ruby/1.9/resolv.rb:763:in `send’“, 
“/Users/chuacw/Desktop/Elastic/logstash-5.0.0/vendor/jruby/lib/ruby/1.9/resolv.rb:652:in `request'", 
"/Users/chuacw/Desktop/Elastic/logstash-5.0.0/vendor/jruby/lib/ruby/1.9/resolv.rb:512:in `each_resource’“, 
“/Users/chuacw/Desktop/Elastic/logstash-5.0.0/vendor/jruby/lib/ruby/1.9/resolv.rb:1036:in
...

I worked with the user to patch resolv.rb to print the host and port:

(line 763 of lib/ruby/1.9/resolv.rb)

puts "DNS LOOKUP: host: #{@host} - port: #{@port} - msg: #{@msg.inspect}" 
@sock.send(@msg, 0, @host, @port)

Output:

DNS LOOKUP: host: fe80::b675:eff:fef9:4775 - port: 53 - msg: “\xC2\x05\x01\x00\x00\x01\x00\x00\x00\x00\x00\x00\x06stream\atwitter\x03com\x00\x00\x01\x00\x01”

The user's laptop (OSX) has resolver entries for both ipv6 and ipv4, and JRuby picked the ipv6 resolver. This is an OK choice, but if you look at the host fe80::b675:eff:fef9:4775 it is missing the interface which is required for link-local ipv6 addresses (as I understand it).

The user ran scutil --dns and gave me the output:

resolver #1
 search domain[0] : lan
 nameserver[0] : fe80::b675:eff:fef9:4775%en7
 nameserver[1] : 192.168.0.1
 if_index : 13 (en7)
 flags    : Request A records, Request AAAA records
 reach    : Reachable, Directly Reachable Address
...

I realize this is an older/eol JRuby. I have not yet tried to reproduce under JRuby 9k or master.

@jordansissel
Copy link
Contributor Author

/etc/resolv.conf contains what I believe to be an incorrect nameserver (link local missing an interface)

domain lan
nameserver fe80::b675:eff:fef9:4775
nameserver 192.168.0.1

@jordansissel
Copy link
Contributor Author

We tried changing the ipv6 link-local nameserver entry in /etc/resolv.conf to add %en7, just in case, but this did not fix the issue.

@jordansissel
Copy link
Contributor Author

Commenting out the ipv6 nameserver entry in /etc/resolv.conf seems to have fixed it.

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

1 participant