heroku Nodejs app not unidling after request - node.js

I have a nodejs app that runs on heroku and works fine until it idles(because im on the free plan). After it idles when I try to wake the app up it logs: "App Crashed". This issue is fixed by restarting the app using the cli: heroku restart. However this is not a working solution for the end user. I am using deploy through github and webpack, which I mention because those are the only differences from my other heroku apps which unidle just fine. Is there a way to have the request unidle the app?
Here are the logs:
2022-06-30T17:13:21.294071+00:00 heroku[web.1]: Idling
2022-06-30T17:13:21.308560+00:00 heroku[web.1]: State changed from up to down
2022-06-30T17:13:22.877570+00:00 heroku[web.1]: Stopping all processes with SIGTERM
2022-06-30T17:13:23.113129+00:00 heroku[web.1]: Process exited with status 143
2022-07-02T17:42:20.649030+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=fwpsg.herokuapp.com request_id=1f058e06-12e9-4210-a9bc-097ebdce811d fwd="73.247.37.113"
dyno= connect= service= status=503 bytes= protocol=https

Related

Heroku, Stopping all processes with SIGTERM, Process exited with status 143

My backend was hosted on heroku for more than a month and was working fine. Now, today when i opened my website it shows this error in heroku logs.
heroku logs
`` 2022-11-26T13:59:37.770793+00:00 heroku[web.1]: Unidling 2022-11-26T13:59:37.773849+00:00
` 2022-11-26T13:59:37.770793+00:00 heroku[web.1]: Unidling 2022-11-26T13:59:37.773849+00:00 heroku[web.1]: State changed from down to starting 2022-11-26T13:`your text`59:40.671794+00:00 heroku[web.1]: Starting process with command `npm start` `2022-11-26T13:59:43.453482+00:00 app\[web.1\]:\`
2022-11-26T13:59:43.453508+00:00 app\[web.1\]: \> server#1.0.0 start
2022-11-26T13:59:43.453508+00:00 app\[web.1\]: \> node index.js
2022-11-26T13:59:43.453509+00:00 app\[web.1\]:
2022-11-26T13:59:43.936570+00:00 app\[web.1\]: Server started successfully on port 28406
2022-11-26T13:59:44.394629+00:00 heroku\[web.1\]: State changed from starting to up
2022-11-26T13:59:45.969634+00:00 app\[web.1\]: MongoDB Connected: ac-rbrrtx1-shard-00-02.hnnmtja.mongodb.net
2022-11-26T13:59:47.331529+00:00 heroku\[router\]: at=info method=GET path="/todos" host=to-do.herokuapp.com request_id=498c9348-ac27-4d03-98c5-ed9650e5b6d3 fwd="74.125.215.152" dyno=web.1 connect=0ms service=2501ms status=200 bytes=770 protocol=https
2022-11-26T14:35:38.862987+00:00 heroku\[web.1\]: Idling
2022-11-26T14:35:38.864646+00:00 heroku\[web.1\]: State changed from up to down
2022-11-26T14:35:39.633081+00:00 heroku\[web.1\]: Stopping all processes with SIGTERM
2022-11-26T14:35:39.834323+00:00 heroku\[web.1\]: Process exited with status 143
2022-12-02T12:31:11.037127+00:00 app\[api\]: Scaled to web#0:Eco by user api-maintenance#heroku.com
2022-12-08T18:34:07.067959+00:00 heroku\[router\]: at=error code=H14 desc="No web processes running" method=GET path="/robots.txt" host=to-do.herokuapp.com request_id=c7c564c9-6334-4140-bf27-6b0750093c26 fwd="5.255.253.147" dyno= connect= service= status=503 bytes= protocol=https\`\`
`
First, I would like to confirm whether you are using free plan of Heroku or not. Because Heroku stopped its free plan starting from November-26-2022.
For further information:
https://make.wordpress.org/plugins/2022/09/13/heroku-free-tier-being-retired/
If you have a paid version then it's a problem associated with dynos as the error is giving code H14 (last line). This is most likely the result of scaling your web dynos down to 0 dynos. Scale up your dynos to fix it.
For more information visit Heroku error codes:
Heroku error codes

Running URL after Heroku Deployment displays application error

