Error when installing Livebook with escript

I’m trying to get Livebook working on my M1 Mac running Elixir 1.13.0. I’m using the escript installation method:

$ mix escript.install hex livebook`

After some dependences have been fetched and some compilation messages the thing dies with the following message:

could not compile dependency :phoenix_live_dashboard, "mix compile" failed. Errors may have been logged above. You can recompile this dependency with "mix deps.compile phoenix_live_dashboard", update it with "mix deps.update phoenix_live_dashboard" or clean it with "mix deps.clean phoenix_live_dashboard"
** (MatchError) no match of right hand side value: {:error, {:telemetry, {'no such file or directory', 'telemetry.app'}}}
// stacktrace continues
The full output
$ mix escript.install hex livebook                                                                                                                                                               [15:56:24]
Resolving Hex dependencies...
Dependency resolution completed:
New:
  aws_signature 0.2.0
  castore 0.1.12
  cowboy 2.9.0
  cowboy_telemetry 0.3.1
  cowlib 2.11.0
  earmark_parser 1.4.18
  jason 1.2.2
  livebook 0.4.1
  mime 1.6.0
  phoenix 1.6.2
  phoenix_html 3.1.0
  phoenix_live_dashboard 0.6.1
  phoenix_live_view 0.17.5
  phoenix_pubsub 2.0.0
  phoenix_view 1.0.0
  plug 1.12.1
  plug_cowboy 2.5.2
  plug_crypto 1.2.2
  ranch 1.8.0
  telemetry 0.4.3
  telemetry_metrics 0.6.1
  telemetry_poller 0.5.1
* Getting livebook (Hex package)
* Getting aws_signature (Hex package)
* Getting castore (Hex package)
* Getting earmark_parser (Hex package)
* Getting jason (Hex package)
* Getting phoenix (Hex package)
* Getting phoenix_html (Hex package)
* Getting phoenix_live_dashboard (Hex package)
* Getting phoenix_live_view (Hex package)
* Getting plug_cowboy (Hex package)
* Getting telemetry_metrics (Hex package)
* Getting telemetry_poller (Hex package)
* Getting telemetry (Hex package)
* Getting cowboy (Hex package)
* Getting cowboy_telemetry (Hex package)
* Getting plug (Hex package)
* Getting mime (Hex package)
* Getting plug_crypto (Hex package)
* Getting cowlib (Hex package)
* Getting ranch (Hex package)
* Getting phoenix_pubsub (Hex package)
* Getting phoenix_view (Hex package)
You have added/upgraded packages you could sponsor, run `mix hex.sponsor` to learn more
Resolving Hex dependencies...
Dependency resolution completed:
Unchanged:
  aws_signature 0.2.0
  castore 0.1.12
  cowboy 2.9.0
  cowboy_telemetry 0.3.1
  cowlib 2.11.0
  earmark_parser 1.4.18
  jason 1.2.2
  mime 1.6.0
  phoenix 1.6.2
  phoenix_html 3.1.0
  phoenix_live_dashboard 0.6.1
  phoenix_live_view 0.17.5
  phoenix_pubsub 2.0.0
  phoenix_view 1.0.0
  plug 1.12.1
  plug_cowboy 2.5.2
  plug_crypto 1.2.2
  ranch 1.8.0
  telemetry 0.4.3
  telemetry_metrics 0.6.1
  telemetry_poller 0.5.1
All dependencies are up to date
==> earmark_parser
Compiling 1 file (.yrl)
Compiling 2 files (.xrl)
Compiling 3 files (.erl)
Compiling 33 files (.ex)
Generated earmark_parser app
===> Compiling aws_signature
===> Compiling ranch
===> Compiling telemetry
==> telemetry_metrics
Compiling 7 files (.ex)
warning: :telemetry.attach/4 is undefined (module :telemetry is not available or is yet to be defined)
  lib/telemetry_metrics/console_reporter.ex:61: Telemetry.Metrics.ConsoleReporter.init/1

warning: :telemetry.detach/1 is undefined (module :telemetry is not available or is yet to be defined)
  lib/telemetry_metrics/console_reporter.ex:70: Telemetry.Metrics.ConsoleReporter.terminate/2

Generated telemetry_metrics app
===> Compiling telemetry_poller
==> jason
Compiling 8 files (.ex)
Generated jason app
==> castore
Compiling 1 file (.ex)
Generated castore app
==> phoenix_pubsub
Compiling 11 files (.ex)
Generated phoenix_pubsub app
===> Compiling cowlib
===> Compiling cowboy
===> Compiling cowboy_telemetry
==> mime
Compiling 2 files (.ex)
Generated mime app
==> plug_crypto
Compiling 5 files (.ex)
Generated plug_crypto app
==> plug
Compiling 1 file (.erl)
Compiling 41 files (.ex)
warning: System.stacktrace/0 is deprecated. Use __STACKTRACE__ instead
  lib/plug/conn/wrapper_error.ex:23: Plug.Conn.WrapperError.reraise/3

Generated plug app
==> phoenix_html
Compiling 8 files (.ex)
Generated phoenix_html app
==> phoenix_view
Compiling 5 files (.ex)
Generated phoenix_view app
==> plug_cowboy
Compiling 5 files (.ex)
warning: :telemetry.attach/4 is undefined (module :telemetry is not available or is yet to be defined)
  lib/plug/cowboy.ex:293: Plug.Cowboy.run/4

Generated plug_cowboy app
==> phoenix
Compiling 68 files (.ex)
warning: :telemetry.attach/4 is undefined (module :telemetry is not available or is yet to be defined)
  lib/phoenix/logger.ex:136: Phoenix.Logger.install/0

warning: :telemetry.execute/3 is undefined (module :telemetry is not available or is yet to be defined)
  lib/phoenix/socket.ex:449: Phoenix.Socket.__connect__/3

warning: :telemetry.execute/3 is undefined (module :telemetry is not available or is yet to be defined)
  lib/phoenix/endpoint/render_errors.ex:81: Phoenix.Endpoint.RenderErrors.instrument_render_and_send/5

warning: :telemetry.execute/3 is undefined (module :telemetry is not available or is yet to be defined)
Invalid call found at 2 locations:
  lib/phoenix/channel/server.ex:301: Phoenix.Channel.Server.handle_info/2
  lib/phoenix/channel/server.ex:318: Phoenix.Channel.Server.handle_info/2

warning: :telemetry.execute/3 is undefined (module :telemetry is not available or is yet to be defined)
Invalid call found at 5 locations:
  lib/phoenix/router.ex:345: Phoenix.Router.__call__/2
  lib/phoenix/router.ex:351: Phoenix.Router.__call__/2
  lib/phoenix/router.ex:360: Phoenix.Router.__call__/2
  lib/phoenix/router.ex:366: Phoenix.Router.__call__/2
  lib/phoenix/router.ex:372: Phoenix.Router.__call__/2

Generated phoenix app
==> phoenix_live_view
Compiling 29 files (.ex)
warning: :telemetry.span/3 is undefined (module :telemetry is not available or is yet to be defined)
Invalid call found at 2 locations:
  lib/phoenix_live_view/utils.ex:294: Phoenix.LiveView.Utils.maybe_call_live_view_mount!/4
  lib/phoenix_live_view/utils.ex:363: Phoenix.LiveView.Utils.call_handle_params!/5

warning: :telemetry.span/3 is undefined (module :telemetry is not available or is yet to be defined)
Invalid call found at 2 locations:
  lib/phoenix_live_view/channel.ex:340: Phoenix.LiveView.Channel.view_handle_event/3
  lib/phoenix_live_view/channel.ex:552: Phoenix.LiveView.Channel.inner_component_handle_event/4

Generated phoenix_live_view app

15:57:02.921 [notice] Application plug_crypto exited: :stopped

15:57:02.924 [notice] Application mime exited: :stopped

15:57:02.924 [notice] Application eex exited: :stopped
==> phoenix_live_dashboard
could not compile dependency :phoenix_live_dashboard, "mix compile" failed. Errors may have been logged above. You can recompile this dependency with "mix deps.compile phoenix_live_dashboard", update it with "mix deps.update phoenix_live_dashboard" or clean it with "mix deps.clean phoenix_live_dashboard"
** (MatchError) no match of right hand side value: {:error, {:telemetry, {'no such file or directory', 'telemetry.app'}}}
    (phoenix 1.6.2) lib/mix/tasks/compile.phoenix.ex:19: Mix.Tasks.Compile.Phoenix.run/1
    (mix 1.13.0) lib/mix/task.ex:397: anonymous fn/3 in Mix.Task.run_task/3
    (mix 1.13.0) lib/mix/tasks/compile.all.ex:92: Mix.Tasks.Compile.All.run_compiler/2
    (mix 1.13.0) lib/mix/tasks/compile.all.ex:72: Mix.Tasks.Compile.All.compile/4
    (mix 1.13.0) lib/mix/tasks/compile.all.ex:59: Mix.Tasks.Compile.All.with_logger_app/2
    (mix 1.13.0) lib/mix/tasks/compile.all.ex:36: Mix.Tasks.Compile.All.run/1
    (mix 1.13.0) lib/mix/task.ex:397: anonymous fn/3 in Mix.Task.run_task/3
    (mix 1.13.0) lib/mix/tasks/compile.ex:131: Mix.Tasks.Compile.run/1

Any ideas how to dubug/fix this?

1 Like

To answer my own question, the problem was my that version of rebar3 was outdated.

Upon updating rebar3 with mix local.rebar Livebook now works as intended

8 Likes