livebook-dev / livebook

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

elixir standalone runtime connection timed out #302

Closed schneiderlin closed 3 years ago

schneiderlin commented 3 years ago

Environment

try to start elixir standalone runtime or evaluate elixir code block, got connection timeout. mix standalone also timeout

Running mix deps.get...
Resolving Hex dependencies...
Dependency resolution completed:
Unchanged:
  connection 1.1.0
  cors_plug 2.0.3
  cowboy 2.8.0
  cowboy_telemetry 0.3.1
  cowlib 2.9.1
  db_connection 2.3.1
  decimal 2.0.0
  ecto 3.4.6
  ecto_sql 3.4.5
  file_system 0.2.8
  floki 0.28.0
  gettext 0.18.1
  html_entities 0.5.1
  jason 1.2.2
  mime 1.5.0
  phoenix 1.5.8
  phoenix_gen_socket_client 4.0.0
  phoenix_html 2.14.3
  phoenix_live_dashboard 0.4.0
  phoenix_live_reload 1.2.4
  phoenix_live_view 0.15.4
  phoenix_pubsub 2.0.0
  plug 1.11.1
  plug_cowboy 2.4.1
  plug_crypto 1.2.1
  poison 3.1.0
  postgrex 0.15.8
  priority_queue 1.0.0
  ranch 1.7.1
  telemetry 0.4.2
  telemetry_metrics 0.6.0
  telemetry_poller 0.5.1
  websocket_client 1.4.2
All dependencies are up to date
Running mix compile...
Error: connection timed out

iex, iex -S mix work just fine. I don't know where to get more debug information

josevalim commented 3 years ago

Hi @schneiderlin, this issue may be the same as #275. In particular, see this comment: https://github.com/elixir-nx/livebook/issues/275#issuecomment-845830230

josevalim commented 3 years ago

@jonatanklosko I think we should add a check like this:

iex(1)> :inet.gethostbyname('josemac')
{:ok, {:hostent, 'josemac', [], :inet, 4, [{127, 0, 0, 1}]}}
iex(2)> :inet.gethostbyname('josemac1')
{:error, :nxdomain}

Basically, we get the host part and we try to validate it, if it doesn't validate, then we should fail to start?

schneiderlin commented 3 years ago

thanks for quick response. livebook server --name live@127.0.0.1 works

jonatanklosko commented 3 years ago

@josevalim sounds good given it was not a one-time case, I've created #303 =)

jonatanklosko commented 3 years ago

Closing via #303 as our best effort.

josevalim commented 3 years ago

@schneiderlin can you please do us a favor? Can you try latest main branch without the —name option and let us know if it works for you?