I've created the project on GoormIDE and am trying to deploy it using Heroku, however it is giving error as
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
I've tried running the application from Goorm itself and it is running without any error.
The Heroku logs say that
W 2020-06-04T13:40:13.026765+00:00 app[web.1]:
Server running at port 3000 2020-06-04T13:40:13.200053+00:00
app[web.1]: Connected 2020-06-04T13:41:09.692255+00:00 heroku[web.1]:
Error R10 (Boot timeout) -> Web process failed to bind to $PORT within
60 seconds of launch 2020-06-04T13:41:09.717907+00:00 heroku[web.1]:
Stopping process with SIGKILL 2020-06-04T13:41:09.833400+00:00
heroku[web.1]: Process exited with status 137
2020-06-04T13:41:09.879805+00:00 heroku[web.1]: State changed from
starting to crashed 2020-06-04T13:41:11.348533+00:00 heroku[router]:
at=error code=H10 desc="App crashed" method=GET path="/"
host=immense-harbor-74512.herokuapp.com
request_id=2bfa2066-edf0-4c28-bee0-b84522cae634 fwd= "27.60.111.103"
dyno= connect= service= status=503 bytes= protocol=httpsthen,
What is the problem and how to fix it
Procfile
web:guinicorn python app.py

Node.js app crashes on deploying to Heroku

I have a Node.js app which runs well locally, but when I deploy it on Heroku, it doesn't run.
I have deployed it from my Github repository.
Can some one try deploying the app from my repo and tell me what the cause of the problem is?
Git repository link-MyGallary
Logs:
2017-09-03T12:22:17.683830+00:00 heroku[web.1]: State changed from crashed to starting
2017-09-03T12:22:18.878329+00:00 heroku[web.1]: Starting process with command `: node run start`
2017-09-03T12:22:20.670131+00:00 heroku[web.1]: Process exited with status 0
2017-09-03T12:22:20.682348+00:00 heroku[web.1]: State changed from starting to crashed
2017-09-03T12:24:19.679927+00:00 heroku[web.1]: State changed from crashed to starting
2017-09-03T12:24:20.918678+00:00 heroku[web.1]: Starting process with command `: node run start`
2017-09-03T12:24:23.583966+00:00 heroku[web.1]: Process exited with status 0
2017-09-03T12:24:23.595826+00:00 heroku[web.1]: State changed from starting to crashed
Disconnected from log stream. There may be events happening that you do not see here! Attempting to reconnect...
2017-09-03T12:24:19.679927+00:00 heroku[web.1]: State changed from crashed to starting
2017-09-03T12:24:20.918678+00:00 heroku[web.1]: Starting process with command `: node run start`
2017-09-03T12:24:23.583966+00:00 heroku[web.1]: Process exited with status 0
2017-09-03T12:24:23.595826+00:00 heroku[web.1]: State changed from starting to crashed
2017-09-03T12:33:34.507063+00:00 heroku[web.1]: Process exited with status 0
2017-09-03T12:39:41.420058+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=mygallary.herokuapp.com request_id=10a1d1e0-5b5f-45f7-b65c-efdb8d6e9b3f fwd="106.51.243.120" dyno= connect= service= status=503 bytes= protocol=https
2017-09-03T12:39:42.764416+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/favicon.ico" host=mygallary.herokuapp.com request_id=5ff09ee3-26d7-44a6-8556-f4e5d19a0ce5 fwd="106.51.243.120" dyno= connect= service= status=503 bytes= protocol=https
Thanks in advance.
Try typing "heroku logs" on your terminal and share the logs here.
EDIT:
It's "npm run start" or "node startfile.js" Ex: "node app.js"
(can type only app without .js)

Application error message when trying to open heroku app

