Machine did not have a restart policy, defaulting to restart

Last week I followed the functions-with-machines article and got a faas working nicely. Today I updated the code but now when the app tries to shut itself down the system immediately restarts it with this message:

runner[e784921c4dde83] ord [info] machine did not have a restart policy, defaulting to restart

Last week, the app would basically sleep until a new request came in. I can’t find “restart policy” documented anywhere on the fly website. I know restart policy is a Docker thing too (and I am using a Dockerfile), but that’s a docker run option. Any ideas?

1 Like

Hey @joshinnorman, we are rolling out a fix for this now. We adjusted the default restart policy earlier today which is causing this.


I just confirmed it’s fixed now. Thanks JP. You all are :zap:

1 Like

Ok, good deal!

@JP_Phillips I’m sure they’re still messing with it, but just fyi - now it’s not waking up for new requests. The request hangs for 60s then the connection is closed. Nothing shows up in the server logs on the Monitoring page.

Gotcha! I’ll take a look at this shortly.

Hey @joshinnorman, we’re looking into this, what’s the id of the app you’re currently running?

edit: got it, investigating!

Is this an id? firm-app-one-off

How long does the app wait when it’s idle? Did you happen set it so it shuts down after a certain time?

When the app is idle for 10 seconds it exits with process.exit(0). The fly.toml is:

app = “firm-app-one-off”

internal_port = 8080
force_https = true

dockerfile = “Dockerfile”

1 Like

Will you try increasing that? It’s probably best to keep it alive for 2+ minutes. I think it may start more reliably.

We’re investigating this one, too. But I don’t think a very quick shutdown period will work well with this infra.

1 Like

Thanks kurt - I tried 2 minutes but no luck. Same thing. Once it exits, a web request won’t wake it back up.

Hi there! I’ve just deployed some changes that should fix “machines not getting woken up” in your case. A specific combination of settings triggered the bug, they should not be woken up in all cases.


Thanks! For anyone else reading this thread, I’ve confirmed it’s working perfectly now.


I was seeing this same message on the builder app and I cannot deploy any apps now, please help… After stopping and starting the machine I just get:

checking docker activity
Calling GET /v1.41/containers/json?filters=%7B%22status%22%3A%7B%22running%22%3Atrue%7D%7D&limit=0

and eventually:

machine exited with exit code 0, not restarting

Deleting and letting fly recreate the builder seems to have fixed the issue

I am having this issue as well with V2 apps