Heroku deployment error: at=error code=H10 desc="App crashed" - node.js

I am trying to deploy my AngularJS Yeoman Generator-AngularFire Node Express app to Heroku. I am able to push to Heroku successfully as it shows
Fetching repository, done.
Everything up-to-date
when I git push heroku master
(Not completely sure if this means it is failsafe, tip to check another way would be much appreciated). When I run the command heroku open my web page shows
Application Error
An error occurred in the application and your page could not be served. Please try again in a few moments.
If you are the application owner, check your logs for details.
I ran the command heroku logs I get these errors:
2014-09-27T21:25:11.216896+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=mayapp.herokuapp.com request_id=6921ca4b-13de-4194-858f-0132a0d36192 fwd="70.166.121.220" dyno= connect= service= status=503 bytes=
2014-09-27T21:25:11.712742+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/favicon.ico" host=myapp.herokuapp.com request_id=6e6dde3a-ca2a-4650-95c0-c4ad68d7f597 fwd="70.166.121.220" dyno= connect= service= status=503 bytes=
Here are my routes in my routes.js
config(['$routeProvider', function($routeProvider) {
$routeProvider
.when('/', {
templateUrl: 'views/main.html',
controller: 'MainCtrl'
})
.when('/login', {
templateUrl: 'views/login.html',
controller: 'LoginCtrl'
})
.otherwise({redirectTo: '/'});
}])
How do I get passed this issue and successfully deploy?

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 deployment with code=H10 desc="App crashed"

i receive this error following after i deploy the nodejs server in heroku
2020-09-21T07:29:21.142276+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" ......
2020-09-21T07:29:21.697275+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/favicon.ico" .......
I have added the engines{node,npm} in my package.json, and added MONGO_URI key in Config Vars in heroku dashboard since i use mongodv as my database. But i cannot open my website, it shows Application error.
Go to your Heroku CLI and deploy the application again. Sometimes, when an invalid or a loophole is accessed, the application crashes. So, I suggest you to find the problem, fix it and deploy it back again.

Error while deploying project in heroku with error code=H10 desc = "App crashed"

After trying to fix the below error for many days, I decided to post the error, hoping that someone can help me to figure it out.
Note: I added a link to my git repository as well.
Here is the error of my log:
2020-05-04T17:42:26.314508+00:00 heroku[router]: at=error code=H10
desc="App crashed" method=GET path="/"
host=cactus-restaurant.herokuapp.com
request_id=202dfecf-cfb0-4349-bd51-101b4f481ace fwd="91.139.187.213"
dyno= connect= service= status=503 bytes= protocol=https
github : https://github.com/Teodora321/Cactus-Restaurant

Why Heroku app crashes following H10 and how to spot the problem?

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.

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.

Resources