Heroku Discord Bot is offline - node.js

I'm hosting a discord chat bot on heroku, and suddenly it went offline. I am new to hosting on heroku, so i don't understand a lot, but, i tried simple things like deploying a branch again (im connected to github), and that wouldn't work.
Edit:
Here is the log:
Before i click open app:
2018-07-23T16:54:27.265702+00:00 app[worker.1]: at Function.Module._load (module.js:497:3)
2018-07-23T16:54:27.265704+00:00 app[worker.1]: at Function.Module.runMain (module.js:693:10)
2018-07-23T16:54:27.265705+00:00 app[worker.1]: at startup (bootstrap_node.js:191:16)
2018-07-23T16:54:27.265707+00:00 app[worker.1]: at bootstrap_node.js:612:3
2018-07-23T16:54:27.327613+00:00 heroku[worker.1]: State changed from up to crashed
2018-07-23T16:54:27.310511+00:00 heroku[worker.1]: Process exited with status 1
After clicking Open App:
2018-07-23T16:58:44.866697+00:00 heroku[router]: at=error code=H14 desc="No web processes running" method=GET path="/" host=cratefield.herokuapp.com request_id=b32a5f7d-157e-45a5-805b-8c306140d020 fwd="73.23.238.216" dyno= connect= service= status=503 bytes= protocol=https
2018-07-23T16:58:45.502353+00:00 heroku[router]: at=error code=H14 desc="No web processes running" method=GET path="/favicon.ico" host=cratefield.herokuapp.com request_id=19e6fc48-37ed-48db-87f9-759d704ddb3e fwd="73.23.238.216" dyno= connect= service= status=503 bytes= protocol=https
2018-07-23T16:58:45.552383+00:00 heroku[router]: at=error code=H14 desc="No web processes running" method=GET path="/favicon.ico" host=cratefield.herokuapp.com request_id=bba2456f-50bc-4dbb-bee2-50b36a8caef5 fwd="73.23.238.216" dyno= connect= service= status=503 bytes= protocol=https
2018-07-23T17:01:47.069331+00:00 heroku[router]: at=error code=H14 desc="No web processes running" method=GET path="/" host=cratefield.herokuapp.com request_id=9a098d43-bc46-403a-9ed3-5b701cd720ac fwd="73.23.238.216" dyno= connect= service= status=503 bytes= protocol=https

That happens because you're using a web dyno: a dyno that is put asleep if the application doesn't serve a website for more than 1 hour.
The solution is to switch from a web dyno to a worker dyno: this type does not serve websites (and if you're running a Discord bot you don't need it) and never goes to sleep.
Go in your Procfile file & replace web with worker, it should look like this:
worker: npm start //this is the command you use to start your app.
If you want you can take a look at the Heroku article about sleeping apps.

I know it's one year late but for those who are still having this issue, you have a limit of 550 hours per month (about 22 days) to host your bot with the free plan (paid plans get no run time limit)
This might be the problem, you can check your notifications on heroku to find out.

The problem with your bot is that Heroku's free plan makes your application to sleep after 30 minutes of inactivity. The solution would be to select a paid plan to be sure that your bot remains active at all times.

Related

What is the reason behind error h14 "No web processes running" and Application error?

I made this project and deployed it on Heroku successfully and it was working, I checked it again two months and it was working properly, but today when I tried to open the website link it says Application error.
Logs are as follows:
2022-12-06T08:17:30.897980+00:00 heroku[router]: at=error code=H14 desc="No web processes running" method=GET path="/" host=limitless-shelf-83830.herokuapp.com request_id=d0c862ec-c21d-4e94-94e5-f6fed3d71af6 fwd="103.141.116.193" dyno= connect= service= status=503 bytes= protocol=https
2022-12-06T08:17:31.345120+00:00 heroku[router]: at=error code=H14 desc="No web processes running" method=GET path="/favicon.ico" host=limitless-shelf-83830.herokuapp.com request_id=a98c5850-0aa3-413d-94d9-4480a218ec3d fwd="103.141.116.193" dyno= connect= service= status=503 bytes= protocol=https
Is this issue from my side or heroku servers are down? What is the cause of this error and what are possible solutions?
I tried running
heroku ps:scale web=1
but it had no use.
Edit: I found the issue, Heroku has stopped offering free plans from 28th Nov 2022, and I deployed it free server.
As you mentioned, Heroku no longer provides free dyno plans.
Although if you have previously deployed apps, you can still access them after subscribing to one of their plans. If you are still experiencing an H14 error, try to reconfigure your dyno. Just change your dyno type to the subscribed plan and make sure you have toggle the selected dyno to the right in order to enable it.

App deployed on Heroku crashes randomly after hours running perfectly

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

Flask App not Working After Build Succeed

Flask App works fine locally and even succeeded Build.
I just can't understand this error.
Logs:
2021-07-18T10:28:35.000000+00:00 app[api]: Build succeeded
2021-07-18T10:28:42.023914+00:00 heroku[router]: at=error code=H14 desc="No web processes running" method=GET path="/" host=appname.herokuapp.com request_id=24g1h015-2591-4c3e-9887-c6767d50ec51 fwd="116.88.77.105" dyno= connect= service= status=503 bytes= protocol=https
2021-07-18T10:28:42.464216+00:00 heroku[router]: at=error code=H14 desc="No web processes running" method=GET path="/favicon.ico" host=appname.herokuapp.com request_id=50f62645-ac6e-487a-2491-985f9ad6b329 fwd="116.88.77.105" dyno= connect= service= status=503 bytes= protocol=https
You have to open the heroku client and type:
heroku ps:scale web=1
to enable the web dynos.
Or instead declare a procfile in your root directory:
web: gunicorn gettingstarted.wsgi
See more here

State changed from up to crashed in Heroku

I am getting the following error on Heroku logs:
2018-10-29T00:48:34.198959+00:00 heroku[reminder.1]: State changed from up to crashed
2018-10-29T00:48:59.855673+00:00 heroku[router]: at=error code=H14 desc="No web processes running" method=GET path="/" host=promo-reminder.herokuapp.com request_id=253b5e26-384e-4b02-b65c-51342fb46a4e fwd="73.162.11.10" dyno= connect= service= status=503 bytes= protocol=https
2018-10-29T00:49:01.143244+00:00 heroku[router]: at=error code=H14 desc="No web processes running" method=GET path="/favicon.ico" host=promo-reminder.herokuapp.com request_id=b1b8cb23-01d8-4f59-ac42-a98f28cb9c10 fwd="73.162.11.10" dyno= connect= service= status=503 bytes= protocol=https
2018-10-29T00:56:23.879027+00:00 heroku[router]: at=error code=H14 desc="No web processes running" method=GET path="/" host=promo-reminder.herokuapp.com request_id=00c30077-8e31-4fea-a700-f7fffd45e446 fwd="73.162.11.10" dyno= connect= service= status=503 bytes= protocol=https
2018-10-29T00:56:25.162371+00:00 heroku[router]: at=error code=H14 desc="No web processes running" method=GET path="/favicon.ico" host=promo-reminder.herokuapp.com request_id=1684c085-7c4a-4f90-beed-a6667c60ab88 fwd="73.162.11.10" dyno= connect= service= status=503 bytes= protocol=https
my Procfile is:
reminder: python src/quickstart.py
Heroku web page shows:
Application 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
Only the web process type on Heroku will allow you to receive HTTP requests.
You need to replace your Procfile:
reminder: python src/quickstart.py
Then, start a web dyno:
heroku ps:scale web=1
See https://devcenter.heroku.com/articles/dynos#dyno-configurations

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