wasmcloud-otp icon indicating copy to clipboard operation
wasmcloud-otp copied to clipboard

[BUG] Erlang panic on startup on systems with openssl 3.0

Open brooksmtownsend opened this issue 2 years ago • 0 comments

Describe the bug

When running wasmCloud on amazon linux 2022 / Ubuntu 22.04, the following stacktrace (or similar) shows on startup:

=====
===== LOGGING STARTED Sun May 29 16:25:56 UTC 2022
=====
Erlang/OTP 24 [erts-12.3.1] [source] [64-bit] [smp:2:2] [ds:2:2:10] [async-threads:1]

=SUPERVISOR REPORT==== 29-May-2022::16:25:57.412325 ===
    supervisor: {local,kernel_sup}
    errorContext: start_error
    reason: {on_load_function_failed,'Elixir.HostCore.WasmCloud.Native',
                {error,
                    {load_failed,
                        "Failed to load NIF library /wasmcloud/lib/host_core-0.54.6/priv/native/libhostcore_wasmcloud_native: 'libssl.so.1.1: cannot open shared object file: No such file or directory'"}}}
    offender: [{pid,undefined},
               {id,kernel_safe_sup},
               {mfargs,{supervisor,start_link,
                                   [{local,kernel_safe_sup},kernel,safe]}},
               {restart_type,permanent},
               {significant,false},
               {shutdown,infinity},
               {child_type,supervisor}]

=CRASH REPORT==== 29-May-2022::16:25:57.412402 ===
  crasher:
    initial call: supervisor:kernel/1
    pid: <0.1668.0>
    registered_name: []
    exception exit: {on_load_function_failed,
                        'Elixir.HostCore.WasmCloud.Native',
                        {error,
                            {load_failed,
                                "Failed to load NIF library /wasmcloud/lib/host_core-0.54.6/priv/native/libhostcore_wasmcloud_native: 'libssl.so.1.1: cannot open shared object file: No such file or directory'"}}}
      in function  init:run_on_load_handlers/0
      in call from kernel:init/1 (kernel.erl, line 189)
      in call from supervisor:init/1 (supervisor.erl, line 330)
      in call from gen_server:init_it/2 (gen_server.erl, line 423)
      in call from gen_server:init_it/6 (gen_server.erl, line 390)
    ancestors: [kernel_sup,<0.1640.0>]
    message_queue_len: 0
    messages: []
    links: [<0.1642.0>]
    dictionary: []
    trap_exit: true
    status: running
    heap_size: 987
    stack_size: 28
    reductions: 270
  neighbours:

=CRASH REPORT==== 29-May-2022::16:25:58.414329 ===
  crasher:
    initial call: application_master:init/4
    pid: <0.1639.0>
    registered_name: []
    exception exit: {{shutdown,
                      {failed_to_start_child,kernel_safe_sup,
                       {on_load_function_failed,
                        'Elixir.HostCore.WasmCloud.Native',
                        {error,
                         {load_failed,
                          "Failed to load NIF library /wasmcloud/lib/host_core-0.54.6/priv/native/libhostcore_wasmcloud_native: 'libssl.so.1.1: cannot open shared object file: No such file or directory'"}}}}},
                     {kernel,start,[normal,[]]}}
      in function  application_master:init/4 (application_master.erl, line 142)
    ancestors: [<0.1638.0>]
    message_queue_len: 1
    messages: [{'EXIT',<0.1640.0>,normal}]
    links: [<0.1638.0>,<0.1636.0>]
    dictionary: []
    trap_exit: true
    status: running
    heap_size: 987
    stack_size: 28
    reductions: 231
  neighbours:

=INFO REPORT==== 29-May-2022::16:25:58.416497 ===
    application: kernel
    exited: {{shutdown,
                 {failed_to_start_child,kernel_safe_sup,
                     {on_load_function_failed,
                         'Elixir.HostCore.WasmCloud.Native',
                         {error,
                             {load_failed,
                                 "Failed to load NIF library /wasmcloud/lib/host_core-0.54.6/priv/native/libhostcore_wasmcloud_native: 'libssl.so.1.1: cannot open shared object file: No such file or directory'"}}}}},
             {kernel,start,[normal,[]]}}
    type: permanent

{"Kernel pid terminated",application_controller,"{application_start_failure,kernel,{{shutdown,{failed_to_start_child,kernel_safe_sup,{on_load_function_failed,'Elixir.HostCore.WasmCloud.Native',{error,{load_failed,\"Failed to load NIF library /wasmcloud/lib/host_core-0.54.6/priv/native/libhostcore_wasmcloud_native: 'libssl.so.1.1: cannot open shared object file: No such file or directory'\"}}}}},{kernel,start,[normal,[]]}}}"}
Kernel pid terminated (application_controller) ({application_start_failure,kernel,{{shutdown,{failed_to_start_child,kernel_safe_sup,{on_load_function_failed,'Elixir.HostCore.WasmCloud.Native',{error,{load_failed,"Failed to load NIF library /wasmcloud/lib/host_core-0.54.6/priv/native/libhostcore_wasmcloud_native: 'libssl.so.1.1: cannot open shared object file: No such file or directory'"}}}}},{kernel,start,[normal,[]]}}})

Crash dump is being written to: erl_crash.dump...done

Expected behavior

If these versions of operating systems support a compatibility version of openssl for 1.1, then I would expect for this to work just fine.

Additional context

After #412 , we will actually resolve this stacktrace however the crypto library that we depend on for host_core does still look for libcrypto and a similar error occurs. More investigation is needed to see if we can work with a compatible layer of openssl on these newer systems, if we can vendor the openssl dynamic library, or if we need to make the jump to openssl 3.0 and ditch older OS support at some point.

brooksmtownsend avatar Jun 07 '22 19:06 brooksmtownsend