Bad RPC call on first launch after adding `:os_mon`
halostatue opened this issue · comments
Environment
Make sure you are using the latest LiveView and Dashboard versions before continuing.
This is on a freshly created Phoenix application mix phx.new
. The only trick is that I’m using an umbrella setup, but I do not think that will change the error.
-
Elixir version (elixir -v):
Erlang/OTP 26 [erts-14.1.1] [source] [64-bit] [smp:10:10] [ds:10:10:10] [async-threads:1] [jit] Elixir 1.15.7 (compiled with Erlang/OTP 26)
-
Phoenix version (mix deps):
phoenix 1.7.10 (Hex package) (mix)
-
Phoenix LiveView version (mix deps):
phoenix_live_view 0.20.2 (Hex package) (mix)
-
Phoenix Dashboard version (mix deps):
phoenix_live_dashboard 0.8.3 (Hex package) (mix)
-
Operating system: macOS 13.6.3 22G436 arm64
-
Browsers you attempted to reproduce this bug on (the more the merrier): n/a, but Safari
Actual behavior
iex -S mix phx.server
; visit live dashboard: OS is not enabled (expected).- Quit iex. Edit the base
mix.exs
(in an umbrella this would beapps/main_app/mix.exs
to add:os_mon
toextra_applications
. iex -S mix phx.server
; visit live dashboard. OS is enabled (expected). Click on it produces the crash below.- Quit iex.
iex -S mix phx.server
; visit live dashboard. OS is enabled and does not crash.
key :system_mem not found in: {:badrpc,
{:EXIT,
{:undef,
[
{:cpu_sup, :util, [[:detailed, :per_cpu]], []},
{Phoenix.LiveDashboard.SystemInfo, :os_mon_callback, 0,
[file: ~c"lib/phoenix/live_dashboard/system_info.ex", line: 726]}
]}}}
Expected behavior
Not a process crash. It seems odd that this is failing this way — but it is reliably failing this way.
By reliably failing, I mean that I have been able to reproduce it 5–6 times in a row. Remove :os_mon
, restart (disabled). Add :os_mon
, restart (enabled, crash), restart (enabled, no crash). Rinse and repeat.