UnsatisfiedLinkError when starting a K8S pod based on a Ballerina Service

78 Views Asked by At

I'm trying to start a K8S pod based on a Ballerina service and I'm getting the following error

error: java.lang.UnsatisfiedLinkError {"message":"failed to load the required native library","cause":error("java.lang.IllegalArgumentException",message="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]")}

The runtime is ballerina/jvm-runtime:1.0.

2

There are 2 best solutions below

0
On

Another reason for this could be due to missing glibc dependency (required by netty for the underlying native transport implementation) in your base image. (e.g. alphine linux base image does not contain glibc as per the alphine linux documentation.)

Therefore, this can be solved by switching to any base image which comes with the aforementioned dependency by-default.

Related issues and discussions can be found in here and here.

0
On

The issue often occurs when the file system is readonly. Netty needs the /tmp directory to be writable.

One possible solution for this is, mounting an empty directory to /tmp.