Retrieving erl_crash.dump from crashed docker container

I have an application running in a Docker container in AWS ECS. We have been running into situations here and there that cause our image to crash. the last thing it says before it dies is: Crash dump is being written to: erl_crash.dump...done.

Unfortunately, once the application crashes, we no longer have access to the container to retrieve the erl_crash.dump file, so we have never had a chance to inspect it.

Is there any way to retrieve this file, or send the file somewhere on the way out?

Thanks!

1 Like

You could change your docker cmd to run a bash script that starts the app and monitors abnormal exits, then stores the crash dump in a bucket as a final step.

You can set the environment variable ERL_CRASH_DUMP to a path. That way, you could write to a volume or network drive.

https://www.erlang.org/doc/apps/erts/crash_dump.html

4 Likes

Thanks guys!

Putting this together now.