I am deploying an app to node.js mongodb-Atlas hosted Heroku app and after deploying it, it started to crash. here is the log of the incident:
2019-11-07T14:03:44.54763+00:00 app[web.1]:
2019-11-07T14:03:44.547905+00:00 app[web.1]: npm ERR! A complete log of this run can be found in:
2019-11-07T14:03:44.548078+00:00 app[web.1]: npm ERR! /app/.npm/_logs/2019-11-07T14_03_43_920Z-debug.log
2019-11-07T14:03:44.609666+00:00 heroku[web.1]: Process exited with status 1
2019-11-07T14:03:44.660116+00:00 heroku[web.1]: State changed from starting to crashed
2019-11-07T14:08:46.771752+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=flix-app-test.herokuapp.com request_id=14978e4f-fb93-44c8-a6c1-294a6a254e1e fwd="84.17.61.226" dyno= connect= service= status=503 bytes= protocol=https
2019-11-07T14:08:47.381666+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/favicon.ico" host=flix-app-test.herokuapp.com request_id=b067c4c5-8b09-44c7-907e-bb2010dd97ec fwd="84.17.61.226" dyno= connect= service= status=503 bytes= protocol=https
2019-11-07T14:15:51.61258+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=flix-app-test.herokuapp.com request_id=5290a4ea-94b1-4d79-a8fe-6709e6cb2a15 fwd="91.168.132.252" dyno= connect= service= status=503 bytes= protocol=https
2019-11-07T14:15:52.254787+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/favicon.ico" host=flix-app-test.herokuapp.com request_id=41f76767-00c8-490c-9c13-22c0906fedb9 fwd="91.168.132.252" dyno= connect= service= status=503 bytes= protocol=https
Most posts I found regarding this H10 error point to an issue on the lines that define the port which through Heroku listens, that it does not accept a rigid one, but the listening of the app is done by this code:
var port = process.env.PORT || 3000;
app.listen(port, "0.0.0.0", function() {
console.log('Listening on Heroku defined port');
});
The code is working locally (double checked), but the Heroku app does not even loads. Databases are running and available and I could find no visible problem.
I'd like to know how should I proceed to find out which part of the code is broken OR to find out that it's a Heroku temporarily issue.
Thanks in advance.
If you are using ExpressJS, just do:
var port = process.env.PORT;
Promise.resolve(app.listen(port)).then(() => {
console.log("Running!");
});
Anyways, 503 is Service Unavailable HTTP code. If the above code does not work, please post your router and controller code for the errored routes.
Related
I have deployed my webpage on Heroku, with MongoAtlas for hosting database. The site has been deployed successfully, but on opening the URL it shows the following error.
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
The logs show this
2020-06-10T10:31:25.558083+00:00 heroku[web.1]: Stopping process with SIGKILL
2020-06-10T10:31:25.676299+00:00 heroku[web.1]: Process exited with status 137
2020-06-10T10:31:25.723593+00:00 heroku[web.1]: State changed from starting to crashed
2020-06-11T04:42:15.117508+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=immense-harbor-74512.herokuapp.com request_id=cd4e6bba-2b33-447a-9b73-da66c77c4946 fwd=
"47.9.8.24" dyno= connect= service= status=503 bytes= protocol=https
2020-06-11T04:42:15.971379+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/favicon.ico" host=immense-harbor-74512.herokuapp.com request_id=b5b1c208-bd9e-48b3-9c96-d8b79a
af9123 fwd="47.9.8.24" dyno= connect= service= status=503 bytes= protocol=https
2020-06-11T04:42:37.965020+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=immense-harbor-74512.herokuapp.com request_id=52f3dcab-4f12-41cd-96dd-12856fbfb240 fwd=
"47.9.8.24" dyno= connect= service= status=503 bytes= protocol=https
What is the problem and how to solve it
I'm running a React.js/Node.js application on heroku. I have been successfully deploying for a while but after changing the code base yesterday The build is successful and I get an application error. Specigically what I changed in the code base was switching back from SASS to CSS na dadding OAuth to my nodemailer functionality.
I have checked all the environment variables and my port is set to process.env.PORT || 8080
2020-04-23T18:00:39.000000+00:00 app[api]: Build started by user mlisonek98#gmail.com
2020-04-23T18:01:29.044301+00:00 heroku[web.1]: State changed from crashed to starting
2020-04-23T18:01:28.000000+00:00 app[api]: Build succeeded
2020-04-23T18:01:28.310226+00:00 app[api]: Release v109 created by user mlisonek98#gmail.com
2020-04-23T18:01:28.310226+00:00 app[api]: Deploy 8bb6c992 by user mlisonek98#gmail.com
2020-04-23T18:01:36.276828+00:00 app[web.1]:
2020-04-23T18:01:36.276853+00:00 app[web.1]: > badgrey#1.0.0 start /app
2020-04-23T18:01:36.276854+00:00 app[web.1]: > node server
2020-04-23T18:01:36.276854+00:00 app[web.1]:
2020-04-23T18:01:36.971835+00:00 app[web.1]:
2020-04-23T18:02:34.074965+00:00 heroku[web.1]: State changed from starting to crashed
2020-04-23T18:02:35.428955+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=badgrey-dev.herokuapp.com request_id=a08398b4-fa84-4b9c-9365-af9a5f357652 fwd="108.46.200.18" dyno= connect= service= status=503 bytes= protocol=https
2020-04-23T18:02:35.774613+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/favicon.ico" host=badgrey-dev.herokuapp.com request_id=d6bea10e-304f-4b1b-be04-33815ffb6c26 fwd="108.46.200.18" dyno= connect= service= status=503 bytes= protocol=https
2020-04-23T18:02:37.499473+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=badgrey-dev.herokuapp.com request_id=405f4943-a154-47d4-8bb5-0699597e8649 fwd="108.46.200.18" dyno= connect= service= status=503 bytes= protocol=https
I get an h10 error, and there is no other information. This application is running on the heroku free tier. Any suggestions as to why this is happeneing? I would be glad to upoad more code but I'm not sure what I would, especially since everything works locally.
It was the node version, Node released version 14 yesterday or something.
I am trying to deploy my app (Node.js) on Heroku which uses a sqlite3 database, deployment is done but while running the app I am getting the following error:
2020-04-23T10:07:50.747074+00:00 app[web.1]: App started on port 5000
2020-04-23T10:07:50.748081+00:00 app[web.1]: Connected to the SQLite database.
2020-04-23T10:07:50.748081+00:00 app[web.1]: Connected to the SQLite database.
2020-04-23T10:08:48.280947+00:00 heroku[web.1]: State changed from starting to crashed
2020-04-23T10:08:52.004314+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=backendthemesdemo.herokuapp.com request_id=470f5cfb-58e4-4ab0-b666-14880d5c31a8 fwd="43.241.194.49" dyno= connect= service= status=503 bytes= protocol=https
2020-04-23T10:08:53.642688+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/favicon.ico" host=backendthemesdemo.herokuapp.com request_id=f2d12092-9809-463b-89c1-eb5fcd8b267f fwd="43.241.194.49" dyno= connect= service= status=503 bytes= protocol=https
2020-04-23T10:30:38.831607+00:00 heroku[web.1]: State changed from crashed to starting
I've tried everything I can think of and exhausted google searches. I've already ruled out the most common problems (ex: not using process.env.PORT in app.listen).
Here are the heroku logs:
2018-07-18T02:43:26.705491+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=limitless-river-42936.herokuapp.com request_id=78261d20-9656-4f24-9a50-6a8e90fe216f fwd="104.32.39.36" dyno= connect= service= status=503 bytes= protocol=https
2018-07-18T02:43:28.104845+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/favicon.ico" host=limitless-river-42936.herokuapp.com request_id=dab234a8-b9d7-4bbe-aa2b-36e6c4b2fcc9 fwd="104.32.39.36" dyno= connect= service= status=503 bytes= protocol=https
Disconnected from log stream. There may be events happening that you do not see here! Attempting to reconnect...
And here is the server.js file
Any help would be greatly appreciated!
It turns out the log files weren't showing all the errors for some reason -- there was a typo in one of my imports. :)
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.