Hey,
I’ve been struggling with the exact same issue today, but the solution suggested doesn’t work and I don’t understand why. I can run the application locally just fine, but when built as a production build using mix release
it blows up with the following traceback.
=CRASH REPORT==== 23-Aug-2024::18:59:44.248395 ===
crasher:
initial call: kernel:init/1
pid: <0.5565.0>
registered_name: []
exception exit: {on_load_function_failed,gl,
{error,
{load_failed,
"Failed to load NIF library: 'Error loading shared library /opt/app/lib/wx-2.4.2/priv/e
rl_gl.so: No such file or directory'"}}}
in function init:run_on_load_handlers/0
in call from kernel:init/1 (kernel.erl, line 228)
ancestors: [kernel_sup,<0.5558.0>]
message_queue_len: 0
messages: []
links: [<0.5560.0>]
dictionary: []
trap_exit: false
status: running
heap_size: 376
stack_size: 29
reductions: 96
neighbours:
=SUPERVISOR REPORT==== 23-Aug-2024::18:59:44.248582 ===
supervisor: {local,kernel_sup}
errorContext: start_error
reason: {on_load_function_failed,gl,
{error,
{load_failed,
"Failed to load NIF library: 'Error loading shared library /opt/app/lib/wx-2.4.2/priv/erl_gl.so: No such file or directory'"}}}
offender: [{pid,undefined},
{id,on_load},
{mfargs,{proc_lib,start_link,[kernel,init,[on_load]]}},
{restart_type,transient},
{significant,false},
{shutdown,2000},
{child_type,worker}]
In my mix.exs
file I have the following, so as far as I can tell it shouldn’t try to load wx
when running the build.
def application do
[
mod: {Pipelines.Application, []},
extra_applications: extra_applications(Mix.env())
]
end
defp extra_applications(:dev), do: [:logger, :observer, :wx, :runtime_tools, :os_mon]
defp extra_applications(_), do: [:logger, :runtime_tools, :os_mon]
The application is running in a docker image using:
Docker Image:
- elixir:1.17-alpine
Erlang/OTP:
- Erlang/OTP 27 [erts-15.0.1] [source] [64-bit] [smp:4:1] [ds:4:1:10] [async-threads:1] [jit:ns]
IEx 1.17.2 (compiled with Erlang/OTP 27)
Does anybody know what could be the reason?
Cheers!