Crypto issues pulling LiveView demo dependencies via mix

Hi there,

I’m trying to get this LiveView demo working:

I’m running on a Raspberry Pi Zero which didn’t appear to have the latest Erlang or Elixir, so I build them both. I build Erlang via Kerl and then Elixir.

pi@raspberrypi:~/Development/phoenix-liveview-counter-tutorial $ mix hex.info
Hex:    0.20.5
Elixir: 1.10.4
OTP:    23.0.3

Built with: Elixir 1.10.0 and OTP 21.3

Erlang seems fine (I can build and run stuff). However, I’m struggling to get started with the LiveView counter demo. I’m

pi@raspberrypi:~/Development/phoenix-liveview-counter-tutorial $ mix setup

11:09:57.311 [error] Task #PID<0.163.0> started from :hex_fetcher terminating
** (stop) exited in: :gen_server.call(:application_controller, {:set_env, :crypto, :"$curves$", [:secp160k1, :secp160r1, :secp160r2, :secp192r1, :secp192k1, :secp224k1, :secp224r1, :secp256k1, :secp256r1, :secp384r1, :secp521r1, :prime192v1, :prime192v2, :prime192v3, :prime239v1, :prime239v2, :prime239v3, :prime256v1, :wtls7, :wtls9, :wtls12, :brainpoolP160r1, :brainpoolP160t1, :brainpoolP192r1, :brainpoolP192t1, :brainpoolP224r1, :brainpoolP224t1, :brainpoolP256r1, :brainpoolP256t1, :brainpoolP320r1, :brainpoolP320t1, :brainpoolP384r1, :brainpoolP384t1, :brainpoolP512r1, :brainpoolP512t1, :sect163k1, :sect163r1, :sect163r2, :sect193r1, :sect193r2, :sect233k1, :sect233r1, :sect239k1, :sect283k1, :sect283r1, :sect409k1, ...], []})
    ** (EXIT) time out
    (stdlib 3.13) gen_server.erl:238: :gen_server.call/2
    (crypto 4.7) crypto.erl:2836: :crypto.cached_curve_algorithms/0
    (crypto 4.7) crypto.erl:677: :crypto."-supports/0-lc$^0/1-0-"/1
    (crypto 4.7) crypto.erl:677: :crypto."-supports/0-lc$^0/1-0-"/1
    (crypto 4.7) crypto.erl:677: :crypto.supports/0
    (ssl 10.0) tls_record.erl:743: :tls_record.sufficient_support/1
    (ssl 10.0) tls_record.erl:370: :tls_record.supported_protocol_versions/1
    (ssl 10.0) tls_record.erl:358: :tls_record.supported_protocol_versions/0
Function: #Function<17.86168715/0 in Hex.Registry.Server.prefetch_online/2>
    Args: []

11:09:57.312 [error] Task #PID<0.162.0> started from :hex_fetcher terminating
** (stop) exited in: :gen_server.call(:application_controller, {:set_env, :crypto, :"$curves$", [:secp160k1, :secp160r1, :secp160r2, :secp192r1, :secp192k1, :secp224k1, :secp224r1, :secp256k1, :secp256r1, :secp384r1, :secp521r1, :prime192v1, :prime192v2, :prime192v3, :prime239v1, :prime239v2, :prime239v3, :prime256v1, :wtls7, :wtls9, :wtls12, :brainpoolP160r1, :brainpoolP160t1, :brainpoolP192r1, :brainpoolP192t1, :brainpoolP224r1, :brainpoolP224t1, :brainpoolP256r1, :brainpoolP256t1, :brainpoolP320r1, :brainpoolP320t1, :brainpoolP384r1, :brainpoolP384t1, :brainpoolP512r1, :brainpoolP512t1, :sect163k1, :sect163r1, :sect163r2, :sect193r1, :sect193r2, :sect233k1, :sect233r1, :sect239k1, :sect283k1, :sect283r1, :sect409k1, ...], []})
    ** (EXIT) time out
    (stdlib 3.13) gen_server.erl:238: :gen_server.call/2
    (crypto 4.7) crypto.erl:2836: :crypto.cached_curve_algorithms/0
    (crypto 4.7) crypto.erl:677: :crypto."-supports/0-lc$^0/1-0-"/1
    (crypto 4.7) crypto.erl:677: :crypto."-supports/0-lc$^0/1-0-"/1
    (crypto 4.7) crypto.erl:677: :crypto.supports/0
    (ssl 10.0) tls_record.erl:743: :tls_record.sufficient_support/1
    (ssl 10.0) tls_record.erl:370: :tls_record.supported_protocol_versions/1
    (ssl 10.0) tls_record.erl:358: :tls_record.supported_protocol_versions/0
