If a deployment fails, what happens

I just tried secrets unset for some secrets, and as expected, that triggered a new deploy.

However it seemed to fail with:

Monitoring Deployment
You can detach the terminal anytime without stopping the deployment

3 desired, 2 placed, 1 healthy, 0 unhealthy [health checks: 2 total, 2 passing]
v10 running - Deployment is running
Error 1 error occurred:
        * server returned a non-200 status code: 504

So given it says 2 were placed … would that mean that 2 out of the 3 servers are live and receiving traffic, while 1 is not? And so be out of sync in terms of secrets (in this case) available.

Or does traffic only get migrated over to the new version once they all are ‘placed’ and all ‘healthy’?

Only … given the random failures that happen during deploys, it’s fine if traffic never gets sent to them. Less good if it does, and part way through, the rest fail. Ending up with some weird half/half version/roll-back situation.

This particular error is from the monitoring loop in the CLI failing. If you run flyctl releases you can see what ended up happening with it. You can also see which version each instance is running with flyctl status. When the CLI breaks like that, the deployment continues (and you can monitor it with flyctl monitor).

They each start accepting traffic when they become healthy. If it gets partway through that process and the deploy fails, we create a new version number, roll back, and tear down the bad release.