Failed to load NIF library: '/app/lib/wx-2.3/priv/erl_gl.so: cannot open shared object file: No such file or directory

My app deployment using Docker is suddently failing on Render.com with the following error message. I’m not even sure what exactly in my app is attempting to load this wx library because mix.exs or mix deps.tree don’t include it. Some pointers will be appreciated. Render.com support thinks this is an Elixir issue.

Failed to load NIF library: '/app/lib/wx-2.3/priv/erl_gl.so

=CRASH REPORT==== 23-Oct-2024::03:30:47.930227 ===

Oct 22 08:30:47 PM crasher:
Oct 22 08:30:47 PM initial call: kernel:init/1
Oct 22 08:30:47 PM pid: <0.6294.0>
Oct 22 08:30:47 PM registered_name: []
Oct 22 08:30:47 PM exception exit: {on_load_function_failed,gl,
Oct 22 08:30:47 PM {error,
Oct 22 08:30:47 PM {load_failed,
Oct 22 08:30:47 PM "Failed to load NIF library: '/app/lib/wx-2.3/priv/erl_gl.so: cannot open shared object file: No such file or directory'"}}}

Oct 22 08:30:47 PM in function init:run_on_load_handlers/0
Oct 22 08:30:47 PM in call from kernel:init/1 (kernel.erl, line 227)
Oct 22 08:30:47 PM ancestors: [kernel_sup,<0.6287.0>]
Oct 22 08:30:47 PM message_queue_len: 0
Oct 22 08:30:47 PM messages: []
Oct 22 08:30:47 PM links: [<0.6289.0>]
Oct 22 08:30:47 PM dictionary: []
Oct 22 08:30:47 PM trap_exit: false
Oct 22 08:30:47 PM status: running
Oct 22 08:30:47 PM heap_size: 610
Oct 22 08:30:47 PM stack_size: 28
Oct 22 08:30:47 PM reductions: 195
Oct 22 08:30:47 PM neighbours:
Oct 22 08:30:47 PM

Oct 22 08:30:47 PM=SUPERVISOR REPORT==== 23-Oct-2024::03:30:47.937485 ===
Oct 22 08:30:47 PM supervisor: {local,kernel_sup}
Oct 22 08:30:47 PM errorContext: start_error
Oct 22 08:30:47 PM reason: {on_load_function_failed,gl,
Oct 22 08:30:47 PM {error,
Oct 22 08:30:47 PM {load_failed,

Oct 22 08:30:47 PM "Failed to load NIF library: '/app/lib/wx-2.3/priv/erl_gl.so: cannot open shared object file: No such file or directory'"}}}

Oct 22 08:30:47 PM offender: [{pid,undefined},
Oct 22 08:30:47 PM {id,on_load},
Oct 22 08:30:47 PM {mfargs,{proc_lib,start_link,[kernel,init,[on_load]]}},
Oct 22 08:30:47 PM {restart_type,transient},
Oct 22 08:30:47 PM {significant,false},
Oct 22 08:30:47 PM {shutdown,2000},
Oct 22 08:30:47 PM {child_type,worker}]
Oct 22 08:30:47 PM
Oct 22 08:30:47 PM

2 things come to mind.

First check with mix deps.tree to see what dependency relies on wx.
Secondly are the wx libraries still installed in the docker image you are using?

1 Like

mix deps.tree doesn’t show wx at all.
wx isn’t in my docker image as far as I can tell. I’m trying to install it but it’s an old version of wx that the error message indicates, so I may have to build it from the source. :frowning:

I know erlang uses it by default for observer.

I went back to the latest successful mix.lock, and the problem went away. Now I need to find out which of those changed dependencies is the culprit.

All the dependency changes were minor version upgrades including

ash and other ash addons (like ash_authentication)
bcrypt_elixir
comeonin
igniter
glob_ex
owl
paraxial (2.7.7-> 2.7.8)
rustler_precompiled
snappyer
spark
stream_data
tz_world

1 Like

Check if you haven’t mistakenly left :wx in :extra_applications, in mix.exsapplication/0. You can conditionally add it, as :observer is helpful in :dev:

extra_applications: [:logger, :runtime_tools] ++ (Mix.env() == :dev && [:wx, :observer] || [])