sezaru

sezaru

Release build failing with undefined function erlang:get_stacktrace/0 after OTP 24 update

I have a Docker image that I use to compile my releases for deployment, I recently updated it to use OTP 24 and the latest Elixir version (1.12.0).

After making that change, now my release builds always fail with the following error:

$ MIX_ENV=prod mix release
...
===> Fetching rebar3_hex v6.11.4
===> Downloaded package, caching at /home/sezdocs/.cache/rebar3/hex/hexpm/packages/rebar3_hex-6.11.4.tar
escript: exception error: undefined function erlang:get_stacktrace/0
  in function  rebar3:main/1 (/rebar3/src/rebar3.erl, line 72)
  in call from escript:run/2 (escript.erl, line 750)
  in call from escript:start/1 (escript.erl, line 277)
  in call from init:start_em/1 
  in call from init:do_boot/3 
** (Mix) Could not compile dependency :sleeplocks, "/home/sezdocs/.mix/rebar3 bare compile --paths /home/sezdocs/project/endpoints/_build/prod/lib/*/ebin" command failed. You can recompile this dependency with "mix deps.compile sleeplocks", update it with "mix deps.update sleeplocks" or clean it with "mix deps.clean sleeplocks"

Does anyone knows why is this happening and how to solve it?

Also, I don’t know if this helps, but here is my Dockerfile:

FROM ubuntu:20.04 AS build

ARG USER=builder
ARG UID=1000
ARG GID=1000
ARG PWD=builder

RUN apt-get update
RUN DEBIAN_FRONTEND=noninteractive apt-get install -y apt-transport-https ca-certificates gnupg software-properties-common wget

RUN wget -O - https://apt.kitware.com/keys/kitware-archive-latest.asc 2> /dev/null | gpg --dearmor - | tee /etc/apt/trusted.gpg.d/kitware.gpg > /dev/null

RUN apt-add-repository 'deb https://apt.kitware.com/ubuntu/ focal main'

RUN wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key | apt-key add -

RUN apt-add-repository 'deb http://apt.llvm.org/focal/ llvm-toolchain-focal-12 main'

RUN apt-get update

RUN DEBIAN_FRONTEND=noninteractive apt-get -y dist-upgrade

RUN DEBIAN_FRONTEND=noninteractive apt-get install -y apt-utils

RUN wget https://packages.erlang-solutions.com/erlang-solutions_2.0_all.deb
RUN dpkg -i erlang-solutions_2.0_all.deb
RUN rm erlang-solutions_2.0_all.deb

RUN apt-get update

RUN DEBIAN_FRONTEND=noninteractive apt-get install -y esl-erlang
RUN DEBIAN_FRONTEND=noninteractive apt-get install -y elixir

RUN DEBIAN_FRONTEND=noninteractive apt-get install -y clang-12 capnproto

RUN DEBIAN_FRONTEND=noninteractive apt-get install -y git

RUN DEBIAN_FRONTEND=noninteractive apt-get install -y cmake

RUN DEBIAN_FRONTEND=noninteractive apt-get install -y curl

RUN update-alternatives --install /usr/bin/cc cc /usr/bin/clang-12 10
RUN update-alternatives --install /usr/bin/c++ c++ /usr/bin/clang++-12 10

RUN useradd -m $USER --uid $UID
RUN echo "${USER}:${PWD}" | chpasswd

USER ${UID}:${GID}

ENV LANG=C.UTF-8

ENV TERM=xterm-256color

RUN curl https://sh.rustup.rs -sSf | bash -s -- -y

RUN echo 'source $HOME/.cargo/env' >> ~/.bashrc

RUN echo 'PS1="(builder) $PS1"' >> ~/.bashrc

RUN mix local.hex --force
RUN mix local.rebar --force

WORKDIR /home/${USER}/project

CMD ["/bin/bash"]

I build it with:

docker build --build-arg USER=$USER   \
             --build-arg UID=$(id -u) \
             --build-arg GID=$(id -g) \
             --no-cache               \
             -t tip-off/builder:v1 . 

and run it with:

docker run --detach-keys='ctrl-e,e' -it -v$(pwd):/home/$USER/project --rm tip-off/builder:v1

Marked As Solved

sezaru

sezaru

Ok, I was able to fix this changing my HEX_MIRROR for some reason.

What I did was:

HEX_MIRROR=https://cdn.jsdelivr.net/hex mix local.hex
HEX_MIRROR=https://cdn.jsdelivr.net/hex mix local.rebar

Also Liked

sezaru

sezaru

Just an update, in the end the error was a regression in hex servers, José Valim already fixed it Compilation fails with undefined function erlang:get_stacktrace/0 · Issue #11047 · elixir-lang/elixir · GitHub :smiley:

Where Next?

Popular in Questions Top

vertexbuffer
Hello, can anybody help here..? I have a list of players and I what to delete an element, but every for loop the list is reverting to ori...
New
Kurisu
For example for a current url like http://localhost:4000/cosmetic/products?_utf8=✓&query=perfume&page=2, I would like to get: ...
New
qwerescape
Is there a way to get the call stack or stack trace at any point in the code? Not from exceptions, but an expression that returns how the...
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
Fl4m3Ph03n1x
About me? ( if you have nothing better to do than reading about some random guy in the internet :stuck_out_tongue: ) Hello all, this is ...
New
beno
I will often find my self writing things similar to: case some_value do nil -> something() "" -> something() _ -> somethi...
New
pmjoe
I have a relationship of love and hate with Elixir. Lots of things are just absolutely right, but there are some things that are kind of ...
New
vonH
When I run the Plug and I recompile I wind up having to use Ctrl C to quit iex and start again. Witht the help of rlwrap I can use the cu...
New
sergio_101
I am VERY much an elixir newbie. I have taken one elixir course and one phoenix course on Udemy. During that course, I saw the instructor...
New
chensan
I have a User schema with a :from_id field set to type :string: defmodule TweetBot.Repo.Migrations.CreateUsers do use Ecto.Migration ...
New

Other popular topics Top

sen
Hi All, I set a environment variables in dev.exs , like below code. when i start server, how can i set the ${enable} value? thanks. d...
New
electic
Hi, I am new to Elixir. I am trying to use the DateTime component to insert a date into MySQL however the there seems to be no way to fo...
New
shahryarjb
Hello, I have map which I want to convert it to string like this: the map: %{last_name: "tavakkoli", name: "shahryar"} the string I ne...
New
chrismccord
This release brings a number of exciting features, including integration with the new Phoenix LiveDashboard and Phoenix LiveView. There h...
New
dokuzbir
I want to highlight html closing tags when i click a html tag. That works in .html files but doesnt work for html.eex templates. How can...
New
stefanluptak
Hello everybody, usually, I use a 29" ultra-wide monitor for VSCode which can easily accomodate explorer (files panel) + file with code ...
New
freewebwithme
Using vs code and installed ElixirLS: support and debugger. And I got an error popped up on start up says Failed to run ‘elixir’ comma...
New
fayddelight
I tried installing elixir 1.11.2 erlang 23.3.4 via asdf in my zsh shell. Enabled the versions locally and globally. When I list them ...
New
bsollish-terakeet
Credo is smart enough to check for (something like) this: assert length(the_list) == 0 with this response: Checking if an enum is empt...
New
jason.o
In the code below, if the create action is not set to accept “extra_key” as an input, it errors out with a message shown above. Is there ...
New

We're in Beta

About us Mission Statement