dantswain

dantswain

How to debug `Application my_app exited: shutdown` randomly?

Hi! Does anyone have any recommendation on how to debug my application seemingly completely randomly shutting down? The only diagnostic information I seem to get is that it logs

[notice] Application my_app exited: shutdown

AFAIK there’s nothing else weird going on with the app. This is my dev machine so it’s entirely possible that it’s being caused by something there (OOM killer? Running out of file descriptors?) but I don’t know how to get at the underlying cause. I’m not seeing this in other environments like production.

Nothing else is being logged around it, it doesn’t seem to correlate to application errors (which I run into during development for sure) or anything else in particular. It just randomly shuts down and I have to restart it.

First Post!

dimitarvp

dimitarvp

You haven’t given us any information so I’d offer you to start disabling the supervised parts of your app one by one and trying to reproduce the problem until you pinpoint the guilty party.

Most Liked

dantswain

dantswain

Just following up here, I finally caught it. I enabled SASL logging and caught the supervisor’s crash message.

It’s not super relevant to the original question but in case anyone else stumbles upon this, the error I’m getting is:

[error] Child Plug.Cowboy.Drainer of Supervisor MyAppWeb.Endpoint shut down abnormally
** (exit) killed
Pid: #PID<0.1011.0>
Start Call: Plug.Cowboy.Drainer.start_link([refs: [MyAppWeb.Endpoint.HTTP]])
Restart: :permanent
Shutdown: 5000
Type: :worker

Without SASL logging enabled there was nothing else in the logs to indicate why the app had crashed.

dantswain

dantswain

Not yet but I opened an issue :slight_smile:

ream88

ream88

Thanks for this, helped me debugging a similar issue :blush:

Last Post!

jazzgarcha

jazzgarcha

Hi all, for anyone else running into this.

Make sure your ENV values are loaded before starting your server.

I was experiencing the “Application ABC exited: shutdown”, loading my env resolved the process that was getting killed.

Where Next?

Popular in Questions Top

JeremM34
Hello, how can I check the Phoenix version ? Thanks !
New
New
vonH
In asking this question I am more interested about the expressiveness of the language itself and less concerned about the availability of...
New
fireproofsocks
Forgive me if this is obvious, but how does one delete a database record WITHOUT selecting it first? Ecto.Repo — Ecto v3.14.0 has exampl...
New
Patoshizzle
After calling mix ecto.create I get this error: 17:00:32.162 [error] GenServer #PID&lt;0.412.0&gt; terminating ** (Postgrex.Error) FATAL...
New
JorisKok
I have a server on AWS, and was running a load test using artillery. When looking at the Phoenix dashboard I see the Ports going to 100% ...
New
svb
Hi! Currently I want to submit a form by pressing the Enter key. However, since my input field is of type “textarea” this is just adds a...
New

Other popular topics Top

JeremM34
Hello, how can I check the Phoenix version ? Thanks !
New
New
gshaw
What is the idiomatic way of matching for not nil in Elixir? E.g., First way: defp halt_if_not_signed_in(conn, signed_in_account) when...
New
siddhant3030
Hi, I have to write a raw query for one of my project. But till now I have used ecto queries and don’t have much experience writing raw ...
New
AngeloChecked
What learn first? Rust or Elixir Hi Elixir community! I’m here because i want learn a new language. I’m a junior developer and mainly i ...
New
JorisKok
I have a server on AWS, and was running a load test using artillery. When looking at the Phoenix dashboard I see the Ports going to 100% ...
New

We're in Beta

About us Mission Statement