fly machines run command hangs forever

I’m deploying some user code using Fly machines. I’ve set the restart policy to “no” so that when the process crashes, it won’t restart. When the user’s container fails to get spun up (when there’s a bug in their code, for example), the fly machines run command hangs forever since the CLI waits for the machine to reach “started” state, and it never does; since restart was set to “no”, the process crashes and sets the state to “stopped.”

Can we make it so that the fly m run command will exit with an error if a machine moves from created to stopped state due to an error, instead of waiting around forever?

fly m run . -a 105349741723321386951-fly-machines-4-say-hello -t QCMUb_9WFgHAZkjd3lb6b1BjVV3eDtmBkeEgYF8Mrzo -c {"config":{"guest":{"cpu_kind":"shared","cpus":1,"memory_mb":256},"restart":{"policy":"no"}}}

1 Like


It looks like you’re using the -c flag in the machine run command incorrectly. That flag assumes a path to an application configuration file not a json blob, so your restart policy is not being read. You raise a valid point though and I think the cli should accept a json config similar to the machines api. Also, for any incorrect use of the cli, we should send clearer error messages. We’ll get some fixes out for this soon!