# Escript: exception error: undefined function erlang:get\_stacktrace/0

**URL:** <https://forum.elixirforum.com/t/escript-exception-error-undefined-function-erlang-get-stacktrace-0/41208>\
**Category:** Questions\
**Tags:** erlang, troubleshooting, rebar3, elixir-ls, kiex\
**Created:** [July 23, 2021, 2:19pm UTC](https://forum.elixirforum.com/t/escript-exception-error-undefined-function-erlang-get-stacktrace-0/41208 "2021-07-23T14:19:13Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![sahilpaudel](https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/sahilpaudel/32/18807_2.png) [@sahilpaudel](https://forum.elixirforum.com/u/sahilpaudel)\
**Post date:** [July 23, 2021, 2:19pm UTC](https://forum.elixirforum.com/t/escript-exception-error-undefined-function-erlang-get-stacktrace-0/41208/1 "2021-07-23T14:19:13Z")

</div>

`elixir -v`

```elixir
Erlang/OTP 24 [erts-12.0.3] [source] [64-bit] [smp:8:8] [ds:8:8:10] [async-threads:1] [dtrace]

Elixir 1.8.2 (compiled with Erlang/OTP 24)

```

`~/.mix/rebar3 --version`

```elixir
rebar 3.13.3 on Erlang/OTP 24 Erts 12.0.3

```

Error I am getting while compiling lz4

```elixir
===> Fetching pc v1.13.0
===> Downloaded package, caching at /Users/sahilpaudel/.cache/rebar3/hex/hexpm/packages/pc-1.13.0.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 :lz4, "/Users/sahilpaudel/.mix/rebar3 bare compile --paths "/Users/sahilpaudel/Documents/Elixir/diamond/_build/dev/lib/*/ebin"" command failed. You can recompile this dependency with "mix deps.compile lz4", update it with "mix deps.update lz4" or clean it with "mix deps.clean lz4"

```

---

<div class="post-metadata">

**Author:** ![Nicd](https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/nicd/32/2357_2.png) [@Nicd](https://forum.elixirforum.com/u/Nicd)\
**Post date:** [July 23, 2021, 2:45pm UTC](https://forum.elixirforum.com/t/escript-exception-error-undefined-function-erlang-get-stacktrace-0/41208/2 "2021-07-23T14:45:51Z")

</div>

Try upgrading your rebar with `mix local.rebar`, `erlang:get_stacktrace/0` was removed in OTP 24.

---

<div class="post-metadata">

**Author:** ![axelson](https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/axelson/32/26351_2.png) [@axelson](https://forum.elixirforum.com/u/axelson)\
**Post date:** [July 24, 2021, 1:42am UTC](https://forum.elixirforum.com/t/escript-exception-error-undefined-function-erlang-get-stacktrace-0/41208/3 "2021-07-24T01:42:04Z")

</div>

Additionally Elixir 1.8 only supports up to Erlang/OTP 22 so you should either upgrade Elixir (preferable) or downgrade Erlang/OTP.

Source: [https://hexdocs.pm/elixir/master/compatibility-and-deprecations.html](https://hexdocs.pm/elixir/master/compatibility-and-deprecations.html)
