Protocol 'inet_tcp' the name myapp@127.0.0.1 seems to be in use by another Erlang node

Hi guys,

Don’t understand what’s going on. This app is 100% not running on my machine:

$ epmd -names
epmd: up and running on port 4369 with data:

$ ps auxwww | grep beam.smp
zab           20704   0.0  0.0 34253876    948 s000  S+    5:41PM   0:00.00 grep beam.smp

$ ps auxwww | grep rebar3
zab           20704   0.0  0.0 34253876    948 s000  S+    5:41PM   0:00.00 grep beam.smp

But whenever i try to start it, i got this error:

$ cat ./etc/vm.args
-sname myapp@127.0.0.1
-setcookie 60H25Z_28V5I

$ ERL_FLAGS="-args_file ./etc/vm.args" rebar3 shell
[... compiling...]
Protocol 'inet_tcp' the name myapp@127.0.0.1 seems to be in use by another Erlang node

Even if i try it on another machine, i got the same error.
I also tried to use “-sname” but with no luck.

Erlang: Erlang/OTP 24 [erts-12.1]
Linux: Ubuntu 20.04LTS
1 Like

I’ve located the code throwing this error here: net_kernel.erl

1 Like

One thing that looks off is “./etc/vm.args” (in ERL_FLAGS) is not the same as “.etc/vm.args” (your cat command)

1 Like

Forgot to mention you can pass the values as arguments.

rebar3 shell --sname myapp --setcookie 60H25Z_28V5I

see

rebar3 help shell

2 Likes

@LeonardB Many thanks. This temporarly solves my issue. Still don’t understand why this is failing:

ERL_FLAGS="-args_file ./etc/vm.args" rebar3 shell
1 Like

May there be a problem because you set a long name (with domain) under sname option in vm.args?

1 Like

@mmin sorry, was a copy/paste mistake in my original post.
I tried both with:

-name myapp@127.0.0.1

and also:
-sname myapp
1 Like

So, when you pass values directly from CLI it works?

If not, can you shrink it down to minimal example? Do you maybe start other nodes inside your app?

2 Likes

@mmin Yes, from the CLI it works as expected. I don’t start nor connect to any other node.
I will try to find a minimal example reproducing this. Many thanks.

2 Likes

That’s really weird… Which exact version of Erlang are you using? Also, can you paste rebar.config file here?

1 Like