Compile error while installing dependencies in livebook

Hello,

Getting the below error while trying to install the dependencies for smart cell neural network in livebook , I got this error after running it in iex :

Blockquote
Generated kino_bumblebee app
==> torchx
could not compile dependency :torchx, “mix compile” failed. Errors may have been logged above. You can recompile this dependency with “mix deps.compile torchx --force”, update it with “mix deps.update torchx” or clean it with “mix deps.clean torchx”
** (MatchError) no match of right hand side value: {:error, :bad_eocd}
c:/Users/ashra/AppData/Local/mix/Cache/installs/elixir-1.17.0-erts-15.0/9574f12e35c9dbee311aad4b1aba0134/deps/torchx/mix.exs:164: Torchx.MixProject.download_and_unzip/2
(mix 1.17.0) lib/mix/task.ex:574: Mix.Task.run_alias/6
(mix 1.17.0) lib/mix/tasks/compile.all.ex:108: Mix.Tasks.Compile.All.run_compiler/2
(mix 1.17.0) lib/mix/tasks/compile.all.ex:88: Mix.Tasks.Compile.All.compile/4
(mix 1.17.0) lib/mix/tasks/compile.all.ex:62: Mix.Tasks.Compile.All.run/1
(mix 1.17.0) lib/mix/task.ex:495: anonymous fn/3 in Mix.Task.run_task/5
(mix 1.17.0) lib/mix/tasks/compile.ex:159: Mix.Tasks.Compile.run/1
‘’‘’‘’

When running it from within livebook the below error is seen :

Blockquote
** (MatchError) no match of right hand side value: {:error, {:hex, {:bad_return, {{Hex.Application, :start, [:normal, ]}, {:EXIT, {%ArgumentError{message: “The module Hex.Netrc.Cache was given as a child to a supervisor but it does not exist”}, [{Supervisor, :init_child, 1, [file: ~c"lib/supervisor.ex", line: 797]}, {Enum, :“-map/2-lists^map/1-1-”, 2, [file: ~c"lib/enum.ex", line: 1703]}, {Supervisor, :init, 2, [file: ~c"lib/supervisor.ex", line: 783]}, {Supervisor, :start_link, 2, [file: ~c"lib/supervisor.ex", line: 707]}, {:application_master, :start_it_old, 4, [file: ~c"application_master.erl", line: 295]}]}}}}}}
(hex 2.0.6) lib/hex.ex:5: Hex.start/0
(mix 1.17.1) lib/mix/hex.ex:60: Mix.Hex.start/0
(mix 1.17.1) lib/mix/dep/loader.ex:189: Mix.Dep.Loader.with_scm_and_app/5
(mix 1.17.1) lib/mix/dep/loader.ex:141: Mix.Dep.Loader.to_dep/4
(elixir 1.17.1) lib/enum.ex:1703: Enum.“-map/2-lists^map/1-1-”/2
(mix 1.17.1) lib/mix/dep/loader.ex:364: Mix.Dep.Loader.mix_children/3
(mix 1.17.1) lib/mix/dep/loader.ex:18: Mix.Dep.Loader.children/1
#cell:setup:1: (file)

@ghannam80 you can try a clear install without cache

If it fails consistently, then it may be something about the underlying package.

I tried it and it is giving the below :

Blockquote
16:43:13.798 [error] beam\beam_load.c(607): Error loading function ‘Elixir.Hex.Netrc.Cache’:fetch/1: op make_fun2 u:
no specific operation found
16:43:13.798 [error] beam\beam_load.c(607): Error loading function ‘Elixir.Hex.Netrc.Cache’:fetch/1: op make_fun2 u:
no specific operation found
16:43:13.814 [notice] Application hex exited: exited in: Hex.Application.start(:normal, )
** (EXIT) an exception was raised:
** (ArgumentError) The module Hex.Netrc.Cache was given as a child to a supervisor but it does not exist
(elixir 1.17.1) lib/supervisor.ex:797: Supervisor.init_child/1
(elixir 1.17.1) lib/enum.ex:1703: Enum.“-map/2-lists^map/1-1-”/2
(elixir 1.17.1) lib/supervisor.ex:783: Supervisor.init/2
(elixir 1.17.1) lib/supervisor.ex:707: Supervisor.start_link/2
(kernel 10.0) application_master.erl:295: :application_master.start_it_old/4
16:43:13.815 [notice] Application inets exited: :stopped
16:43:13.815 [notice] Application ssl exited: :stopped
16:43:13.815 [notice] Application public_key exited: :stopped
16:43:13.815 [notice] Application asn1 exited: :stopped
16:43:13.815 [notice] Application crypto exited: :stopped
Could not start Hex. Try fetching a new version with “mix local.hex” or uninstalling it with “mix archive.uninstall hex.ez”

