larshei

larshei

Hey everyone!

I am trying to introduce livebook in a corporate networking setup, meaning all access is going through a proxy that also does SSL inspection.

Preferrably, I’d like to use the standalone Livebook installation for simplicity, but kept running into the following error: Failed to make a request, reason: {:failed_connect, [{:to_address, {~c"hex.pm", 443}}, {:inet, [:inet], :closed}]}

Not finding a way to configure livebook, I built livebook from source, hoping there would be a difference (because the dev setup has proxy/CA settings configured) - but the same error occurs.

I seem to not be able to make any requests from the livebook, as running

:ssl.start
:inets.start
:httpc.request "https://google.com"

leads to the same error.

How could I configure livebook for this network setup (set up proxy and trusted CA)?

Showing Posts 21 to 12

larshei

larshei OP

You are correct, hex versions 2.0.6 and 2.1.1 were available. Deleted the 2.0.6 folder. Works now.

Many (many many many …) thanks!

jonatanklosko

jonatanklosko

Creator of Livebook

Ohh I think the deps error may be something entirely separate.

Try locating C:\Users\foo\AppData\Local\Livebook\rel\vendor\archives and see if there are multiple hex-* directories. If so, remove the older one. I think we fixed the installer to remove these automatically on new install, but maybe it didn’t work for some reason.

larshei

larshei OP

:scream: search works now! Thanks, well debugged :smiley: I thought the quotes in the file make no difference, I wouldnt have caught this.

However, installing dependencies did not work yet, error remains:

error] beam\beam_load.c(607): Error loading function 'Elixir.Hex.Netrc.Cache':fetch/1: op make_fun2 u:
  no specific operation found

Could be a version mismatch between Elixir and OTP?
Can I see what versions are used in the installed livebook version?

jonatanklosko

jonatanklosko

Creator of Livebook

System.get_env(“LIVEBOOK_CACERTFILE”)

When you do it in IEx it uses the global one, not the one in .livebookdesktop.bat.

So maybe the quotes were the issue? Does the package search work now?

which is used in this case?

I think .livebookdesktop.bat should take precedence.

larshei

larshei OP

File is present.

Content was

set LIVEBOOK_CACERTFILE="C:\internal_root_ca.pem"

and is now

set LIVEBOOK_CACERTFILE=C:\internal_root_ca.pem

which leads to

>  System.get_env("LIVEBOOK_CACERTFILE")
"C:\\internal_root_ca.pem"

The env variable is also defined in the user environment variables in windows’ advanced system settings as C:\internal_root_ca.pem - which is used in this case?

jonatanklosko

jonatanklosko

Creator of Livebook

Just to double check, do you have %USERPROFILE%\.livebookdesktop.bat or did you set it globally. If the file is there, are there quotes or no?

larshei

larshei OP

This looks fine:

1> System.get_env("LIVEBOOK_CACERTFILE")
"C:\\internal_root_ca.pem"
jonatanklosko

jonatanklosko

Creator of Livebook

cacertfile: ~c"\"C:\\internal_root_ca.pem\"",

Yeah this looks wrong. If you open iex and do System.get_env("LIVEBOOK_CACERTFILE") does it appear with the quotes or without?

larshei

larshei OP

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.

jonatanklosko

jonatanklosko

Creator of Livebook

For installing dependencies, I think you also need to set HEX_CACERTS_PATH, so that Mix.install uses the certs when talking to Hex.

For programmatic requests, such as Req.get, you need to set the proxy options yourself, as if you were writing a regular Elixir app/script.

Searching for dependencies should work though, since it’s Livebook making the requests. Is it still the same error?

Where Next? Top

Trending in Questions Top

RSP87
I’m working on a project that simulates the bumbl example in the programming phoenix book. It acts almost like an email client. We have a...
New
nseaSeb
Hello, I know there is an approach for handling lists that allows for optimized traversal, but I can’t recall the specific method (somet...
New
brecabral
Documentation While reading the Scoped Routes section, I noticed that the documentation currently refers to a problem without explainin...
New
kpanic
Hi everyone, I am toying with the idea of building a “match maker” for giving personal help to people that wants to start coding. I sta...
New
velrest
So my question is quite simple and i have found no conclusive answer on forum, google or AI. Should we use :erlang.float for Integer to ...
New
asweet-confluent
I recently noticed that Elixir’s Logger defaults its primary log level to :debug when no :logger, :level application configuration is pre...
New
apz
I’m new to elixir and just tried to install the elixirLS extension for VScode(ium) and it is throwing some errors that I would like help ...
New

Other Trending Topics Top

GenericJam
Edit: 2026 May 15 - This post is archived. Mob is alive!! Main docs: mob v0.7.11 — Documentation A bit of explanation for the slightly c...
New
JesseHerrick
Hey, I’m Jesse and I’m the main contributor behind Dexter, a full-featured, lightning-fast Elixir LSP optimized for large codebases. It s...
New
mudasobwa
I am happy to introduce the very α version of the new programming language compiled to BEAM. Welcome Cure. It has literally three kille...
New
garrison
Hobbes is a low-level distributed database for the Elixir programming language. Hobbes provides a simple, safe, and scalable storage lay...
New
marciok
Hi there! We created Gust: A task orchestrator inspired by Airflow. For those who have never heard about Aiflow, it’s a Python-based wor...
New
mhanberg
Hi everyone! The first release candidate for the Expert language server project is now available! We’ve published a press release detai...
New

We're in Beta

About us Mission Statement

Options

Thread Display Mode




Thread Preview

Skip Thread Previews