Function: #Function<17.86168715/0 in Hex.Registry.Server.prefetch_online/2>
    Args: []

11:09:57.312 [error] Task #PID<0.159.0> started from :hex_fetcher terminating
** (stop) exited in: :gen_server.call(:application_controller, {:set_env, :crypto, :"$curves$", [:secp160k1, :secp160r1, :secp160r2, :secp192r1, :secp192k1, :secp224k1, :secp224r1, :secp256k1, :secp256r1, :secp384r1, :secp521r1, :prime192v1, :prime192v2, :prime192v3, :prime239v1, :prime239v2, :prime239v3, :prime256v1, :wtls7, :wtls9, :wtls12, :brainpoolP160r1, :brainpoolP160t1, :brainpoolP192r1, :brainpoolP192t1, :brainpoolP224r1, :brainpoolP224t1, :brainpoolP256r1, :brainpoolP256t1, :brainpoolP320r1, :brainpoolP320t1, :brainpoolP384r1, :brainpoolP384t1, :brainpoolP512r1, :brainpoolP512t1, :sect163k1, :sect163r1, :sect163r2, :sect193r1, :sect193r2, :sect233k1, :sect233r1, :sect239k1, :sect283k1, :sect283r1, :sect409k1, ...], []})
    ** (EXIT) time out
    (stdlib 3.13) gen_server.erl:238: :gen_server.call/2
    (crypto 4.7) crypto.erl:2836: :crypto.cached_curve_algorithms/0
    (crypto 4.7) crypto.erl:677: :crypto."-supports/0-lc$^0/1-0-"/1
    (crypto 4.7) crypto.erl:677: :crypto."-supports/0-lc$^0/1-0-"/1
    (crypto 4.7) crypto.erl:677: :crypto.supports/0
    (ssl 10.0) tls_record.erl:743: :tls_record.sufficient_support/1
    (ssl 10.0) tls_record.erl:370: :tls_record.supported_protocol_versions/1
    (ssl 10.0) tls_record.erl:358: :tls_record.supported_protocol_versions/0
Function: #Function<17.86168715/0 in Hex.Registry.Server.prefetch_online/2>
    Args: []

11:09:57.312 [error] Task #PID<0.158.0> started from :hex_fetcher terminating
** (stop) exited in: :gen_server.call(:application_controller, {:set_env, :crypto, :"$curves$", [:secp160k1, :secp160r1, :secp160r2, :secp192r1, :secp192k1, :secp224k1, :secp224r1, :secp256k1, :secp256r1, :secp384r1, :secp521r1, :prime192v1, :prime192v2, :prime192v3, :prime239v1, :prime239v2, :prime239v3, :prime256v1, :wtls7, :wtls9, :wtls12, :brainpoolP160r1, :brainpoolP160t1, :brainpoolP192r1, :brainpoolP192t1, :brainpoolP224r1, :brainpoolP224t1, :brainpoolP256r1, :brainpoolP256t1, :brainpoolP320r1, :brainpoolP320t1, :brainpoolP384r1, :brainpoolP384t1, :brainpoolP512r1, :brainpoolP512t1, :sect163k1, :sect163r1, :sect163r2, :sect193r1, :sect193r2, :sect233k1, :sect233r1, :sect239k1, :sect283k1, :sect283r1, :sect409k1, ...], []})
    ** (EXIT) time out
    (stdlib 3.13) gen_server.erl:238: :gen_server.call/2
    (crypto 4.7) crypto.erl:2836: :crypto.cached_curve_algorithms/0
    (crypto 4.7) crypto.erl:677: :crypto."-supports/0-lc$^0/1-0-"/1
    (crypto 4.7) crypto.erl:677: :crypto."-supports/0-lc$^0/1-0-"/1
    (crypto 4.7) crypto.erl:677: :crypto.supports/0
    (ssl 10.0) tls_record.erl:743: :tls_record.sufficient_support/1
    (ssl 10.0) tls_record.erl:370: :tls_record.supported_protocol_versions/1
    (ssl 10.0) tls_record.erl:358: :tls_record.supported_protocol_versions/0
Function: #Function<17.86168715/0 in Hex.Registry.Server.prefetch_online/2>
    Args: []

