Search code examples
ejabberd

ejabberd: OpenSSL might not be installed on this system. docker


After using the ecs Dockerfile to build the image and package it into the server, the following exception information appears

2023-09-05 18:50:42 OpenSSL might not be installed on this system.

2023-09-05 15:54:34 =ERROR REPORT==== 5-Sep-2023::07:54:34.162563 ===
2023-09-05 15:54:34 Unable to load crypto library. Failed with error:
2023-09-05 15:54:34 "load_failed, Failed to load NIF library: 'Error loading shared library libcrypto.so.1.1: No such file or directory (needed by /home/ejabberd/lib/crypto-5.0.6.3/priv/lib/crypto.so)'"

It is normal for me to build a docker image, with openssl-dev, openssl extension:


RUN apk upgrade --update-cache --no-progress  && apk add  expat  freetds  gd  jpeg  libgd  libpng libstdc++ libwebp ncurses-libs openssl-dev openssl sqlite sqlite-libs  tini   unixodbc  yaml zlib  && ln -fs /usr/lib/libtdsodbc.so.0 /usr/lib  39.7s

link: https://github.com/processone/docker-ejabberd/tree/master/ecs

I could not get through this error. Any help is greatly appreciated.


Solution

  • Aha, it seems the mix container image published four months ago, based in Alpine 3.17, included OpenSSL 1, and since past month, Alpine 3.17 includes OpenSSL 3. When the next ejabberd version is released, both mix and ecs images will be updated.

    Until the next ejabberd release is published, you can try this:

    1. First build a recent mix image:
    cd docker-ejabberd/mix/
    docker build -t personal/mix105 .
    
    1. Use that recent mix image in the ecs Dockerfile:
    cd docker-ejabberd/ecs/
    sed -i 's|ejabberd/mix|personal/mix105|g' Dockerfile
    
    1. Now build the ecs image:
    docker build -t personal/ejabberd105 .
    
    1. ejabberd now will start correctly:
    docker run -it -p 5222:5222 personal/ejabberd105 live
    Erlang/OTP 25 [erts-13.1.2] [source] [64-bit] [smp:4:4] [ds:4:4:10] [async-threads:1] [jit]
    
    2023-09-05 14:17:46.325054+00:00 [info] Loading configuration from /home/ejabberd/conf/ejabberd.yml
    2023-09-05 14:17:46.360877+00:00 [warning] Option 'log_rotate_date' is deprecated and has no effect anymore. Please remove it from the configuration.
    2023-09-05 14:17:46.361015+00:00 [warning] Option 'log_rate_limit' is deprecated and has no effect anymore. Please remove it from the configuration.
    2023-09-05 14:17:46.836616+00:00 [info] Configuration loaded successfully
    2023-09-05 14:17:47.039276+00:00 [info] Got no NOTIFY_SOCKET, notifications disabled
    2023-09-05 14:17:47.055606+00:00 [info] Building language translation cache
    2023-09-05 14:17:47.213716+00:00 [info] Creating Mnesia ram table 'ejabberd_commands'
    2023-09-05 14:17:47.314708+00:00 [info] Creating Mnesia ram table 'route'
    2023-09-05 14:17:47.354691+00:00 [info] Creating Mnesia ram table 'route_multicast'