Node unreachable when connecting Livebook to Elixir App in Prod

:wave:
Trying to connect a local Livebook to a production app following this guide

:white_check_mark: private networking

fly dig TXT _apps.internal -o personal

Update available 0.0.297-pre-2 -> v0.0.297.
Run "fly version update" to upgrade.
;; opcode: QUERY, status: NOERROR, id: 31921
;; flags: qr rd; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 0

;; QUESTION SECTION:
;_apps.internal.	IN	 TXT

;; ANSWER SECTION:
_apps.internal.	5	IN	TXT	"REDACTED,REDACTED-db"

:white_check_mark: setting up cookie and re-deploy
fly ssh console
cat app/releases/COOKIE

:exploding_head: connecting to the remote node using private IP address and cookie in livebook fails

Any troubleshooting pointers are greatly appreciated! Thx!!

1 Like
  • Does the app have node name(s) set up based on this scheme (which the connection guide assumes)?
  • If you ssh to the node and look up its node name (fly ssh console, app/bin/youapp remote, the name should be in the iex prompt, or you could run Node.self) - is it the same that you’re using in the Livebook connection param?
  • Are Livebook and your app both in the same org?
1 Like

@kkonstant thx a lot for your reply!

(1) “node name” → :exclamation: Thx for pointing this out. That was not obvious to me. Made the changes and redeployed
(2) “ssh console” → cool Node.self produces exactly the same output that I am using for the Name connection parameter in Livebook (IE: node name@ipv6)

:person_facepalming::person_facepalming: I scrolled past this in the guide:
ERL_AFLAGS="-proto_dist inet6_tcp" livebook server --name livebook@127.0.0.1

It works now! Not sure if (1) was necessary, but thanks a lot for chiming in!!

2 Likes

Sorry for the confusion, I thought you were using fly.io’s Livebook launcher - it would’ve been able to connect to any node (well, provided the right cookie and all that) as long as both apps are in the same organization (= share the same internal network).

Glad it’s working now!

1 Like

by chance:

(Path.expand(__DIR__) <> "/priv/someFile")
|> File.stream!()

** (File.Error) could not stream “/Users/bla/someFile”: no such file or directory

Does Livebook give you a convenient way to utilize the local file system?
IE: I am doing some exploratory testing with my app. I do not want to constantly deploy and move files to the container and run stuff like seeds.exs.
I would like to just consume local csv/json files and pipe the data to the production app

(alternatively: might just use kino and copy and paste the data into an input field)