Background
Our app is constantly printing an error message and we have no idea where it is coming from. My objective is to detect which process(es) is receiving the message so I can then trace it using Process.info
via a remote shell and find out which module is causing the issue.
Objective
To achieve this, I am following a suggestion given in a previous discussion and I am trying to use recon.
The error message has the following format:
=ERROR REPORT==== 17-Jun-2019::09:29:22.694288 ===
Unexpected message: {#Ref<0.3271557848.1968439297.87877>,badarg}
After reading the documentation of recon_trace I concluded I needed to base my code on the following example, which traces all calls to handle_call
for module Mod
for all new processes, and those of an existing one registered with gproc
:
recon_trace:calls({Mod,handle_call,3}, {10,100}, [{pid, [{via, gproc, Name}, new]}
In order to try the library I decided to go with a simpler approach and just trace 10 calls from anywhere to handle_info
, but it errors out:
:recon_trace.calls({:_, handle_info, 2}, 10)
** (CompileError) iex:3: undefined function handle_info/0
(stdlib) lists.erl:1354: :lists.mapfoldl/3
(stdlib) lists.erl:1355: :lists.mapfoldl/3
(stdlib) lists.erl:1354: :lists.mapfoldl/3
Question
I am connection to the application’s terminal via a remote shell and I am trying to run these commands there.
What am I doing wrong?