Report errors from releases

How do you report errors from releases?

If I start an app with mix run --no-halt then errors contain stack trace leading to respective Elixir files. With releases, I don’t get such information and sometimes it is difficult to find the origin of an error.

Where are you checking? The files in var/log will have log information. In general I run my releases in the foregound under something like systemctl and then the elixir logs are handled like any other system log.

Am using online services like Bugsnag and Sentry. Initially was building releases and baking into docker images and reported errors was not resolved to respective Elixir files which is normal. Later understood that there is not a big benefit of building a release since I can’t do upgrades. As a bonus, I could save some CI and CD times. And the biggest bonus was better errors with proper stack trace leading to Elixir files.

I’m not sure I understand. I use releases and all errors point to valid elixir files.

Really? Could you please share some screenshots or whatever? Maybe I’ve missed something about releases. Currently, I’m not at my work’s laptop. Will try to recover some old logs from Bugsnag tomorrow. I bet I didn’t get any Elixir related stack traces from compiled BEAM apps.

Example error message in logs:

Task #PID<0.2045.1> started from #PID<0.2762.0> terminating
** (UndefinedFunctionError) function nil.report_config/0 is undefined (module nil is not available)
    (sensetra) lib/sensetra/services/file_reports.ex:151: Sensetra.Services.FileReports.maybe_deliver_email/4
    (sensetra) lib/sensetra/services/file_reports.ex:84:
    (sensetra) lib/sensetra/denim/memory/consumer.ex:37: anonymous fn/2 in Sensetra.Denim.Memory.Consumer.start_task/2
    (elixir) lib/task/supervised.ex:85: Task.Supervised.do_apply/2
    (elixir) lib/task/supervised.ex:36: Task.Supervised.reply/5
    (stdlib) proc_lib.erl:247: :proc_lib.init_p_do_apply/3
Function: #Function<1.48463934/0 in Sensetra.Denim.Memory.Consumer.start_task/2>
    Args: []

Indeed. Just ran tests with exrm release and yes, I really get the proper stack trace. Now I’m thinking my code never failed and errors I got were from some erlang packages. Logs really did not hold trace to elixir files. Unfortunately, Bugsnag keeps logs for 90 days only and I migrated to Sentry half a year ago.

Anyways, now I know it’s not a problem to track errors with releases. Thanks!