So I was fooling around the slack API and ended up making a simple slack bot which posts on a slack channel whether a site is up or not (when provided with the URL)
Whenever I deploy it to heroku, it works for the first 60 seconds and then throws an error like this in the logs
2016-06-22T20:18:11.933928+00:00 heroku[web.1]: State changed from crashed to starting
2016-06-22T20:18:15.635404+00:00 heroku[web.1]: Starting process with command `python margo/margo.py 5000`
2016-06-22T20:18:18.724727+00:00 app[web.1]: StarterBot connected and running!
2016-06-22T20:19:15.714485+00:00 heroku[web.1]: Stopping process with SIGKILL
2016-06-22T20:19:15.714485+00:00 heroku[web.1]: Error R10 (Boot timeout) -> Web process failed to bind to $PORT within 60 seconds of launch
2016-06-22T20:19:16.857081+00:00 heroku[web.1]: Process exited with status 137
2016-06-22T20:19:16.874584+00:00 heroku[web.1]: State changed from starting to crashed
My Procfile
looks something like this
web: python margo/margo.py 5000
I searched around and found this and this saying that the PORT
should be specified at the Profile
and I changed it like the above in the Procfile
. But mine is just a simple python script and not a full blown Flask
/Django
app.
Any ideas guys where am I going wrong?
EDIT
I read up that the $PORT
environment variable is set by heroku. So my Procfile
is now
web: python margo/margo.py $PORT
But the program crashes again with the same error message when deployed