1

I have a docker ubuntu container with a python script inside which dies under certain conditions. I have deployed it as a one-off dyno. I have scheduled it with heroku scheduler to run twice a day. I tried every possible way to stop a python script: Normal ways, sys.exit, quit(), whatever. No matter how gracefully I terminate it, heroku says "State changed from up to crashed" and try to restart the dyno continuosly. From what I read this is wanted, and it will try to run the dyno continuosly, for a certain amount of times, then it gives it a cooldown and retries. The cooldown gradually increases.

Now this is ridiculous. One-off are supposed to serve one-shot scripts that do a certain job, then shut off when finished.

How I avoid this continuous unwanted restart? Is there a precise way to terminate the script and let heroky see I ended it and not "crashed"?

Note: I tried also to end it normally like just let if finish execute

I also tried a simple script with 2 prints in it and nothing else. If executed locally, it would just print them and close the script normally, but on the one-off heroku it says it crashed. I said it to underline the fact that even the simplest script "crashes". Should it be a worker? Am I doing something wrong?

0 Answers0