I'm new to nodejs and trying to deploy a simple word game to heroku. i followed the instruction on heroku website and everyting works until the last command "heroku open" and it opens a web browser with the following message:
"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."
The heroku logs shows:
2016-08-04T18:56:36.552635+00:00 heroku[api]: Enable Logplex by teamsky916#gmail .com
2016-08-04T18:56:36.552635+00:00 heroku[api]: Release v2 created by teamsky916#g mail.com
2016-08-04T18:58:34.328360+00:00 heroku[router]: at=info code=H81 desc="Blank ap p" method=GET path="/" host=build-word-game.herokuapp.com request_id=f238942c-ef aa-4011-b505-7e5f062221a3 fwd="107.77.75.83" dyno= connect= service= status=502 bytes=
2016-08-04T18:58:35.171645+00:00 heroku[router]: at=info code=H81 desc="Blank ap p" method=GET path="/favicon.ico" host=build-word-game.herokuapp.com request_id= a02c27ef-865c-48e3-91cd-bd6e29ca51e3 fwd="107.77.75.83" dyno= connect= service= status=502 bytes=
2016-08-04T19:26:43.069903+00:00 heroku[api]: Scale to web=1 by teamsky916#gmail .com
2016-08-04T19:26:43.070467+00:00 heroku[api]: Deploy 4725c48 by teamsky916#gmail .com
2016-08-04T19:26:43.070552+00:00 heroku[api]: Release v3 created by teamsky916#g mail.com
2016-08-04T19:26:43.473784+00:00 heroku[slug-compiler]: Slug compilation finishe d
2016-08-04T19:26:43.473765+00:00 heroku[slug-compiler]: Slug compilation started
2016-08-04T19:26:45.915539+00:00 heroku[web.1]: Starting process with command `n ode server.js`
2016-08-04T19:26:50.481084+00:00 app[web.1]: listening to port 3000!
2016-08-04T19:27:46.488886+00:00 heroku[web.1]: Error R10 (Boot timeout) -> Web process failed to bind to $PORT within 60 seconds of launch
2016-08-04T19:27:46.488886+00:00 heroku[web.1]: Stopping process with SIGKILL
2016-08-04T19:27:46.631684+00:00 heroku[web.1]: Process exited with status 137
2016-08-04T19:27:46.618404+00:00 heroku[web.1]: State changed from starting to c rashed
2016-08-04T19:27:46.619564+00:00 heroku[web.1]: State changed from crashed to st arting
2016-08-04T19:27:48.599634+00:00 heroku[web.1]: Starting process with command `n ode server.js`
2016-08-04T19:27:51.304417+00:00 app[web.1]: listening to port 3000!
2016-08-04T19:28:48.755864+00:00 heroku[web.1]: Error R10 (Boot timeout) -> Web process failed to bind to $PORT within 60 seconds of launch
2016-08-04T19:28:48.755938+00:00 heroku[web.1]: Stopping process with SIGKILL
2016-08-04T19:28:48.879934+00:00 heroku[web.1]: Process exited with status 137
2016-08-04T19:28:48.893371+00:00 heroku[web.1]: State changed from starting to c rashed
2016-08-04T19:31:31.210359+00:00 heroku[router]: at=error code=H10 desc="App cra shed" method=GET path="/" host=build-word-game.herokuapp.com request_id=e0536d30 -8590-453d-9a04-fb8a56eb6893 fwd="107.77.213.153" dyno= connect= service= status =503 bytes=
2016-08-04T19:31:32.552715+00:00 heroku[router]: at=error code=H10 desc="App cra shed" method=GET path="/favicon.ico" host=build-word-game.herokuapp.com request_ id=89bfb417-9793-4687-b400-72cc34d16ea8 fwd="107.77.213.153" dyno= connect= serv ice= status=503 bytes=
2016-08-04T19:53:16.445270+00:00 heroku[web.1]: State changed from crashed to st arting
2016-08-04T19:53:18.025971+00:00 heroku[web.1]: Starting process with command `n ode server.js`
2016-08-04T19:53:19.981109+00:00 app[web.1]: listening to port 3000!
2016-08-04T19:54:18.509309+00:00 heroku[web.1]: Stopping process with SIGKILL
2016-08-04T19:54:18.509204+00:00 heroku[web.1]: Error R10 (Boot timeout) -> Web process failed to bind to $PORT within 60 seconds of launch
2016-08-04T19:54:18.601875+00:00 heroku[web.1]: Process exited with status 137
2016-08-04T19:54:18.606261+00:00 heroku[web.1]: State changed from starting to c rashed
2016-08-04T19:59:58.452903+00:00 heroku[router]: at=error code=H10 desc="App cra shed" method=GET path="/" host=build-word-game.herokuapp.com request_id=450b80d9 -a366-4e0f-9426-ff89eac931fb fwd="107.77.213.153" dyno= connect= service= status =503 bytes=
2016-08-04T19:59:59.109794+00:00 heroku[router]: at=error code=H10 desc="App cra shed" method=GET path="/favicon.ico" host=build-word-game.herokuapp.com request_ id=1eecc47a-5334-4a38-bd8d-093a9164ead5 fwd="107.77.213.153" dyno= connect= serv ice= status=503 bytes=
2016-08-04T20:01:28.744667+00:00 heroku[router]: at=error code=H10 desc="App cra shed" method=GET path="/" host=build-word-game.herokuapp.com request_id=a2d52aea -d7fc-4f18-b023-50aa8e93587c fwd="107.77.213.153" dyno= connect= service= status =503 bytes=
2016-08-04T20:01:29.378063+00:00 heroku[router]: at=error code=H10 desc="App cra shed" method=GET path="/favicon.ico" host=build-word-game.herokuapp.com request_ id=8e62ab9c-50a3-43eb-9579-9c3d4a6c9d42 fwd="107.77.213.153" dyno= connect= serv ice= status=503 bytes=
I appreciate your help.
It looks like your Node application is not starting properly. This is likely due to you not binding your Node server to the correct port.
On Heroku, you must bind your Node server to a port number specified in the PORT environment variable. This is because Heroku magically handles routing for your requests, on a server with many other applications.
What you should do is modify your Node code so that it listens on port process.env.PORT.
Here's an example Express.js application that listens to the correct port, as an example:
var express = require('express');
var app = express();
app.listen(process.env.PORT);

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.

Resources