Why my Discord Bot keeps crashing in heroku? - heroku

I uploaded my bot, made in Node.js to github and it's connected to heroku. When I deploy it it starts and it works but after 2 or 3 minutes it crashes and stops with:
heroku[web.1]: State changed from starting to crashed
I already tested heroku logs but it doesn't show anything more helpful.
What is wrong?

did you put a Procfile file containing :
worker: node index.js
replacing index with the name of your main file.

Hi there you can fix this issue by clearing the cache of the discord. Other solution to issue is mentioned here check

Related

Heroku app shows up for a while and then gives `Application error`

I have created a MERN app and deployed it on Heroku But it works for a while and then gives Application error. However, the code is fine and on the localhost both the frontend and the backend with MongoDB work perfectly fine and are up and running. I have tried everything I found on the internet. Here's the list of things I've done:
Added the config vars on Heroku (in case someone thinks I forgot that)
Checked the Procfile whether there's any space error
Checked the package.json files and scripts
Tried to update the node_modules and restart Heroku
Made commits and tried to push on Heroku multiple times hoping it was a temporary error
But nothing seems to be working and it's still giving H10 errors. What can I try next?

Trying to Host my discord bot on heroku But I can't get The worker . Please Tell me how to fix this and where

Hello So I made my discord bot Bolt and tryed to host it on heroku
1.I used to host a simple bot before on herkou and it used to work fine
2.Now If I try I don't get the option to make the dyno to worker
Please tell me how to fix this and where
I do not fully understand your question but it seems like you want the bot to run as worker. If that is the case then you can make a file named Procfile in your bot's directory and add something like this inside it:
worker: node index.js

How can I see when a Heroku app was deleted?

One of our test apps got deleted recently. We're trying to track down how/why (suspicion is an error in an API call that we've made). Is there a way to get any logs from Heroku that shows who/when/how an app was deleted?

Heroku | Change app to a worker app rather than web

I'm using Heroku Scheduler to run a few apps each night. I believe they are what Heroku would call a "worker apps" because they run for about 2 hours each and only need to run once per day. That said, I can't figure out how to change them from being web apps to worker apps?
For context, I'm using the free tier of Heroku.
You need to create a file called Procfile in your root.
Found the answer here: https://stackoverflow.com/a/44122238/12020295
So, change your Procfile to read (with your specific command filled in):
worker: node index.js
and then also run on CLI:
$ heroku scale worker=1

Critical Caching issue in Laravel Application (AWS Server)

I am facing a critical issue in my application, it is developed in Laravel and Angular. The issue is I am getting the old email templates on live site and on local server I am getting the latest updated one. The process to deloy the code is automatic, I just to commit the code in BitBucket and after that Bitbucket Pipleline push the code to AWS server directly.
I have already run the cache cammands for Laravel and restarted the jobs but still i am getting the same issue. If anyone have expirienced the same issue or have knowledge of the same to resolve, Please guide!
I think you can try one of the following ways to overcome the issue, I faced a similar issue and resolved it by following ways -
Try deleting the cache files manually from Laravel from storage/framework/views
Upload the code directly into AWS for particular module without using the pipeline way
restart your server
This will surely resolve your issue!
Since you are using Laravel and angular application deployed on AWS,
I assume that bit bucket is pushing code and build commands are fired on every push
there are few things which can help you.
Try to build the angular side on every push, since angular builds hashes all the files in the dist folder
Try to delete the Laravel cached files which are stored in storage/framework/views
Check that on that your server is pointing to the right project folder
If any of the points from 1 or 2 works you can automate the process by passing CLI command after every push,
Point 1 and 2 are achievable by passing CLI commands.

Resources