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

Addrinfo not working on alpine linux #4408

Closed
Paxa opened this issue Dec 23, 2016 · 5 comments
Closed

Addrinfo not working on alpine linux #4408

Paxa opened this issue Dec 23, 2016 · 5 comments

Comments

@Paxa
Copy link

Paxa commented Dec 23, 2016

Error caused by

private Protocol protocol = Protocol.getProtocolByNumber(0);

private Protocol protocol = Protocol.getProtocolByNumber(0);

Because getprotobyname_r not exists in musl lib.

Stack trace:

Dec 23, 2016 5:56:19 AM jnr.netdb.NativeProtocolsDB load
WARNING: Failed to load native protocols db
java.lang.UnsatisfiedLinkError: unknown
	at jnr.ffi.provider.jffi.AsmRuntime.newUnsatisifiedLinkError(AsmRuntime.java:40)
	at jnr.netdb.NativeProtocolsDB$LinuxLibProto$jnr$ffi$2.getprotobyname_r(Unknown Source)
	at jnr.netdb.NativeProtocolsDB$LinuxNativeProtocolsDB.getProtocolByName(NativeProtocolsDB.java:176)
	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.Addrinfo.<init>(Addrinfo.java:549)
	at org.jruby.ext.socket.SocketUtils$2.addrinfo(SocketUtils.java:273)
	at org.jruby.ext.socket.SocketUtils.buildAddrinfoList(SocketUtils.java:367)
	at org.jruby.ext.socket.SocketUtils.getaddrinfoList(SocketUtils.java:249)
	at org.jruby.ext.socket.Addrinfo.getaddrinfo(Addrinfo.java:217)
	at org.jruby.ext.socket.Addrinfo$INVOKER$s$0$0$getaddrinfo.call(Addrinfo$INVOKER$s$0$0$getaddrinfo.gen)
	at org.jruby.internal.runtime.methods.JavaMethod$JavaMethodN.call(JavaMethod.java:742)
@headius
Copy link
Member

headius commented Jan 5, 2017

This is a jnr-netdb fix. We'll leave this open until we upgrade to a fixed version.

@Paxa
Copy link
Author

Paxa commented Jun 21, 2017

It was message from library and that library continued to work.
I moved to alpine with glibc and that message is gone

@headius
Copy link
Member

headius commented Jun 21, 2017

We'd still like to be able to support musl libc even though it has some rather different functions than glibc. Is this still a problem on musl with current JRuby?

@anicholson
Copy link

@headius I just encountered the same error on jruby 9.1.12.0 on a musl Alpine.

@Paxa
Copy link
Author

Paxa commented Aug 20, 2017

Working fine with glibc on alpine, I'm using this image https://hub.docker.com/r/anapsix/alpine-java/

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

No branches or pull requests

4 participants