HEX_CACERTS_PATH
is set:
> $env:HEX_CACERTS_PATH
C:\internal_root_ca.pem
Pulling dependencies from a mix project works as intendend:
> mix phx.new hello_web
* creating hello_web/lib/hello_web/application.ex
* creating hello_web/lib/hello_web.ex
* creating hello_web/lib/hello_web_web/controllers/error_json.ex
...
Fetch and install dependencies? [Yn] y
* running mix deps.get
* running mix assets.setup
* running mix deps.compile
We are almost there! The following steps are missing:
...
so does mix hex.info
:
mix hex.info ecto
A toolkit for data mapping and language integrated query for Elixir
Config: {:ecto, "~> 3.12"}
Locked version: 3.12.4
...
Finding depencies through livebooks search
Results in an error message.
Failed to make a request, reason:
{:failed_connect, [{:to_address, {~c"hex.pm", 443}}, {:tls, [
server_name_indication: ~c"hex.pm",
cacertfile: ~c"\"C:\\internal_root_ca.pem\"",
verify: :verify_peer,
customize_hostname_check: [
match_fun: #Function<6.75820660/2 in :public_key.pkix_verify_hostname_match_fun/1>]],
{:options, {
:cacertfile, ~c"c:/Users/me/AppData/Local/Livebook/\"C:/internal_root_ca.pem\"",
{:error, :enoent}}}}]}
Looks like building the path to the certfile assumes a relative path and also adds " as escaped characters.
Installing depencies with Mix.install
Instead of adding a dependency through search, I added it “manually” and tried to start the runtime:
Mix.install([
{:ecto, "> 0.0.0"}
])
Leads to
13:03:25.702 [error] beam\beam_load.c(607): Error loading function 'Elixir.Hex.Netrc.Cache':fetch/1: op make_fun2 u:
no specific operation found
13:03:25.710 [error] beam\beam_load.c(607): Error loading function 'Elixir.Hex.Netrc.Cache':fetch/1: op make_fun2 u:
no specific operation found
13:03:25.712 [error] Writer crashed (:"The pipe is being closed.\r\n")
13:03:25.721 [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.2) lib/supervisor.ex:797: Supervisor.init_child/1
(elixir 1.17.2) lib/enum.ex:1703: Enum."-map/2-lists^map/1-1-"/2
(elixir 1.17.2) lib/supervisor.ex:783: Supervisor.init/2
(elixir 1.17.2) lib/supervisor.ex:707: Supervisor.start_link/2
(kernel 10.0) application_master.erl:295: :application_master.start_it_old/4
13:03:25.731 [notice] Application inets exited: :stopped
13:03:25.718 [info] init got unexpected: {:io_request, #PID<0.92.0>, #Reference<0.2950530402.328466435.66149>,
{:put_chars, :unicode,
"Failed to write log message to stdout, trying stderr\n"}}
13:03:25.738 [notice] Application ssl exited: :stopped
13:03:25.738 [notice] Application public_key exited: :stopped
13:03:25.738 [notice] Application asn1 exited: :stopped
13:03:25.738 [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"
As suggested, I ran mix local.hex
(successfully) and then restarted the livebook application.