Hi, I’m currently upgrading java SDK from 2.7 to 3.2.1 and running on alpine container errors with fatal exception.
# A fatal error has been detected by the Java Runtime Environment:
#
# SIGSEGV (0xb) at pc=0x000000000000401e, pid=1357, tid=1388
#
# JRE version: OpenJDK Runtime Environment (11.0.11+9) (build 11.0.11+9-alpine-r0)
# Java VM: OpenJDK 64-Bit Server VM (11.0.11+9-alpine-r0, mixed mode, tiered, compressed oops, g1 gc, linux-amd64)
# Problematic frame:
# C 0x000000000000401e
#
# No core dump will be written. Core dumps have been disabled. To enable core dumping, try "ulimit -c unlimited" before starting Java again
#
# An error report file with more information is saved as:
# /usr/src/app/hs_err_pid1357.log
#
# If you would like to submit a bug report, please visit:
# https://gitlab.alpinelinux.org/alpine/aports/issues
# The crash happened outside the Java Virtual Machine in native code.
# See problematic frame for where to report the bug.
Am I missing any required dependencies in the container?
Ah, that type of issue is apparently not generally visible. Currently it essentially says that we have plans to support Alpine on the SDKs, but there is not a timeline at this moment. I will update here once things change.
Netty does not support the native transport (epoll) when running under musl since it’s compiled against glibc. And it not nicely bails out but segfaults … until they fix it (there is no date yet) there is no other way around it at the moment to handle it automatically by the SDK.
That said, there are two ways to solve this:
Don’t use alpine in the first place - use a OpenJDK image which uses glibc (pretty much any that is not using alpine)
Disable the native IO ClusterEnvironment env = ClusterEnvironment.builder().ioEnvironment(IoEnvironment.enableNativeIo(false)).build();
If you disable the native IO in your code it won’t try to load the native code and then it should also work under alpine.
I’d recommend upgrading to Couchbase Java SDK 3.4.2 or later to pick up the fix for JVMCBC-1176. Then disable native IO and native TLS as described in the SDK’s Alpine Linux compatibility documentation.