Exadra37
I am playing around with Observer, and I am able to connect to any application I have running on the same docker network.
I start the application from each docker container like:
elixir --cookie super-long-secret-cookie --sname app1 -S mix phoenix.server
and I start the observer from another docker container with:
erl -sname observer -hidden -setcookie super-long-secret-cookie -run observer
In the Observer GUI interface I am able to connect to app1 and app2 without any problem, and see them working as expected, but each time I need to swap between app1 and app2 I need to reenter the de node details to reconnect, because in the Nodes menu it does not keep a list of all apps I am connecting to during the current session…
So my expectation is to see a list of all nodes I have already connected to, and be able to click in any to reconnect to it, but as we can see in the image I only have the observer node itself, and none of the nodes of the app I have already connected to in this Observer session… is this the actual behavior of Observer or is just me having an issue with it?
Trending in Questions
Other Trending Topics
Categories:
Sub Categories:
Forums
Popular Tags
- #ecto
- #liveview
- #troubleshooting
- #learning-elixir
- #library
- #deployment
- #erlang
- #testing
- #genserver
- #mix
- #absinthe
- #remote-other
- #otp
- #plug
- #how-to-question
- #macros
- #postgres
- #elixirconf
- #channels
- #exunit
- #discussion
- #code-sync
- #podcasts
- #javascript
- #onsite
- #dialyzer
- #docker
- #authentication
- #umbrella
- #full-time-contract
- #podcasts-by-brainlid
- #ecto-query
- #elixirconf-us
- #ai
- #blog-post
- #elixir-ls
- #phoenix_html
- #iex
- #graphql
- #genstage
- #websockets
- #supervisor
- #advent-of-code
- #distillery
- #processes
- #api
- #forms
- #hex
- #security
- #metaprogramming












Showing Posts 1 to 10- Show Best Posts
- Show All (oldest first)
- Show All (newest first)
Exadra37
I found the solution…
I was starting Observer with the Erlang shell instead of the Elixir shell.
So instead of using:
I need to use:
OvermindDL1
Actually it was because you were using
-hiddenon the initial call, that means it doesn’t join the BEAM mesh (so you only see the thing you explicitly named and nothing else) but rather only joins that specific node.Exadra37
Good catch, but still not working with:
OvermindDL1
How is it not working? You aren’t connected to a mesh network yet at that point, need to do that before observer launches as I recall.
Exadra37
Thanks to point it out… I indeed forgot to connect to the node…
So the correct command is indeed:
I am still learning all this stuff, and at same toime building a Docker stack for development in Elixir with all the tooling available.
OvermindDL1
So that worked all for you? Awesome!
Exadra37
Well the weird part is that if I put the command in a bash script with a variable to replace the node connect bit it will not work, but works fine if is only plain text…
OvermindDL1
Hmm, put
echobefore youriex --name "${observer_node_name}" --cookie "${node_cookie}" -e "${node_connect}" -e ":observer.start()"line to becomeecho iex --name "${observer_node_name}" --cookie "${node_cookie}" -e "${node_connect}" -e ":observer.start()"and see what it prints out and if everything is appearing properly interpolated and matching your working line (excepting"'s and so forth of course)? Are you sure the shell is not interpolating out your"'s in the:"node_name@blah"part and so forth? I don’t quite remember the rules of bash in interpolation but I know the way it interpolates is rather broken so it wouldn’t surprise me (I use ZSH, which is basically bash done right, though I keep my scripts to full posix shell mode regardless).Exadra37
Bingo you found it… It was splinting the command into a new line… I was not able to found how the string end ups with the new line, but I fixed it before I build the command with:
So the full working script is now:
My default shell is also
zshwithoh-my-zshplugin, but scripting I do inshby default and resort tobashonly when I really need a bash-ismOvermindDL1
That tells me that there was bad input on the commandline or an an env-var, which you could fix by ‘removing’ the appropriate
"'s around them (you really only need to keep those if whitespace or newlines are important, otherwise by not having it then it will collapse to a single line with single spaces instead of repeated spaces).