App deployed on Heroku crashes randomly after hours running perfectly - node.js

Randomly my app crash, it's randomly because crash at requests that work by hours without any errors, but, sometimes "with no specific reason" it's crash, when it happens I just restart the dynos and de app run normally for more few hours.
the last log:
2022-05-23T09:32:57.310697+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=POST Path="/admin/presences/numconfirm" host=stark-waters56023.herokuapp.com request_id=3dc168eb-deea-4b12-9f0c-ccf9a063d174 fwd="45.180.239.137" dyno= connect= service= status=503 bytes= protocol=http

Related

Trying to deploy a mern stack (Node JS) application on heroku (Getting error H10)

I am just starting with the MERN stack and Node JS to create a simple website - I published the project to github and tried to deploy on Heroku, the deployment is succesfuel; however, when I view the website it tells me
An error occurred in the application and your page could not be
served. If you are the application owner, check your logs for details.
You can do this from the Heroku CLI with the command heroku logs
--tail
After I checked the Heroku CLI, I got the following error:
npm ERR! /app/.npm/_logs/2020-10-14T20_29_22_623Z-debug.log
2020-10-14T20:29:24.764157+00:00 heroku[router]: at=error code=H10
desc="App crashed" method=GET path="/" host=seer-team-12.herokuapp.com
request_id=58a4c5ca-5517-423f-a41f-c7d54985c778 fwd="122.58.167.129"
dyno= connect= service= status=503 bytes= protocol=https
2020-10-14T20:29:25.246802+00:00 heroku[router]: at=error code=H10
desc="App crashed" method=GET path="/favicon.ico"
host=seer-team-12.herokuapp.com
request_id=ba173afb-208e-4073-80f0-99f6029545e5 fwd="122.58.167.129"
dyno= connect= service= status=503 bytes= protocol=https
I tired many solutions - making sure the PORT is process.env.PORT - and tried to make sure the Procfile is fine.
That is the the github application:
https://github.com/mentalist302/SEER
Thank you in advance :)

Heroku error code=H10 desc="App crashed" method=GET path="/" dyno= connect= service= status=503 bytes= protocol=https

I've been searching around on this one for a while and can't find anything that seems to be applicable in my situation. I've been staring at these logs and I can't see what the problem is.
I am trying to deploy my nodejs and react app to heroku but getting error again and again.
I have done heroku logs and I am getting these logs:
enter image description here

Heroku error code=H10

I keep getting error code=H10 randomly when I start my Heroku app. Sometimes the app starts, sometimes it doesn't.
My app is built with NodeJS, Express, MySQL and JawsDB.
Here's the details in my app's log:
2017-11-26T15:21:36.906937+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=<my app name>.herokuapp.com request_id=4c63d70d-f081-44a5-b4fe-f0992116ba79 fwd="108.28.184.177" dyno= connect= service= status=503 bytes= protocol=https
2017-11-26T15:21:36.954063+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/favicon.ico" host=<my app name>.herokuapp.com request_id=e42d6293-512f-4ea1-ba35-403f44e4fd9a fwd="108.28.184.177" dyno= connect= service= status=503 bytes= protocol=https
I've looked online and added favicon.ico in my public folder. Nothing changes. I've had this problem before with my previous app and I ran heroku restart and it works for that one, but doesn't for this one.

Heroku node.js Procfile for script not in root

My aim is to create a groupme bot using heroku and node.js https://github.com/whitec54/shouts-things
I'm pretty new to web development so maybe this is glaring but I can't seem to fix my heroku application error.
This is the message returned by the logs:
2016-07-26T01:44:52.756548+00:00 heroku[web.1]: State changed from crashed to starting
2016-07-26T01:44:53.848661+00:00 heroku[web.1]: Starting process with command `node routes/index.js`
2016-07-26T01:44:55.966222+00:00 heroku[web.1]: Process exited with status 0
2016-07-26T01:45:09.474760+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/favicon.ico" host=shouts-things.herokuapp.com request_id=19173085-e8ed-4a85-8cd9-90c96b7347f6 fwd="108.178.113.130" dyno= connect= service= status=503 bytes=
2016-07-26T01:45:08.701288+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=shouts-things.herokuapp.com request_id=f29fef93-7530-4c1e-9724-73884694b457 fwd="108.178.113.130" dyno= connect= service= status=503 bytes=
this error is seems better than what I started with but I'm not sure where to go from here. In spite of the reading I've done my understanding of how Procfiles work in heroku is pretty weak.
In your Procfile it has mentioned to start routes/index.js which doesn't have any code to run the express server. You should be having this route registered on app.js and start app.js with node.
express-generator npm will help you get started with the basic scaffolding required for a nodejs project.