Is there anything obvious I’m doing wrong here?

Notes:

I wondered if I had a dodgy Erlang build with broken crypto, so I followed this (https://pattern-match.com/blog/erlang-how-to-safely-build-erlang-with-crypto-without-openssl-issues/) and built my own OpenSSL and built a new Erlang pointing to that and still get the same errors.

I also tried running mix hex.user register and mix hex.user auth but that didn’t seem to help things either.

I also tried to install the Erlang Solutions deb but wasn’t successful with that either:

pi@raspberrypi:~/Development/phoenix-liveview-counter-tutorial $ wget https://packages.erlang-solutions.com/erlang-solutions_2.0_all.deb
--2020-08-14 10:32:45--  https://packages.erlang-solutions.com/erlang-solutions_2.0_all.deb
Resolving packages.erlang-solutions.com (packages.erlang-solutions.com)... 52.85.104.91, 52.85.104.21, 52.85.104.112, ...
Connecting to packages.erlang-solutions.com (packages.erlang-solutions.com)|52.85.104.91|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 6288 (6.1K)
Saving to: ‘erlang-solutions_2.0_all.deb’

erlang-solutions_2.0_al 100%[==============================>]   6.14K  --.-KB/s    in 0.001s

2020-08-14 10:32:45 (10.2 MB/s) - ‘erlang-solutions_2.0_all.deb’ saved [6288/6288]

pi@raspberrypi:~/Development/phoenix-liveview-counter-tutorial $ sudo dpkg -i erlang-solutions_2.0_all.deb
Selecting previously unselected package erlang-solutions.
(Reading database ... 46462 files and directories currently installed.)
Preparing to unpack erlang-solutions_2.0_all.deb ...
Unpacking erlang-solutions (2.0) ...
Setting up erlang-solutions (2.0) ...
deb http://raspbian.raspberrypi.org/raspbian/ buster main contrib non-free rpi
# Uncomment line below then 'apt-get update' to enable 'apt-get source'
#deb-src http://raspbian.raspberrypi.org/raspbian/ buster main contrib non-free rpi
pi@raspberrypi:~/Development/phoenix-liveview-counter-tutorial $ sudo apt-get update
Get:1 http://raspbian.raspberrypi.org/raspbian buster InRelease [15.0 kB]
Get:2 http://archive.raspberrypi.org/debian buster InRelease [32.6 kB]
Ign:3 http://binaries.erlang-solutions.com/debian buster InRelease
Get:4 http://binaries.erlang-solutions.com/debian buster Release [4,572 B]
Get:5 http://binaries.erlang-solutions.com/debian buster Release.gpg [833 B]
Get:6 http://raspbian.raspberrypi.org/raspbian buster/main armhf Packages [13.0 MB]
Get:7 http://archive.raspberrypi.org/debian buster/main armhf Packages [331 kB]
Get:8 http://binaries.erlang-solutions.com/debian buster/contrib armhf Packages [48.5 kB]
Fetched 13.4 MB in 26s (519 kB/s)
Reading package lists... Done
pi@raspberrypi:~/Development/phoenix-liveview-counter-tutorial $ sudo apt-get install --no-install-recommends esl-erlang elixir
Reading package lists... Done
Building dependency tree
Reading state information... Done
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:

The following packages have unmet dependencies:
 elixir : Depends: erlang-base (>= 1:22.3) but it is not going to be installed or
                   erlang-base-hipe (>= 1:22.3) or
                   esl-erlang (>= 1:22.3) but 1:22.1.6-1 is to be installed
          Depends: erlang-crypto (>= 1:22.3) or
                   esl-erlang (>= 1:22.3) but 1:22.1.6-1 is to be installed
          Depends: erlang-inets (>= 1:22.3) or
                   esl-erlang (>= 1:22.3) but 1:22.1.6-1 is to be installed
          Depends: erlang-ssl (>= 1:22.3) or
                   esl-erlang (>= 1:22.3) but 1:22.1.6-1 is to be installed
          Depends: erlang-syntax-tools (>= 1:22.3) or
                   esl-erlang (>= 1:22.3) but 1:22.1.6-1 is to be installed
E: Unable to correct problems, you have held broken packages.
2 Likes

Hi @samaaron!

I haven’t run into this issue before. The error does not seem to be with crypto per-se but rather an issue with the “application_controller” - which is the process that manages all applications - timing out.

I wouldn’t expect this operation to time out, unless the application_controller is busy doing something, or unless Hex is trying to spawn so many concurrent requests that the device cannot keep-up.

Can you try running this command instead:

mix deps.get

And then if it doesn’t work:

HEX_HTTP_CONCURRENCY=1 mix deps.get

If any of them work though, you should be able to proceed with mix setup.

2 Likes

Hey @josevalim :slight_smile:

Thanks so much for your help!

Makes complete sense that things might timeout as you suggest given that I’m running things on a very constrained and limited processor.

Is the problem that the default genserver timeout is being triggered because a process hasn’t responded in time and it was communicated to via call rather than cast?

I tried running mix deps.get but that didn’t work:

pi@raspberrypi:~/Development/phoenix-liveview-counter-tutorial $ mix deps.get

12:51:30.652 [error] Task #PID<0.163.0> started from :hex_fetcher terminating
** (stop) exited in: :gen_server.call(:application_controller, {:set_env, :crypto, :"$curves$", [:secp160k1, :secp160r1, :secp160r2, :secp192r1, :secp192k1, :secp224k1, :secp224r1, :secp256k1, :secp256r1, :secp384r1, :secp521r1, :prime192v1, :prime192v2,
 :prime192v3, :prime239v1, :prime239v2, :prime239v3, :prime256v1, :wtls7, :wtls9, :wtls12, :brainpoolP160r1, :brainpoolP160t1, :brainpoolP192r1, :brainpoolP192t1, :brainpoolP224r1, :brainpoolP224t1, :brainpoolP256r1, :brainpoolP256t1, :brainpoolP320r1, :
brainpoolP320t1, :brainpoolP384r1, :brainpoolP384t1, :brainpoolP512r1, :brainpoolP512t1, :sect163k1, :sect163r1, :sect163r2, :sect193r1, :sect193r2, :sect233k1, :sect233r1, :sect239k1, :sect283k1, :sect283r1, :sect409k1, ...], []})
    ** (EXIT) time out
    (stdlib 3.13) gen_server.erl:238: :gen_server.call/2
    (crypto 4.7) crypto.erl:2836: :crypto.cached_curve_algorithms/0
    (crypto 4.7) crypto.erl:677: :crypto."-supports/0-lc$^0/1-0-"/1
    (crypto 4.7) crypto.erl:677: :crypto."-supports/0-lc$^0/1-0-"/1
    (crypto 4.7) crypto.erl:677: :crypto.supports/0
    (ssl 10.0) tls_record.erl:743: :tls_record.sufficient_support/1
    (ssl 10.0) tls_record.erl:370: :tls_record.supported_protocol_versions/1
    (ssl 10.0) tls_record.erl:358: :tls_record.supported_protocol_versions/0
Function: #Function<17.86168715/0 in Hex.Registry.Server.prefetch_online/2>
    Args: []

12:51:30.652 [error] Task #PID<0.162.0> started from :hex_fetcher terminating
** (stop) exited in: :gen_server.call(:application_controller, {:set_env, :crypto, :"$curves$", [:secp160k1, :secp160r1, :secp160r2, :secp192r1, :secp192k1, :secp224k1, :secp224r1, :secp256k1, :secp256r1, :secp384r1, :secp521r1, :prime192v1, :prime192v2,
 :prime192v3, :prime239v1, :prime239v2, :prime239v3, :prime256v1, :wtls7, :wtls9, :wtls12, :brainpoolP160r1, :brainpoolP160t1, :brainpoolP192r1, :brainpoolP192t1, :brainpoolP224r1, :brainpoolP224t1, :brainpoolP256r1, :brainpoolP256t1, :brainpoolP320r1, :
brainpoolP320t1, :brainpoolP384r1, :brainpoolP384t1, :brainpoolP512r1, :brainpoolP512t1, :sect163k1, :sect163r1, :sect163r2, :sect193r1, :sect193r2, :sect233k1, :sect233r1, :sect239k1, :sect283k1, :sect283r1, :sect409k1, ...], []})
    ** (EXIT) time out
    (stdlib 3.13) gen_server.erl:238: :gen_server.call/2
    (crypto 4.7) crypto.erl:2836: :crypto.cached_curve_algorithms/0
    (crypto 4.7) crypto.erl:677: :crypto."-supports/0-lc$^0/1-0-"/1
    (crypto 4.7) crypto.erl:677: :crypto."-supports/0-lc$^0/1-0-"/1
    (crypto 4.7) crypto.erl:677: :crypto.supports/0
    (ssl 10.0) tls_record.erl:743: :tls_record.sufficient_support/1
    (ssl 10.0) tls_record.erl:370: :tls_record.supported_protocol_versions/1
    (ssl 10.0) tls_record.erl:358: :tls_record.supported_protocol_versions/0
Function: #Function<17.86168715/0 in Hex.Registry.Server.prefetch_online/2>
    Args: []

12:51:30.653 [error] Task #PID<0.159.0> started from :hex_fetcher terminating
** (stop) exited in: :gen_server.call(:application_controller, {:set_env, :crypto, :"$curves$", [:secp160k1, :secp160r1, :secp160r2, :secp192r1, :secp192k1, :secp224k1, :secp224r1, :secp256k1, :secp256r1, :secp384r1, :secp521r1, :prime192v1, :prime192v2,
 :prime192v3, :prime239v1, :prime239v2, :prime239v3, :prime256v1, :wtls7, :wtls9, :wtls12, :brainpoolP160r1, :brainpoolP160t1, :brainpoolP192r1, :brainpoolP192t1, :brainpoolP224r1, :brainpoolP224t1, :brainpoolP256r1, :brainpoolP256t1, :brainpoolP320r1, :
brainpoolP320t1, :brainpoolP384r1, :brainpoolP384t1, :brainpoolP512r1, :brainpoolP512t1, :sect163k1, :sect163r1, :sect163r2, :sect193r1, :sect193r2, :sect233k1, :sect233r1, :sect239k1, :sect283k1, :sect283r1, :sect409k1, ...], []})
    ** (EXIT) time out
    (stdlib 3.13) gen_server.erl:238: :gen_server.call/2
    (crypto 4.7) crypto.erl:2836: :crypto.cached_curve_algorithms/0
    (crypto 4.7) crypto.erl:677: :crypto."-supports/0-lc$^0/1-0-"/1
    (crypto 4.7) crypto.erl:677: :crypto."-supports/0-lc$^0/1-0-"/1
    (crypto 4.7) crypto.erl:677: :crypto.supports/0
    (ssl 10.0) tls_record.erl:743: :tls_record.sufficient_support/1
    (ssl 10.0) tls_record.erl:370: :tls_record.supported_protocol_versions/1
    (ssl 10.0) tls_record.erl:358: :tls_record.supported_protocol_versions/0
Function: #Function<17.86168715/0 in Hex.Registry.Server.prefetch_online/2>
    Args: []

12:51:30.653 [error] Task #PID<0.158.0> started from :hex_fetcher terminating
** (stop) exited in: :gen_server.call(:application_controller, {:set_env, :crypto, :"$curves$", [:secp160k1, :secp160r1, :secp160r2, :secp192r1, :secp192k1, :secp224k1, :secp224r1, :secp256k1, :secp256r1, :secp384r1, :secp521r1, :prime192v1, :prime192v2,
 :prime192v3, :prime239v1, :prime239v2, :prime239v3, :prime256v1, :wtls7, :wtls9, :wtls12, :brainpoolP160r1, :brainpoolP160t1, :brainpoolP192r1, :brainpoolP192t1, :brainpoolP224r1, :brainpoolP224t1, :brainpoolP256r1, :brainpoolP256t1, :brainpoolP320r1, :
brainpoolP320t1, :brainpoolP384r1, :brainpoolP384t1, :brainpoolP512r1, :brainpoolP512t1, :sect163k1, :sect163r1, :sect163r2, :sect193r1, :sect193r2, :sect233k1, :sect233r1, :sect239k1, :sect283k1, :sect283r1, :sect409k1, ...], []})
    ** (EXIT) time out
    (stdlib 3.13) gen_server.erl:238: :gen_server.call/2
    (crypto 4.7) crypto.erl:2836: :crypto.cached_curve_algorithms/0
    (crypto 4.7) crypto.erl:677: :crypto."-supports/0-lc$^0/1-0-"/1
    (crypto 4.7) crypto.erl:677: :crypto."-supports/0-lc$^0/1-0-"/1
    (crypto 4.7) crypto.erl:677: :crypto.supports/0
    (ssl 10.0) tls_record.erl:743: :tls_record.sufficient_support/1
    (ssl 10.0) tls_record.erl:370: :tls_record.supported_protocol_versions/1
    (ssl 10.0) tls_record.erl:358: :tls_record.supported_protocol_versions/0
Function: #Function<17.86168715/0 in Hex.Registry.Server.prefetch_online/2>
    Args: []

^C
BREAK: (a)bort (A)bort with dump (c)ontinue (p)roc info (i)nfo
       (l)oaded (v)ersion (k)ill (D)b-tables (d)istribution
a

I then tried HEX_HTTP_CONCURRENCY=1 mix deps.get and that looked to work nicely:

pi@raspberrypi:~/Development/phoenix-liveview-counter-tutorial $ HEX_HTTP_CONCURRENCY=1 mix deps.get
Resolving Hex dependencies...
Dependency resolution completed:
Unchanged:
  certifi 2.5.2
  cowboy 2.8.0
  cowlib 2.9.1
  excoveralls 0.12.3
  file_system 0.2.8
  floki 0.26.0
  gettext 0.18.0
  hackney 1.16.0
  html_entities 0.5.1
  idna 6.0.1
  jason 1.2.1
  metrics 1.0.1
  mime 1.3.1
  mimerl 1.2.0
  parse_trans 3.3.0
  phoenix 1.5.3
  phoenix_html 2.14.2
  phoenix_live_dashboard 0.2.7
  phoenix_live_reload 1.2.2
  phoenix_live_view 0.14.1
  phoenix_pubsub 2.0.0
  plug 1.10.3
  plug_cowboy 2.3.0
  plug_crypto 1.1.2
  ranch 1.7.1
  ssl_verify_fun 1.1.6
  telemetry 0.4.2
  telemetry_metrics 0.5.0
  telemetry_poller 0.5.0
  unicode_util_compat 0.5.0
* Getting phoenix (Hex package)
* Getting phoenix_live_view (Hex package)
* Getting floki (Hex package)
* Getting phoenix_html (Hex package)
* Getting phoenix_live_reload (Hex package)
* Getting phoenix_live_dashboard (Hex package)
* Getting telemetry_metrics (Hex package)
* Getting telemetry_poller (Hex package)
* Getting gettext (Hex package)
* Getting jason (Hex package)
* Getting plug_cowboy (Hex package)
* Getting excoveralls (Hex package)
* Getting hackney (Hex package)
* Getting certifi (Hex package)
* Getting idna (Hex package)
* Getting metrics (Hex package)
* Getting mimerl (Hex package)
* Getting parse_trans (Hex package)
* Getting ssl_verify_fun (Hex package)
* Getting unicode_util_compat (Hex package)
* Getting cowboy (Hex package)
* Getting plug (Hex package)
* Getting telemetry (Hex package)
* Getting mime (Hex package)
* Getting plug_crypto (Hex package)
* Getting cowlib (Hex package)
* Getting ranch (Hex package)
* Getting file_system (Hex package)
* Getting html_entities (Hex package)
* Getting phoenix_pubsub (Hex package)

Finally I tried mix setup but that sadly didn’t work either. Perhaps is might be worth increasing the genserver’s call timeout value? Is this easy to do?

pi@raspberrypi:~/Development/phoenix-liveview-counter-tutorial $ mix setup

12:53:10.467 [error] Task #PID<0.161.0> started from :hex_fetcher terminating
** (stop) exited in: :gen_server.call(:application_controller, {:set_env, :crypto, :"$curves$", [:secp160k1, :secp160r1, :secp160r2, :secp192r1, :secp192k1, :secp224k1, :secp224r1, :secp256k1, :secp256r1, :secp384r1, :secp521r1, :prime192v1, :prime192v2, :prime192v3, :prime239v1, :prime239v2, :prime239v3, :prime256v1, :wtls7, :wtls9, :wtls12, :brainpoolP160r1, :brainpoolP160t1, :brainpoolP192r1, :brainpoolP192t1, :brainpoolP224r1, :brainpoolP224t1, :brainpoolP256r1, :brainpoolP256t1, :brainpoolP320r1, :brainpoolP320t1, :brainpoolP384r1, :brainpoolP384t1, :brainpoolP512r1, :brainpoolP512t1, :sect163k1, :sect163r1, :sect163r2, :sect193r1, :sect193r2, :sect233k1, :sect233r1, :sect239k1, :sect283k1, :sect283r1, :sect409k1, ...], []})
    ** (EXIT) time out
    (stdlib 3.13) gen_server.erl:238: :gen_server.call/2
    (crypto 4.7) crypto.erl:2836: :crypto.cached_curve_algorithms/0
    (crypto 4.7) crypto.erl:677: :crypto."-supports/0-lc$^0/1-0-"/1
    (crypto 4.7) crypto.erl:677: :crypto."-supports/0-lc$^0/1-0-"/1
    (crypto 4.7) crypto.erl:677: :crypto.supports/0
    (ssl 10.0) tls_record.erl:743: :tls_record.sufficient_support/1
    (ssl 10.0) tls_record.erl:370: :tls_record.supported_protocol_versions/1
    (ssl 10.0) tls_record.erl:358: :tls_record.supported_protocol_versions/0
Function: #Function<17.86168715/0 in Hex.Registry.Server.prefetch_online/2>
    Args: []

12:53:10.468 [error] Task #PID<0.160.0> started from :hex_fetcher terminating
** (stop) exited in: :gen_server.call(:application_controller, {:set_env, :crypto, :"$curves$", [:secp160k1, :secp160r1, :secp160r2, :secp192r1, :secp192k1, :secp224k1, :secp224r1, :secp256k1, :secp256r1, :secp384r1, :secp521r1, :prime192v1, :prime192v2, :prime192v3, :prime239v1, :prime239v2, :prime239v3, :prime256v1, :wtls7, :wtls9, :wtls12, :brainpoolP160r1, :brainpoolP160t1, :brainpoolP192r1, :brainpoolP192t1, :brainpoolP224r1, :brainpoolP224t1, :brainpoolP256r1, :brainpoolP256t1, :brainpoolP320r1, :brainpoolP320t1, :brainpoolP384r1, :brainpoolP384t1, :brainpoolP512r1, :brainpoolP512t1, :sect163k1, :sect163r1, :sect163r2, :sect193r1, :sect193r2, :sect233k1, :sect233r1, :sect239k1, :sect283k1, :sect283r1, :sect409k1, ...], []})
    ** (EXIT) time out
    (stdlib 3.13) gen_server.erl:238: :gen_server.call/2
    (crypto 4.7) crypto.erl:2836: :crypto.cached_curve_algorithms/0
    (crypto 4.7) crypto.erl:677: :crypto."-supports/0-lc$^0/1-0-"/1
    (crypto 4.7) crypto.erl:677: :crypto."-supports/0-lc$^0/1-0-"/1
    (crypto 4.7) crypto.erl:677: :crypto.supports/0
    (ssl 10.0) tls_record.erl:743: :tls_record.sufficient_support/1
    (ssl 10.0) tls_record.erl:370: :tls_record.supported_protocol_versions/1
    (ssl 10.0) tls_record.erl:358: :tls_record.supported_protocol_versions/0
Function: #Function<17.86168715/0 in Hex.Registry.Server.prefetch_online/2>
    Args: []

12:53:10.468 [error] Task #PID<0.157.0> started from :hex_fetcher terminating
** (stop) exited in: :gen_server.call(:application_controller, {:set_env, :crypto, :"$curves$", [:secp160k1, :secp160r1, :secp160r2, :secp192r1, :secp192k1, :secp224k1, :secp224r1, :secp256k1, :secp256r1, :secp384r1, :secp521r1, :prime192v1, :prime192v2, :prime192v3, :prime239v1, :prime239v2, :prime239v3, :prime256v1, :wtls7, :wtls9, :wtls12, :brainpoolP160r1, :brainpoolP160t1, :brainpoolP192r1, :brainpoolP192t1, :brainpoolP224r1, :brainpoolP224t1, :brainpoolP256r1, :brainpoolP256t1, :brainpoolP320r1, :brainpoolP320t1, :brainpoolP384r1, :brainpoolP384t1, :brainpoolP512r1, :brainpoolP512t1, :sect163k1, :sect163r1, :sect163r2, :sect193r1, :sect193r2, :sect233k1, :sect233r1, :sect239k1, :sect283k1, :sect283r1, :sect409k1, ...], []})
    ** (EXIT) time out
    (stdlib 3.13) gen_server.erl:238: :gen_server.call/2
    (crypto 4.7) crypto.erl:2836: :crypto.cached_curve_algorithms/0
    (crypto 4.7) crypto.erl:677: :crypto."-supports/0-lc$^0/1-0-"/1
    (crypto 4.7) crypto.erl:677: :crypto."-supports/0-lc$^0/1-0-"/1
    (crypto 4.7) crypto.erl:677: :crypto.supports/0
    (ssl 10.0) tls_record.erl:743: :tls_record.sufficient_support/1
    (ssl 10.0) tls_record.erl:370: :tls_record.supported_protocol_versions/1
    (ssl 10.0) tls_record.erl:358: :tls_record.supported_protocol_versions/0
Function: #Function<17.86168715/0 in Hex.Registry.Server.prefetch_online/2>
    Args: []

12:53:10.469 [error] Task #PID<0.164.0> started from :hex_fetcher terminating
** (stop) exited in: :gen_server.call(:application_controller, {:set_env, :crypto, :"$curves$", [:secp160k1, :secp160r1, :secp160r2, :secp192r1, :secp192k1, :secp224k1, :secp224r1, :secp256k1, :secp256r1, :secp384r1, :secp521r1, :prime192v1, :prime192v2, :prime192v3, :prime239v1, :prime239v2, :prime239v3, :prime256v1, :wtls7, :wtls9, :wtls12, :brainpoolP160r1, :brainpoolP160t1, :brainpoolP192r1, :brainpoolP192t1, :brainpoolP224r1, :brainpoolP224t1, :brainpoolP256r1, :brainpoolP256t1, :brainpoolP320r1, :brainpoolP320t1, :brainpoolP384r1, :brainpoolP384t1, :brainpoolP512r1, :brainpoolP512t1, :sect163k1, :sect163r1, :sect163r2, :sect193r1, :sect193r2, :sect233k1, :sect233r1, :sect239k1, :sect283k1, :sect283r1, :sect409k1, ...], []})
    ** (EXIT) time out
    (stdlib 3.13) gen_server.erl:238: :gen_server.call/2
    (crypto 4.7) crypto.erl:2836: :crypto.cached_curve_algorithms/0
    (crypto 4.7) crypto.erl:677: :crypto."-supports/0-lc$^0/1-0-"/1
    (crypto 4.7) crypto.erl:677: :crypto."-supports/0-lc$^0/1-0-"/1
    (crypto 4.7) crypto.erl:677: :crypto.supports/0
    (ssl 10.0) tls_record.erl:743: :tls_record.sufficient_support/1
    (ssl 10.0) tls_record.erl:370: :tls_record.supported_protocol_versions/1
    (ssl 10.0) tls_record.erl:358: :tls_record.supported_protocol_versions/0
Function: #Function<17.86168715/0 in Hex.Registry.Server.prefetch_online/2>
    Args: []
** (exit) exited in: GenServer.call(Hex.Registry.Server, {:versions, "hexpm", "certifi"}, 60000)
    ** (EXIT) time out
    (elixir 1.10.4) lib/gen_server.ex:1023: GenServer.call/3
    (hex 0.20.5) lib/hex/remote_converger.ex:466: Hex.RemoteConverger.verify_dep/3
    (elixir 1.10.4) lib/enum.ex:789: anonymous fn/3 in Enum.each/2
    (stdlib 3.13) maps.erl:233: :maps.fold_1/3
    (elixir 1.10.4) lib/enum.ex:2127: Enum.each/2
    (hex 0.20.5) lib/hex/remote_converger.ex:40: Hex.RemoteConverger.converge/2
    (mix 1.10.4) lib/mix/dep/converger.ex:95: Mix.Dep.Converger.all/4
    (mix 1.10.4) lib/mix/dep/converger.ex:51: Mix.Dep.Converger.converge/4

Of course the most obvious thing eluded me until now:

HEX_HTTP_CONCURRENCY=1 mix setup

It’s currently working away nicely (albeit slowly). Hopefully that’s things fixed…

I’ll report back later whether or not I got the demo working :slight_smile:

The timeout is coming from within Erlang/OTP. Perhaps they should increase the timeouts for these operations but nothing that Elixir/Hex can do. But Hex can reduce the default concurrency, perhaps to something like min(2 * System.schedulers_online, 8). Can you try with HEX_HTTP_CONCURRENCY=2 mix setup too?

1 Like

Yey! Got it working perfectly in the end - no perceivable latency despite running on a Pi Zero. Exciting stuff!

With respect to your question, HEX_HTTP_CONCURRENCY=2 mix setup seemed to work fine, whilst HEX_HTTP_CONCURRENCY=3 mix setup didn’t.

Also, for those interested:

pi@raspberrypi:~$ iex
Erlang/OTP 23 [erts-11.0.3] [source] [smp:1:1] [ds:1:1:10] [async-threads:1] [hipe]

Interactive Elixir (1.10.4) - press Ctrl+C to exit (type h() ENTER for help)
iex(1)> System.schedulers_online
1
2 Likes