livebook-dev / livebook

Automate code & data workflows with interactive Elixir notebooks
https://livebook.dev
Apache License 2.0
4.62k stars 408 forks source link

Node is unreachable #2656

Closed briankariuki closed 2 weeks ago

briankariuki commented 2 weeks ago

Environment

Current behavior

I'm trying to connect to my locally running phoenix app started with iex --sname myapp --cookie myappcookie -S mix phx.server.

I open livebook and add a new remote execution cell but I get this error after adding the name and cookie

image

.

Also trying to connect as an attached instance produces this error

image

Expected behavior

I was following this tutorial on livebook's youtube channel and I've done the same steps as shown in the video. I've ran out of ideas on how to debug what is causing the issue

https://www.youtube.com/watch?v=Q0aNR2apKv8

jonatanklosko commented 2 weeks ago

Hey @briankariuki, does it work if you start another node like iex --sname test --cookie myappcookie and try to Node.connect(:"myapp@brains-MacBook-Pro")?

jonatanklosko commented 2 weeks ago

Also, does scutil --get HostName print the hostname or perhaps "HostName: not set"?

jonatanklosko commented 2 weeks ago

If both of these look good, you can also try the nightly build of the Desktop App. Note that we changed the distribution mode to long names, so you will have to start the Phoenix app with iex --name myapp@127.0.0.1 --cookie myappcookie -S mix phx.server.

briankariuki commented 2 weeks ago

Also, does scutil --get HostName print the hostname or perhaps "HostName: not set"?

I get Hostname not set

jonatanklosko commented 2 weeks ago

@briankariuki oh, in that case try setting it as mentioned here: https://github.com/livebook-dev/livebook/wiki/Installation-FAQ#are-you-using-macos.

jonatanklosko commented 2 weeks ago

We have checks on boot that usually detect it, and the standalone runtime usually wouldn't work, but either way that may help. Hopefully those issues will no longer be relevant with the next Livebook release where we always use long names with loopback IP directly :)

josevalim commented 2 weeks ago

Closing as the hostname must be set, as per above!