SSH Error when adding private hex repo

mix hex.repo add oban https://getoban.pro/repo \
        --fetch-public-key SHA256:4/REDACTED/BIMLnK8NHcx/EWs+aIWPc \
        --auth-key REDACTED
        
** (UndefinedFunctionError) function :public_key.ssh_hostkey_fingerprint/2 is undefined or private, use ssh:hostkey_fingerprint/2 instead
    (public_key 1.15.1) :public_key.ssh_hostkey_fingerprint(:sha256, {:RSAPublicKey, REDACTED, 65537})
    (hex 2.0.6) lib/mix/tasks/hex.repo.ex:211: Mix.Tasks.Hex.Repo.show_public_key/1
    (hex 2.0.6) lib/mix/tasks/hex.repo.ex:222: Mix.Tasks.Hex.Repo.fetch_public_key/3
    (hex 2.0.6) lib/mix/tasks/hex.repo.ex:124: Mix.Tasks.Hex.Repo.add/3
    (mix 1.14.0) lib/mix/task.ex:421: anonymous fn/3 in Mix.Task.run_task/4
    (mix 1.14.0) lib/mix/cli.ex:84: Mix.CLI.run_task/2
Ubuntu Server 24.04
{:oban_web, "~> 2.10.3", repo: "oban"},
{:oban_pro, "~> 1.4.2", repo: "oban"},
{:oban, "~> 2.17.7"},
Erlang/OTP 26 [erts-14.2.5] [source] [64-bit] [smp:2:2] [ds:2:2:10] [async-threads:1] [jit:ns]
Elixir 1.14.0 (compiled with Erlang/OTP 24)

Solved.

Needed to install an extra Erlang package.

sudo apt install erlang-ssh

2 Likes

FWIW, watch out with the individual erlang-* packages; the BEAM wasn’t designed to be split like that so you’ll encounter explosions like this unexpectedly.

Agree, first of all I see the mismatch in the versions used:

Erlang/OTP 26
Elixir 1.14.0 (compiled with Erlang/OTP 24)

Even though I doubt this is the culprit. The culprit is most probably the old version of elixir using functionality that was changed in OTP-25/26, upgrading elixir version should solve this problem.

Elixir 1.14 doesn’t support OTP 26, so even if it’s not the source this should be addressed:
https://hexdocs.pm/elixir/1.15/compatibility-and-deprecations.html

1 Like

Thanks. I was not even paying attention to versions in detail when setting up the build server.

I will go back an install specific versions using ASDF rather than relying on Ubuntu repo.