omgnetwork/elixir-omg

Protocol.UndefinedError: protocol Jason.Encoder not implemented for #PID<0.32128.13> of type PID, Jason.Encoder protocol m...

sentry-io opened this issue · 1 comments

Sentry Issue: ELIXIR-OMG-68

Protocol.UndefinedError: protocol Jason.Encoder not implemented for #PID<0.32128.13> of type PID, Jason.Encoder protocol must always be explicitly implemented. This protocol is implemented for the following type(s): OMG.WatcherInfo.DB.Transaction, Ecto.Association.NotLoaded, Ecto.Schema.Metadata, Float, BitString, Decimal, Atom, Date, NaiveDateTime, Map, Time, Jason.Fragment, DateTime, List, Any, Integer
  File "lib/jason.ex", line 199, in Jason.encode_to_iodata!/2
  File "lib/phoenix/controller.ex", line 776, in Phoenix.Controller.__put_render__/5
  File "lib/omg_child_chain_rpc/web/endpoint.ex", line 15, in OMG.ChildChainRPC.Web.Endpoint.instrument/4
  File "lib/phoenix/controller.ex", line 792, in Phoenix.Controller.instrument_render_and_send/4
  File "lib/omg_child_chain_rpc/web/controllers/alarm.ex", line 15, in OMG.ChildChainRPC.Web.Controller.Alarm.action/2
...
(3 additional frame(s) were not displayed)

(Protocol.UndefinedError) protocol Jason.Encoder not implemented for #PID<0.32128.13> of type PID, Jason.Encoder protocol must always be explicitly implemented. This protocol is implemented for the following type(s): OMG.WatcherInfo.DB.Transaction, Ecto.Association.NotLoaded, Ecto.Schema.Metadata, Float, BitString, Decimal, Atom, Date, NaiveDateTime, Map, Time, Jason.Fragment, DateTime, List, Any, Integer

previous discussion on: slack, release v1.0.2

unnawut🌴 2 days ago
iex> OMG.Watcher.API.Alarm.get_alarms()
{:ok, [process_memory_high_watermark: #PID<0.28886.2>]}
😞

unnawut🌴 2 days ago
again not related to this release but we should fix in the next one

boolafish 2 days ago
So it cannot print the PID part?

boolafish 2 days ago
Cause we have to explicitly implement Jason?

unnawut🌴 2 days ago
yeah, or inspect(pid) before printing

unnawut🌴 2 days ago
but I don’t think it’s useful to expose pid in /alarm.get though, so maybe we just need to remove the pid

unnawut🌴 2 days ago
which is also weird it managed to deviate from these tests:

unnawut🌴 2 days ago
oh waittttt

unnawut🌴 2 days ago
it’s raising process_memory_high_watermark not system_memory_high_watermark

unnawut🌴 2 days ago
http://erlang.org/doc/man/memsup.html#description
Periodically performs a memory check:

  • If more than a certain amount of available system memory is allocated, as reported by the underlying operating system, the alarm {system_memory_high_watermark, []} is set.
  • If any Erlang process Pid in the system has allocated more than a certain amount of total system memory, the alarm {process_memory_high_watermark, Pid} is set.

unnawut🌴 2 days ago
I think you just discovered a new edge case :yougotitdude:
:mindblown:
1