Recurring Logentries crash notification on Heroku (NodeJS server)

I've running a NodeJS-based application server on Heroku, and this morning it started crashing repeatedly. It runs one traditional 1x dyno (i.e. the free tier). Heroku takes it down due to idleness, which is fine, but it then gets into a state where I get a crash notification from Logentries every few seconds indefinitely.
I can stop it by taking manually taking the server down to 0 dynos, and then back up to 1.
Note that the very first thing the server does is print a debugging message to console.log, so the fact that I'm not seeing that in the middle of all these crash messages suggests that my app isn't even being run.
Any idea what might be causing this?
02 <45>1 2015-12-05T21:03:30.039646+00:00 heroku web.1 - - Idling
125 <45>1 2015-12-05T21:03:30.040156+00:00 heroku web.1 - - State changed from up to down
131 <45>1 2015-12-05T21:03:34.298780+00:00 heroku web.1 - - Stopping all processes with SIGTERM
301 <158>1 2015-12-05T21:03:35.730386+00:00 heroku router - - at=info method=GET path="/" host=<server name redacted>.herokuapp.com request_id=e3c6cdbf-3012-4e5e-ab89-24e8c2eb0e03 fwd="50.0.151.247" dyno=web.1 connect=0ms service=2085875ms status=101 bytes=189
310 <158>1 2015-12-05T21:03:36.299732+00:00 heroku router - - at=error code=H10 desc="App crashed" method=GET path="/" host=<server name redacted>.herokuapp.com request_id=35c719d9-5153-49e8-a640-91f848f853b9 fwd="50.0.151.247" dyno= connect= service= status=503 bytes=
310 <158>1 2015-12-05T21:03:36.730513+00:00 heroku router - - at=error code=H10 desc="App crashed" method=GET path="/" host=<server name redacted>.herokuapp.com request_id=138f048e-4229-4e9f-9e56-8d0d9e691734 fwd="50.0.151.247" dyno= connect= service= status=503 bytes=
126 <45>1 2015-12-05T21:03:36.690366+00:00 heroku web.1 - - Process exited with status 143
310 <158>1 2015-12-05T21:03:40.160167+00:00 heroku router - - at=error code=H10 desc="App crashed" method=GET path="/" host=<server name redacted>.herokuapp.com request_id=0a451a1b-04f2-4f59-bc1e-abc1f2599607 fwd="50.0.151.247" dyno= connect= service= status=503 bytes=
310 <158>1 2015-12-05T21:03:40.586679+00:00 heroku router - - at=error code=H10 desc="App crashed" method=GET path="/" host=<server name redacted>.herokuapp.com request_id=c7681cce-f486-447b-9f76-b36a8db3570b fwd="50.0.151.247" dyno= connect= service= status=503 bytes=
310 <158>1 2015-12-05T21:03:44.024709+00:00 heroku router - - at=error code=H10 desc="App crashed" method=GET path="/" host=<server name redacted>.herokuapp.com request_id=ddd8187f-c8c7-45aa-8add-863b17bdfc5f fwd="50.0.151.247" dyno= connect= service= status=503 bytes=
It turned out that the version of node I was using (4.2.1) was attempting to use more than the 512MB of memory available on a traditional 1x dyno (this is why Node kept crashing before it executed even the first line of my server code). The solution was to modify the Procfile to cap Node's memory usage to fit into the available memory. The Procfile now looks like so:
web: node --optimize_for_size --max_old_space_size=500 --gc_interval=100 server.js
(note that it's 500 rather than 512 out of my habitual desire to be a wee bit conservative).

Resources