phoenixframework / phoenix_live_dashboard

Realtime dashboard with metrics, request logging, plus storage, OS and VM insights

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Protocol.UndefinedError: protocol Enumerable not implemented for {:EXIT, {{:badmatch, nil} ...}

yordis opened this issue · comments

Environment

Make sure you are using the latest LiveView and Dashboard versions before continuing.

  • Elixir version (elixir -v):
ELIXIR_VERSION=
OTP_VERSION=24.3.4
ALPINE_VERSION=3.15.3
  • Phoenix version (mix deps):
  • Phoenix LiveView version (mix deps):
  • Phoenix Dashboard version (mix deps):
* phoenix 1.6.15
* phoenix_ecto 4.4.0
* phoenix_html 3.2.0
* phoenix_live_dashboard 0.7.2
* phoenix_live_view 0.18.3
* phoenix_pubsub 2.1.1
* phoenix_template 1.0.0
* phoenix_view 2.0.0
  • Operating system: Alpine

Actual behavior

I got the following Sentry error:

Protocol.UndefinedError: protocol Enumerable not implemented for {:EXIT, {{:badmatch, nil}, [{Phoenix.LiveDashboard.SystemInfo, :to_node, 3, [file: 'lib/phoenix/live_dashboard/system_info.ex', line: 434]}, {Phoenix.LiveDashboard.SystemInfo, :"-links_tree/3-fun-0-", 3, [file: 'lib/phoenix/live_dashboard/system_info.ex', line: 406]}, {Enum, :"-map_reduce/3-lists^mapfoldl/2-0-", 3, [file: 'lib/enum.ex', line: 1780]}, {Enum, :"-map_reduce/3-lists^mapfoldl/2-0-", 3, [file: 'lib/enum.ex', line: 1780]}, {Phoenix.LiveDashboard.SystemInfo, :"-links_tree/3-fun-0-", 3, [file: 'lib/phoenix/live_dashboard/system_info.ex', line: 405]}, {Enum, :"-map_reduce/3-lists^mapfoldl/2-0-", 3, [file: 'lib/enum.ex', line: 1780]}, {Phoenix.LiveDashboard.SystemInfo, :"-links_tree/3-fun-0-", 3, [file: 'lib/phoenix/live_dashboard/system_info.ex', line: 405]}, {Enum, :"-map_reduce/3-lists^mapfoldl/2-0-", 3, [file: 'lib/enum.ex', line: 1780]}]}} of type Tuple. This protocol is implemented for the following type(s): DBConnection.PrepareStream, DBConnection.Stream, Date.Range, Ecto.Adapters.SQL.Stream, File.Stream, Function, GenEvent.Stream, HashDict, HashSet, IO.Stream, Jason.OrderedObject, List, Map, MapSet, Postgrex.Stream, Range, Stream, Timex.Interval
  File "lib/enum.ex", line 1, in Enumerable.impl_for!/1
  File "lib/enum.ex", line 166, in Enumerable.reduce/3
  File "lib/enum.ex", line 4307, in Enum.map/2
  File "lib/phoenix/live_dashboard/reingold_tilford.ex", line 54, in Phoenix.LiveDashboard.ReingoldTilford.change_representation/3
  File "lib/phoenix/live_dashboard/reingold_tilford.ex", line 46, in Phoenix.LiveDashboard.ReingoldTilford.build/2
  File "lib/phoenix/live_dashboard/info/app_info_component.ex", line 44, in Phoenix.LiveDashboard.AppInfoComponent.assign_tree/1
  File "lib/phoenix/live_dashboard/info/app_info_component.ex", line 38, in Phoenix.LiveDashboard.AppInfoComponent.update/2
  File "lib/phoenix_live_view/utils.ex", line 428, in Phoenix.LiveView.Utils.maybe_call_update!/3

Expected behavior

Handle the failure

As far as I understand, this error happens because it tries to show an application with a PID that dies during the generation of the tree. Is it still happening? With what application?

@alexcastano good catch. This can definitely happen and the code needs to be improved to consider children may die at any time. :)