So it was stopped by flyd a couple of days after the machine 91857293c74328 was created and started. But why?
I can’t see any errors in the logs. This project has been running for months as a v1 app, I doubt there’s anything wrong with the code that would have caused this.
The exit event indicates the VM shutdown on its own with exit code 0. It’s possible this machine was on a host that rebooted and we currently can’t easily detect if a machine stopped due to the host shutdown signal or some other reason. If the machine is meant to always be running, it’s a good practice to set a restart policy of “always” so flyd will restart the machine regardless of exit code.
So I did fly machines update 91857293c74328 to see if there were any options to set the restart policy and it automatically showed me these changes to the config:
The Machine restart policy isn’t yet a part of app-wide configuration. It will get there.
In the meantime, you don’t have to go all the way to the API: flyctl can do it with fly machine update. Unfortunately, yes, once you’ve scaled up, that currently means you have to run it on each Machine separately.