Jruby: getprotobyname_r failed warning on ubuntu xenial minimal

Created on 7 Jun 2016  路  1Comment  路  Source: jruby/jruby

Environment

jruby 9.1.2.0 (2.3.0) 2016-05-26 7357c8f OpenJDK 64-Bit Server VM 25.91-b14 on 1.8.0_91-8u91-b14-0ubuntu4~16.04.1-b14 +jit [linux-x86_64]
ubuntu 16.04 LTS

Steps to reproduce:

docker run --rm -it etehtsea/jruby-ubuntu:9.1.2.0 jruby -v -e "require 'socket'; p Socket.new(2,1,0)"
jruby 9.1.2.0 (2.3.0) 2016-05-26 7357c8f OpenJDK 64-Bit Server VM 25.91-b14 on 1.8.0_91-8u91-b14-0ubuntu4~16.04.1-b14 +jit [linux-x86_64]
Jun 07, 2016 6:02:52 AM jnr.netdb.NativeProtocolsDB load
WARNING: Failed to load native protocols db
java.lang.RuntimeException: getprotobyname_r failed
    at jnr.netdb.NativeProtocolsDB$LinuxNativeProtocolsDB.getProtocolByName(NativeProtocolsDB.java:180)
    at jnr.netdb.NativeProtocolsDB.load(NativeProtocolsDB.java:80)
    at jnr.netdb.NativeProtocolsDB.access$000(NativeProtocolsDB.java:40)
    at jnr.netdb.NativeProtocolsDB$SingletonHolder.<clinit>(NativeProtocolsDB.java:47)
    at jnr.netdb.NativeProtocolsDB.getInstance(NativeProtocolsDB.java:43)
    at jnr.netdb.Protocol$ProtocolDBSingletonHolder.load(Protocol.java:107)
    at jnr.netdb.Protocol$ProtocolDBSingletonHolder.<clinit>(Protocol.java:103)
    at jnr.netdb.Protocol.getProtocolDB(Protocol.java:96)
    at jnr.netdb.Protocol.getProtocolByNumber(Protocol.java:59)
    at org.jruby.ext.socket.RubySocket.<init>(RubySocket.java:667)
    at org.jruby.ext.socket.RubySocket$1.allocate(RubySocket.java:133)
    at org.jruby.RubyClass.allocate(RubyClass.java:227)
    at org.jruby.RubyClass.newInstance(RubyClass.java:903)
    at org.jruby.RubyIO.newInstance(RubyIO.java:867)
    at org.jruby.RubyIO$INVOKER$s$0$0$newInstance.call(RubyIO$INVOKER$s$0$0$newInstance.gen)
    at org.jruby.internal.runtime.methods.DynamicMethod.call(DynamicMethod.java:217)
    at org.jruby.internal.runtime.methods.DynamicMethod.call(DynamicMethod.java:213)
    at org.jruby.runtime.callsite.CachingCallSite.cacheAndCall(CachingCallSite.java:353)
    at org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:227)
    at DashE.invokeOther5:new(-e)
    at DashE.RUBY$script(-e:1)
    at java.lang.invoke.MethodHandle.invokeWithArguments(MethodHandle.java:627)
    at org.jruby.ir.Compiler$1.load(Compiler.java:111)
    at org.jruby.Ruby.runScript(Ruby.java:833)
    at org.jruby.Ruby.runScript(Ruby.java:825)
    at org.jruby.Ruby.runNormally(Ruby.java:760)
    at org.jruby.Ruby.runFromMain(Ruby.java:579)
    at org.jruby.Main.doRunFromMain(Main.java:425)
    at org.jruby.Main.internalRun(Main.java:313)
    at org.jruby.Main.run(Main.java:242)
    at org.jruby.Main.main(Main.java:204)

#<Socket:fd 23>

Expected behaviour (9.0.5.0):

docker run --rm -it etehtsea/jruby-ubuntu:9.0.5.0 jruby -v -e "require 'socket'; p Socket.new(2,1,0)"
jruby 9.0.5.0 (2.2.3) 2016-01-26 7bee00d OpenJDK 64-Bit Server VM 25.91-b14 on 1.8.0_91-8u91-b14-1~bpo8+1-b14 +jit [linux-amd64]
#<Socket:fd 23>

Most helpful comment

For the next person who stumbles upon this issue while searching madly for a way to resolve the warning:

It appears to be caused by the absence of /etc/protocols, which, in the case of Ubuntu Xenial, can be resolved with apt-get install netbase.

>All comments

For the next person who stumbles upon this issue while searching madly for a way to resolve the warning:

It appears to be caused by the absence of /etc/protocols, which, in the case of Ubuntu Xenial, can be resolved with apt-get install netbase.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

guizmaii picture guizmaii  路  5Comments

Ichaelus picture Ichaelus  路  4Comments

yahonda picture yahonda  路  5Comments

nilsding picture nilsding  路  4Comments

palkan picture palkan  路  3Comments