Interesting. Are you running Livebook from source? Does it also happen in iex? Perhaps worth updating Elixir to v1.17.1 or mix local.hex just to be sure.

I downloaded the latest livebook app from website for Windows.
I just tried the below to check if my issue with Neural network smart cell or everything , it worked inside iex but it gave me the same issue in livebook as in earlier post :

Blockquote
Mix.install([
{:kino_slack, “~> 0.1.1”}
])

==> kino_slack
Compiling 3 files (.ex)
Generated kino_slack app
:ok

Blockquote

16:50:38.539 [error] beam\beam_load.c(607): Error loading function ‘Elixir.Hex.Netrc.Cache’:fetch/1: op make_fun2 u:
no specific operation found
16:50:38.539 [error] beam\beam_load.c(607): Error loading function ‘Elixir.Hex.Netrc.Cache’:fetch/1: op make_fun2 u:
no specific operation found
16:50:38.557 [notice] Application hex exited: exited in: Hex.Application.start(:normal, )
** (EXIT) an exception was raised:
** (ArgumentError) The module Hex.Netrc.Cache was given as a child to a supervisor but it does not exist
(elixir 1.17.1) lib/supervisor.ex:797: Supervisor.init_child/1
(elixir 1.17.1) lib/enum.ex:1703: Enum.“-map/2-lists^map/1-1-”/2
(elixir 1.17.1) lib/supervisor.ex:783: Supervisor.init/2
(elixir 1.17.1) lib/supervisor.ex:707: Supervisor.start_link/2
(kernel 10.0) application_master.erl:295: :application_master.start_it_old/4

16:50:38.557 [notice] Application inets exited: :stopped

16:50:38.557 [notice] Application ssl exited: :stopped

16:50:38.557 [notice] Application public_key exited: :stopped

16:50:38.557 [notice] Application asn1 exited: :stopped

16:50:38.557 [notice] Application crypto exited: :stopped
Could not start Hex. Try fetching a new version with “mix local.hex” or uninstalling it with “mix archive.uninstall hex.ez”

iex(2)>

torchx seems having other issue as it is still failing even from iex “I updated Elixir to 1.17.1” :

Blockquote==> kino_slack
Compiling 3 files (.ex)
Generated kino_slack app
==> torchx
could not compile dependency :torchx, “mix compile” failed. Errors may have been logged above. You can recompile this dependency with “mix deps.compile torchx --force”, update it with “mix deps.update torchx” or clean it with “mix deps.clean torchx”
** (MatchError) no match of right hand side value: {:error, :bad_eocd}
c:/Users/ashra/AppData/Local/mix/Cache/installs/elixir-1.17.1-erts-15.0/48c03f7d15b2375061e5e8c2973040ac/deps/torchx/mix.exs:164: Torchx.MixProject.download_and_unzip/2
(mix 1.17.1) lib/mix/task.ex:574: Mix.Task.run_alias/6
(mix 1.17.1) lib/mix/tasks/compile.all.ex:108: Mix.Tasks.Compile.All.run_compiler/2
(mix 1.17.1) lib/mix/tasks/compile.all.ex:88: Mix.Tasks.Compile.All.compile/4
(mix 1.17.1) lib/mix/tasks/compile.all.ex:62: Mix.Tasks.Compile.All.run/1
(mix 1.17.1) lib/mix/task.ex:495: anonymous fn/3 in Mix.Task.run_task/5
(mix 1.17.1) lib/mix/tasks/compile.ex:159: Mix.Tasks.Compile.run/1

@ghannam80 as a sanity check, I assume doing Mix.install([:kino]) in Livebook returns the same Hex error?

Can you please look for a rel\vendor\archives directory in the Livebook installation, something like C:\Users\foo\AppData\Local\Livebook\rel\vendor\archives, and see what directories are there?

Yes, you are right the same error for both .
Here is the archives , it is strange to have 2.0.6 because from command line only 2.1.1 is listed

Try removing hex-2.0.6 and see if it helps : )

1 Like

I installed it again after removing all the related folders and normal livebook is working , torchx seems not livebook related as it is failing even with iex , thanks.

@ghannam80 that makes sense, thanks for debugging, probably something we can improve in the installer.

I think for the torchx installation, you can open an issue on torchx directly.

2 Likes