erlang / otp

Erlang/OTP
http://erlang.org
Apache License 2.0
11.32k stars 2.94k forks source link

Error loading libraries #8861

Open lkananowicz opened 3 days ago

lkananowicz commented 3 days ago

Hi,

this is more of a question than a bug report as I suspect it might be an isolated case.

I am trying to upgrade Elixir/Erlang version on web application I am maintaining. We use official Docker images from https://hub.docker.com to build application release (via 'shell docker exec -i {{ container_name }} bash -c MIX_ENV=prod mix release') and then deploy and start that release on target server.

The problem I have is that for some Docker images my Elixir web application just won't start. Here are few examples:

Won't start on:

hexpm/elixir:1.17.1-erlang-27.0-ubuntu-jammy-20240530
hexpm/elixir:1.17.3-erlang-27.1-ubuntu-jammy-20240808

Starts on:

hexpm/elixir:1.17.1-erlang-26.2.5-ubuntu-jammy-20240530
hexpm/elixir:1.17.1-erlang-26.2.5-ubuntu-jammy-20240530

OS on target server:

No LSB modules are available.
Distributor ID: Ubuntu
Description:    Ubuntu 22.04.4 LTS
Release:    22.04
Codename:   jammy

So it looks like the problem only happens on Erlang 27.

The error messages I find in logs are:

Sep 25 13:14:37 webapp[32650]: (no logger present) unexpected logger message: {log,error,"~s~n",["beam/beam_load.c(607): Error loading function idna:encode/2: op init y:\n  no specific operation found\n"],#{error_logger=>#{emulator=>true,tag=>error},pid=><0.1136.0>,time=>1727270077548699,gl=><0.0.0>}}
Sep 25 13:14:37 webapp[32650]: (no logger present) unexpected logger message: {log,error,"~s~n",["beam/beam_load.c(607): Error loading function idna_bidi:check_rtl/2: op init y:\n  no specific operation found\n"],#{error_logger=>#{emulator=>true,tag=>error},pid=><0.1137.0>,time=>1727270077552297,gl=><0.0.0>}}
Sep 25 13:14:37 webapp[32650]: (no logger present) unexpected logger message: {log,error,"~s~n",["beam/beam_load.c(607): Error loading function idna_ucs:to_utf8/1: op make_fun2 u:\n  no specific operation found\n"],#{error_logger=>#{emulator=>true,tag=>error},pid=><0.1142.0>,time=>1727270077759053,gl=><0.0.0>}}
Sep 25 13:14:37 webapp[32650]: (no logger present) unexpected logger message: {log,error,"~s~n",["beam/beam_load.c(607): Error loading function punycode:encode/1: op allocate_zero u u:\n  no specific operation found\n"],#{error_logger=>#{emulator=>true,tag=>error},pid=><0.1143.0>,time=>1727270077759239,gl=><0.0.0>}}
Sep 25 13:14:37 webapp[32650]: Runtime terminating during boot ({load_failed,[punycode,idna_ucs,idna_bidi,idna]})
Sep 25 13:14:37 webapp[32650]: #015
Sep 25 13:14:38 webapp[32650]: Crash dump is being written to: erl_crash.dump...done

Any ideas/suggestions on what could be causing this problem?

Thanks, Leon

garazdawi commented 3 days ago

This means that you are trying to load code compiled with an old (unsupported) Erlang version on Erlang 27. We removed support for loading .beam files compiled by Erlang 23 and earlier in 27.

lkananowicz commented 3 days ago

Thanks, it is a bit strange as I am using asdf to manage Erlang versions between projects but I might be missing smth.

garazdawi commented 3 days ago

Are any beam files downloaded from anywhere? Or do you cache them?

lkananowicz commented 2 days ago

Do you mean on the remote server, where this (supposedly) self-contained release package is deployed to?

lkananowicz commented 2 days ago

Ok, never mind, I see that all those libs [punycode,idna_ucs,idna_bidi,idna] should be included in self-contained release.