Engineering

15 November, 2018

Quick tips & tools for analysing Erlang/Elixir crash dumps

In this article, we decided to compile a list of resources and tools you can use to analyse and deal with Elixir crash dumps.

Tiago Duarte

Software Engineer

Elixir crash dumps: Quick tips & tools for analysing - Coletiv Blog

We have been using Elixir as our weapon of choice to develop resilient backend services for almost 2 years already, and we have never experienced downtime. But a few days ago one of our Elixir based server “went down”.

For us this came as a big surprise, and worse than that, because the servers had never crashed before we did not have the experience of debugging such a problem.

Sooner or later you might end up in the same situation as we did, so we decided to compile a list of resources and tools you can use to debug your problem.

Erlang crash dump file

The erl_crash.dump file should be the first stop you should take when investigating a crash. This file is located in the directory you deployed your app, in our case the file could be found inside the folder /opt/project_name/api/project_name inside the aws server.

You can use the command ls -la inside the directory to check if the modification date of the crash log matches the date of the downtime. If yes you are on the right path and you should check for the contents of the file.

The contents of the file can look very cryptic at first sight, but as usual the Erlang documentation is quite thorough and helps you go through it and understand every bit.

Crash dump viewer

If you are like us and you have a hard time skimming through textual information, Erlang has got you covered with the Crashdump viewer.

The Crashdump Viewer is a WxWidgets based tool for browsing Erlang crashdumps.

You can simply open a iex session on your terminal and then type :crashdump_viewer.start , you will then be prompted to select the crashlog you would like to open.

How to start the crashdump viewer from your command line How to start the crashdump viewer from your command line

In the image bellow you can see the crashdump viewer in action. With it you can basically see what was going on (processes, memory, message queue, ETS tables …) at the exact time of the crash. The information contained should help you identify most of the problems that result in a crash.

Crashdump viewer in action Crashdump viewer in action

Other useful links

Stuff Goes Bad: Erlang in Anger from Fred Hebert is a free ebook that contains a collection of tips and tricks to help understand where failures come from, code snippets and practices that helped developers debug production systems. It contains a full chapter on how to read crash logs.

Bruce Pomeroy has a great article that focus on a possible problem you can and should check for on your crash log, which is your server ran out of memory. This problem can be hard to identify and fix as it is not a direct result of an exception or some unhandled or unexpected return from a function.

Adopting Elixir From Concept to Production by Ben Marx, José Valim and Bruce Tate is also a great book that covers, among other topics, monitoring and debugging strategies and tools for Elixir based projects.

Elixir

Software Development

Erlang

Debugging

Crash

Join our newsletter

Be part of our community and stay up to date with the latest blog posts.

Subscribe

Join our newsletter

Be part of our community and stay up to date with the latest blog posts.

Subscribe

You might also like...

Go back to blogNext
How to support a list of uploads as input with Absinthe GraphQL

Engineering

26 July, 2022

How to support a list of uploads as input with Absinthe GraphQL

As you might guess, in our day-to-day, we write GraphQL queries and mutations for Phoenix applications using Absinthe to be able to create, read, update and delete records.

Nuno Marinho

Software Engineer

Flutter Navigator 2.0 Made Easy with Auto Router - Coletiv Blog

Engineering

04 January, 2022

Flutter Navigator 2.0 Made Easy with Auto Router

If you are a Flutter developer you might have heard about or even tried the “new” way of navigating with Navigator 2.0, which might be one of the most controversial APIs I have seen.

António Valente

Software Engineer

Enabling PostgreSQL cron jobs on AWS RDS - Coletiv Blog

Engineering

04 November, 2021

Enabling PostgreSQL cron jobs on AWS RDS

A database cron job is a process for scheduling a procedure or command on your database to automate repetitive tasks. By default, cron jobs are disabled on PostgreSQL instances. Here is how you can enable them on Amazon Web Services (AWS) RDS console.

Nuno Marinho

Software Engineer

Go back to blogNext