Unknown
Unknown

Reputation: 13

Heroku app crashing after a while from deployment. (node.js exress)

So my heroku app crashes with h10 codes and description is "app crashed". No more information. I will attach a screenshot about this (there is like 800 critical errors I can see in my heroku dashboard, and after deployment before a point it doesn't get any errors, then for some reason it starts having these critical errors then shuts down.)

Restarting the server fixes this but after a while it will crash again so I want to fix this properly.

https://i.sstatic.net/urAeT.jpg Here is three of the errors with the "/" and favicon being more prominent.

Upvotes: 0

Views: 776

Answers (2)

Arcanus
Arcanus

Reputation: 700

If you are using MYSQL make sure you have your connection set with createPool and not createConnection.

CreatePool dynamically creates db connections per your need, whereas createConnection will crash when overloaded.

Upvotes: 0

Damien MATHIEU
Damien MATHIEU

Reputation: 32629

An "app crashed" means the process running your app has crashed. This is probably an unhandled NodeJS exception crashing the process.

When this happens, Heroku will automatically restart the app, up to a certain point (apps restarting too often leads to capacity issues).

You should inspect your app's logs (a log retention add-on such as logentries will help there), and see where the first H10 is. Right before that first H10, there will probably be a stacktrace showing where in your code the crash happens.

Upvotes: 1

Related Questions