My discord.py-rewrite bot is currently being hosted on heroku. It's been fine for these past few weeks until heroku started going haywire just a few hours ago. Why is this happening?
This is the full error
2020-08-26T22:31:28.999683+00:00 heroku[worker.1]: Relocating dyno to a new server
2020-08-26T22:31:29.006086+00:00 heroku[worker.1]: State changed from up to down
2020-08-26T22:31:29.008558+00:00 heroku[worker.1]: State changed from down to starting
2020-08-26T22:31:42.288485+00:00 heroku[worker.1]: Starting process with command `python skybot.py.py`
2020-08-26T22:31:42.917236+00:00 heroku[worker.1]: State changed from starting to up
2020-08-26T22:31:51.626938+00:00 app[worker.1]: Signed In
2020-08-26T22:32:16.991403+00:00 heroku[worker.1]: Stopping all processes with SIGTERM
2020-08-26T22:32:20.126043+00:00 heroku[worker.1]: Process exited with status 0
2020-08-27T03:16:41.956314+00:00 heroku[worker.1]: Stopping all processes with SIGTERM
2020-08-27T03:16:42.134827+00:00 heroku[worker.1]: Process exited with status 0
Have I ran out of hours already? Or is this just some common bug in the heroku deployment system. I never made any changes to the script btw. This just happened out of the blue.
Related
I'm deploying torchserve on heroku free dyno. Deploy works fine but the app isn't running properly.
LOG1:
2022-03-17T02:11:10.352655+00:00 heroku[web.1]: Starting process with command `torchserve --start --ncs --model-store model_store --models squeezenet1_1.mar`
2022-03-17T02:11:11.558957+00:00 app[web.1]: Setting JAVA_TOOL_OPTIONS defaults based on dyno size. Custom settings will override them.
2022-03-17T02:11:11.701395+00:00 app[web.1]: Picked up JAVA_TOOL_OPTIONS: -Xmx300m -Xss512k -XX:CICompilerCount=2 -Dfile.encoding=UTF-8
2022-03-17T02:11:11.896962+00:00 heroku[web.1]: Process exited with status 0
2022-03-17T02:11:12.059922+00:00 heroku[web.1]: State changed from starting to crashed
LOG2:
2022-03-17T05:17:29.472219+00:00 heroku[web.1]: Starting process with command `torchserve --start --ncs --model-store model_store --models squeezenet1_1.mar`
2022-03-17T05:17:30.854303+00:00 app[web.1]: Setting JAVA_TOOL_OPTIONS defaults based on dyno size. Custom settings will override them.
2022-03-17T05:17:31.304897+00:00 heroku[web.1]: Process exited with status 0
2022-03-17T05:17:31.364160+00:00 heroku[web.1]: State changed from starting to crashed
Also, my requirements.txt:
-f https://download.pytorch.org/whl/cpu/torch_stable.html
future
psutil
requests
captum
packaging
numpy
cython
wheel
pillow==9.0.1
torch==1.10.0+cpu
torchvision==0.11.1+cpu
torchaudio==0.10.0+cpu
torchtext==0.11.0
torchserve==0.5.3
runtime.txt
python-3.8.12
system.properties
java.runtime.version=1.8.0_322
Problem was torchserve was running in background mode by default.
Adding --foreground to the torchserve command in Procfile fixed this.
(Also, java runtime 11.0.14.1 is required by torchserve)
It used to work fine so far both in heroku and locally. Now it only works locally but doesn't work aftter deploying on heroku. This is the log from Heroku:
2021-04-22T17:41:34.000000+00:00 app[api]: Build succeeded
2021-04-22T17:41:37.853181+00:00 heroku[worker.1]: Starting process with command `python3.9.4 dbot.py`
2021-04-22T17:41:38.485331+00:00 heroku[worker.1]: State changed from starting to up
2021-04-22T17:41:39.356992+00:00 app[worker.1]: bash: python3.9.4: command not found
2021-04-22T17:41:39.416346+00:00 heroku[worker.1]: Process exited with status 127
2021-04-22T17:41:39.485205+00:00 heroku[worker.1]: State changed from up to crashed
I have my requirments.txt file with these dependencies included:
git+https://github.com/Rapptz/discord.py
youtube_dl==2020.03.08
pynacl == 1.3.0
colorlog == 4.1.0
And I have this in my procfile:
worker: python3.9.4 dbot.py
As for my knowledge I think it has something do with the python version which I recently updated to 3.9.4
Instead of putting the version of python into the Procfile simply put:
worker: python dbot.py
If you want to specify a python version for your bot create a runtime.txt file with the following format
python-3.9.4
so i am hosting my discord bot in heroku for free (ik it's not good but i can't offer to pay money rn)
so yesterday my bot was working as good as ever and when i woke up today i got an approved message from Discord bot list and after that my bot started going online and offline continuously so i restarted all dynos and i got this in the logs
Restarting
2020-07-19T15:48:44.371670+00:00 heroku[worker.1]: State changed from up to starting
2020-07-19T15:48:45.296606+00:00 heroku[worker.1]: Stopping all processes with SIGTERM
2020-07-19T15:48:45.677248+00:00 app[worker.1]: sys:1: RuntimeWarning: coroutine 'Command.__call__' was never awaited
2020-07-19T15:48:46.013782+00:00 heroku[worker.1]: Process exited with status 0
2020-07-19T15:48:49.175960+00:00 heroku[worker.1]: Starting process with command `python Yam-Yam.py`
2020-07-19T15:48:49.836878+00:00 heroku[worker.1]: State changed from starting to up
2020-07-19T15:53:23.090024+00:00 heroku[worker.1]: Restarting
2020-07-19T15:53:23.103443+00:00 heroku[worker.1]: State changed from up to starting
2020-07-19T15:53:24.363803+00:00 heroku[worker.1]: Stopping all processes with SIGTERM
can you please tell me why did this happen and how to fix it
I readed a lot of questions here in stackoverflow, but I cannot solve my problem.
I have a simples python script (Only a print('Hello World')) and I'm sending it to Heroku, my files are:
Procfile: (I believe the problem is here)
web: python index.py
heroku logs --tail
2020-05-06T16:06:38.000000+00:00 app[api]: Build started by user <myemail>
2020-05-06T16:07:00.948412+00:00 heroku[web.1]: State changed from crashed to starting
2020-05-06T16:07:00.572714+00:00 app[api]: Release v11 created by user <myemail>
2020-05-06T16:07:00.572714+00:00 app[api]: Deploy 4053de7f by user <myemail>
2020-05-06T16:07:07.099124+00:00 heroku[web.1]: State changed from starting to crashed
2020-05-06T16:07:07.103524+00:00 heroku[web.1]: State changed from crashed to starting
2020-05-06T16:07:07.002972+00:00 app[web.1]: Hello World
2020-05-06T16:07:08.000000+00:00 app[api]: Build succeeded
2020-05-06T16:07:13.797877+00:00 heroku[web.1]: State changed from starting to crashed
2020-05-06T16:07:13.619779+00:00 app[web.1]: Hello World
heroku ts
Free dyno hours quota remaining this month: 550h 0m (100%)
For more information on dyno sleeping and how to upgrade, see:
https://devcenter.heroku.com/articles/dyno-sleeping
=== web (Free): python index.py (1)
web.1: crashed 2020/05/06 13:07:13 -0300 (~ 4m ago)
How we can see, the "Hello World" in log shows that the script runs when I send it to server. But after it, the dyno crashes
in case of Web dyno the application must bind to the port provided by Heroku and defined in the $PORT env variable, where it will receive the incoming requests.
If you need to HTTP traffic try to create a worker node
For example to create a simple Flask app which can receive requests:
from flask import Flask
import os
import logging
try:
app = Flask(__name__)
except Exception as e:
logging.exception("Error at startup")
#app.route('/test')
def test():
logging.info('/test')
return "test Ok"
if __name__ == '__main__':
app.run(debug=False, port=int(os.environ.get("PORT", 5000)), host='0.0.0.0')
Port is set using $PORT on Heroku while locally defaults to 5000
I'm a beginner with discord bot on Python and I'd like to host one on Heroku's free tier. Just a simple one, so I can upgrade to something more complex afterwards.
So I upload this from Github and create the app (I don't use the discord_bot part at the moment). The build finishes without an error, but when I start the application it crashes and i get this log :
2018-09-22T21:37:30.267582+00:00 heroku[worker.1]: Starting process with command `: python3 test_discord.py`
2018-09-22T21:37:31.001035+00:00 heroku[worker.1]: State changed from starting to up
2018-09-22T21:37:32.859278+00:00 heroku[worker.1]: Process exited with status 0
2018-09-22T21:37:32.877853+00:00 heroku[worker.1]: State changed from up to crashed
And... That's all. No error number, no detailed log, nothing i can look for in the heroku documentation.
The most intriguing part is the "status 0". Because from what I've learned looking on stack overflow, this means that everything is... fine !?
So I'm a little lost right here.
This part of the log file looks suspicious
Starting process with command `: python3 test_discord.py`
^^
The colon shouldn't be part of the command.
The reason for that colon is your Procfile, it has a surplus space:
worker : python3 testdiscord.py
^
It needs to be:
worker: python3 testdiscord.py
The exit code is 0 because a colon in shell does nothing and always returns with status 0.