hauleth / hauleth/consulate

problems with inets on startup

Open
#2 5 comments 0 reactions 0 assignees View on GitHub
Dominant language
Erlang
Stars
15
Forks
2
PR merge metrics
No merged PRs in 30d

Description

Hi!

I've followed the steps outlined in [elixirforum post](https://elixirforum.com/t/consulate-erl-epmd-replacement-module-that-uses-consul-instead-of-epmd/32658) but unfortunately I couldn't get the app to start in s distributed setting with consulate.

---

If I use a command similar to the one on the forum,

```sh
ERL_FLAGS="-epmd_module consulate -start_epmd false" iex --sname foo -S mix phx.server
```

I get `consulate:start_link/0` undefined error:

```plain
... snip ...
{"Kernel pid terminated",application_controller,"{application_start_failure,kernel,{{shutdown,{failed_to_start_child,net_sup,{shutdown,{failed_to_start_child,consulate,{'EXIT',{undef,[{consulate,start_link,[],[]}
... snip ...
```
even though I've already ran `mix deps.compile` and I have `_build/dev/lib/consulate/ebin` available.

---

And when using `-pa` option as well with path to consulate ebin, the error becomes different:

```sh
ERL_FLAGS="-epmd_module consulate -start_epmd false -pa _build/dev/lib/consulate/ebin" iex --sname foo -S mix phx.server
```

```plain
Protocol 'inet_tcp': not supported
```
which seems to be coming from https://github.com/erlang/otp/blob/81c6d94625a04f6550e77a068489ca6378cabfee/lib/kernel/src/net_kernel.erl#L1811, which seems like a problem with loading inet_tcp / inet_tcp_dist modules.

---

I wonder if you could give any hints / pointers for where I could look to resolve these problems?

Repro: https://github.com/ruslandoga/try-consulate
Relevant commit: https://github.com/ruslandoga/try-consulate/commit/dc517893425456e0e7277c06b0aee80cdbe74cc5

Versions used:
```
Erlang/OTP 24 [erts-12.0.3] [source] [64-bit] [smp:8:8] [ds:8:8:10] [async-threads:1] [dtrace]

Elixir 1.12.2 (compiled with Erlang/OTP 24)
```

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.