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

Documentation request: GRPC Java not compatible with Alpine Linux #66

Closed
laurikimmel opened this issue Sep 24, 2018 · 2 comments
Closed

Comments

@laurikimmel
Copy link

GRPC Java examples are not working on Alpine Linux since required libnetty-tcnative-boringssl-static depends on glibc. Alpine is using musl libc and application startup will fail with message similar to

io.grpc.netty.GrpcSslContexts            : netty-tcnative unavailable (this may be normal)

    java.lang.IllegalArgumentException: Failed to load any of the given libraries: [netty_tcnative_linux_x86_64, netty_tcnative_linux_x86_64_fedora, netty_tcnative_x86_64, netty_tcnative]
     	at io.netty.util.internal.NativeLibraryLoader.loadFirstAvailable(NativeLibraryLoader.java:93) ~[netty-common-4.1.27.Final.jar:4.1.27.Final]
    	at io.netty.handler.ssl.OpenSsl.loadTcNative(OpenSsl.java:440) ~[netty-handler-4.1.27.Final.jar:4.1.27.Final]
    	at io.netty.handler.ssl.OpenSsl.<clinit>(OpenSsl.java:97) ~[netty-handler-4.1.27.Final.jar:4.1.27.Final]
    	at io.grpc.netty.GrpcSslContexts.defaultSslProvider(GrpcSslContexts.java:242) [grpc-netty-1.12.0.jar:1.12.0]
    	at io.grpc.netty.GrpcSslContexts.configure(GrpcSslContexts.java:171) [grpc-netty-1.12.0.jar:1.12.0]
    	at io.grpc.netty.GrpcSslContexts.forClient(GrpcSslContexts.java:120) [grpc-netty-1.12.0.jar:1.12.0]
...
@laurikimmel
Copy link
Author

Related issue netty/netty-tcnative#111

@anuraaga
Copy link
Contributor

Thanks for the feedback. Unfortunately, as is clear in that issue, I've tried hard to fix this, including creating a fairly large PR but it doesn't seem like netty + boringssl will ever support Alpine Linux.

If you're using Java 8 I recommend distroless, which is tiny while using glibc, and hopefully there will be a good answer to GoogleContainerTools/distroless#236 for the future of Java too.

If you're using Java9+, gRPC will work without netty-tcnative as it natively supports ALPN. I don't think it should require code change, but if it does could you add the changes so we can incorporate them into the README? Thanks!

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