jschaeff

jschaeff

Release and NIF library

Hello !

Mix release with NIF in a containser crashes … I can’t find why.

If I run the project locally (mix phx.serve) it works.
When I build a release locally and run it, it works.
When I copy the locally generated release directory in a Docker container and spin it up, it works.

When I build everything in a Docker container (mix release), it fails with the following error:

=INFO REPORT==== 13-May-2026::10:16:55.060537 ===
    application: kernel
    exited: {{shutdown,
                 {failed_to_start_child,on_load,
                     {on_load_function_failed,'Elixir.MSeed.NIF',
                         {error,
                             {bad_lib,
                                 "Failed to find library init function: '/app/wsdataselect/lib/wsdataselect-1.1.18/priv/libexmseed.so: undefined symbol: _nif_init'"}}}}},
             {kernel,start,[normal,[]]}}
    type: permanent

Kernel pid terminated (application_controller) ("{application_start_failure,kernel,{{shutdown,{failed_to_start_child,on_load,{on_load_function_failed,'Elixir.MSeed.NIF',{error,{bad_lib,\"Failed to find library init function: '/app/wsdataselect/lib/wsdataselect-1.1.18/priv/libexmseed.so: undefined symbol: _nif_init'\"}}}}},{kernel,start,[normal,[]]}}}")

ldd on the /app/wsdataselect/lib/wsdataselect-1.1.18/priv/libexmseed.so says everything is statically linked.

Dockerfile Dockerfile · 65-libmseed-nif · OSUG / RESIF / wsdataselect · GitLab

Anybody has an idea what is missing in the container ?

Marked As Solved

jschaeff

jschaeff

By iterating over a naive Dockerfile until the release breaks, I identified the missing part in the docker context (I omitted to put the ./c directory). Weirdly, the compilation worked, but the release missed all the NIF part.

The fix: Add missing directory in build context (afa04fb3) · Commits · OSUG / RESIF / wsdataselect · GitLab

Thanks for the replies !

Where Next?

Popular in Questions Top

albydarned
Hello all! I am typing this post from my new MacBook Pro with the M1 chip. I’m loving it so far, and will probably use it as my daily dr...
New
Patoshizzle
After calling mix ecto.create I get this error: 17:00:32.162 [error] GenServer #PID<0.412.0> terminating ** (Postgrex.Error) FATAL...
New
johnnyicon
Hi all, I’ve just started learning Elixir and Phoenix Framework, so please pardon my n00bness at this stage. I’m trying to use Postgres...
New
vrod
I am using the Starship cross-shell prompt – it seems pretty nice, but I get some errors: [WARN] - (starship::utils): Executing command ...
New
itssasanka
Hi all, Trying to get some more clarity over utc_datetime and naive_datetime for Ecto: The documentation above suggests that while ...
New
Lily
In templates/appointment/index.html.eex: <%= for appointment <- @appointments do %> <tr> <td><%= appoi...
New
vegabook
I’m brand new to Phoenix and I have stripped one of the demo applications to the bone. I just want to get an svg up on the screen. Here i...
New
Brian
What is the proper way to load a module from a file in to IEX? In the python world, doing something like this pretty standard: from ....
New
jononomo
For some reason my phoenix channels are working for me in my local dev environment, but as soon as I deploy via Docker, I get a 403 error...
New
lanycrost
Hi everyone! I need implement if…else if…else condition from my elixir code, and anymore of this control flow structures not work proper...
New

Other popular topics Top

AstonJ
Posting this to see if we can make things easier for people to get into Neovim. If you use Neovim and have a favourite distro please let ...
New
gshaw
What is the idiomatic way of matching for not nil in Elixir? E.g., First way: defp halt_if_not_signed_in(conn, signed_in_account) when...
New
New
ovidiubadita
Hey all, I discovered Elixir and I love it. I always wanted to learn a functional programming and I intended to go for Haskell, but afte...
New
johnnyicon
Hi all, I’ve just started learning Elixir and Phoenix Framework, so please pardon my n00bness at this stage. I’m trying to use Postgres...
New
jononomo
I am trying to figure out how Mix knows whether the environment is test, dev, or prod – where is this set? Thanks.
New
aalberti333
As the title describes, I’m trying to run Enum.map() over a list of key/value pairs, where the value is a map. My data looks like this: ...
New
Lily
In templates/appointment/index.html.eex: <%= for appointment <- @appointments do %> <tr> <td><%= appoi...
New
nobody
Hi! In PHP: $_SERVER[‘SERVER_ADDR’] - in Elixir? Searched the docs for ip address and the web, no good results. Thanks!
New
SoCreat
i’m a new one to elixir which editor can i use vs code? or atom? Thanks! :smiley:
New

We're in Beta

About us Mission Statement