jitsi-videobridge
jitsi-videobridge copied to clipboard
Linux Alpine compatibilty
I was testing with docker alpine linux, and using this base image: openjdk:7-alpine
but got this error:
JVB 2017-03-20 16:27:17.757 INFO: [524] org.jitsi.videobridge.Channel.log() CAT=stat transport_connected,conf_id=e36676ea2d25a212,content=data,ch_id=61d98e5e86441313,endp_id=0c9f2ce0
JVB 2017-03-20 16:27:17.796 SEVERE: [569] org.jitsi.sctp4j.Sctp.log() Failed to load native library jnsctp: /tmp/jna-3506402/jna8906397313932640369.tmp: Error relocating /tmp/jna-3506402/jna8906397313932640369.tmp: __vfprintf_chk: symbol not found
JVB 2017-03-20 16:27:17.798 SEVERE: [575] util.UtilActivator.uncaughtException().119 An uncaught exception occurred in thread=Thread[org.jitsi.videobridge.SctpConnection-pool-13-thread-2,5,main] and message was: Could not initialize class org.jitsi.sctp4j.Sctp
java.lang.NoClassDefFoundError: Could not initialize class org.jitsi.sctp4j.Sctp
at org.jitsi.videobridge.SctpConnection$1.run(SctpConnection.java:476)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at java.lang.Thread.run(Thread.java:745)
JVB 2017-03-20 16:27:17.799 SEVERE: [569] util.UtilActivator.uncaughtException().119 An uncaught exception occurred in thread=Thread[org.jitsi.videobridge.SctpConnection-pool-13-thread-1,5,main] and message was: Could not initialize class org.jitsi.sctp4j.Sctp
java.lang.NoClassDefFoundError: Could not initialize class org.jitsi.sctp4j.Sctp
at org.jitsi.videobridge.SctpConnection$1.run(SctpConnection.java:476)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at java.lang.Thread.run(Thread.java:745)
Searching Internet make me wonder if this was related to libc, so I switched to openjdk:7
and now it is working as expected.
FYI: Alpine Linux is a security-oriented, lightweight Linux distribution based on musl libc and busybox.
It would be nice if this could work with alpine linux as docker images are a lot smaller so it is a lot of gain in term of network, disks and comuting, and it is then more environmental friendly to use it :)
I also tried to use jvb on Alpine, and got a segfault upon call setup when initialising sctp4j. I tried disabling SCTP but hit another problem: https://github.com/jitsi/jitsi-videobridge/pull/1363#issuecomment-727212047
FWIW, if you need SCTP support and you want to use alpine, you can use an alpine image like the ones from adoptopenjdk, which provide a glibc compat library for Java. JVB runs fine with SCTP enabled on those images.
The root cause seems to be that JVB uses a prebuilt .so for sctp, which was linked to glibc.