App keeps pausing

I hope you are doing well. I recently deployed my bot to fly.io and have been facing a lot of issues. The bots purpose is to post an image to Twitter, sleep for an hour, and keep repeating that cycle. It works completely fine when I run it in my python IDE however whenever I deploy it with Fly it runs once and pauses. I have checked the logs and it appears to be a “keyboard interruption” I’m not sure how to fix this and I would appreciate your assistance regarding this matter.

Hi,

This sounds like the default behavior: if there isn’t any inbound traffic for a short while, the Fly proxy stops your VM, and it boots it again when traffic comes in. Since it’s a bot it probably doesn’t get any inbound traffic, and so it just gets stopped and never starts again.

“Keyboard interruption” is how Python reports a SIGINT which is the signal the proxy sends to processes before terminating the VM, to give them a chance to exit gracefully.

You can prevent this and keep your VM up at all times by setting this in your fly.toml:

auto_stop_machines=false
auto_start_machines=false

Learn more about this here:

  • Daniel
2 Likes

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.