# Fly not rolling back when a bad image is deployed

**URL:** <https://community.fly.io/t/fly-not-rolling-back-when-a-bad-image-is-deployed/10189>\
**Category:** General\
**Created:** [January 20, 2023, 12:37am UTC](https://community.fly.io/t/fly-not-rolling-back-when-a-bad-image-is-deployed/10189 "2023-01-20T00:37:15Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![kentcdodds](https://sea1.discourse-cdn.com/fly1/user_avatar/community.fly.io/kentcdodds/32/2803_2.png) [@kentcdodds](https://community.fly.io/u/kentcdodds)\
**Post date:** [January 20, 2023, 12:37am UTC](https://community.fly.io/t/fly-not-rolling-back-when-a-bad-image-is-deployed/10189/1 "2023-01-20T00:37:15Z")

</div>

I’m deploying my Node.js app in a docker image with LiteFS and SQLite. Due to today’s issues [Deploying to Fly via GitHub Action failing](https://community.fly.io/t/deploying-to-fly-via-github-action-failing/10171) I deployed from local. For some reason my local build of the Docker image resulted in a bad build that wouldn’t start up. Instead of rolling back to a previous image, Fly just completely shut down my primary regions and failed to bring them back up.

I sent a bunch of logs to @benbjohnson (discourse won’t let me upload them here) which you could probably ask him for if you’d like. I’m happy to send them to whoever. There are a lot of logs and I’m not sure what part of them is very useful.

Oh, and I was streaming when this happened so feel free to watch that if you like (I didn’t show logs on stream though): [EpicWeb.dev Live stream 🌌 Writing the Deploying Distributed Node Tutorial - YouTube](https://youtu.be/l6wBDX1ngnI?t=470)

---

<div class="post-metadata">

**Author:** ![benbjohnson](https://sea1.discourse-cdn.com/fly1/user_avatar/community.fly.io/benbjohnson/32/50901_2.png) [@benbjohnson](https://community.fly.io/u/benbjohnson)\
**Post date:** [January 20, 2023, 12:46am UTC](https://community.fly.io/t/fly-not-rolling-back-when-a-bad-image-is-deployed/10189/2 "2023-01-20T00:46:49Z")

</div>

I chatted with @kentcdodds on Discord but I’ll post here for others to see. I think the rollback issue is because LiteFS is not passing through the error code from the application process. It’s simply returning exit code `0` when the process is done.

> <https://github.com/superfly/litefs/blob/7a1e91c50e06f7e3fb3c34a1e551783005e5695a/cmd/litefs/main.go#L117-L119>

I added an issue to track this ([#264](https://github.com/superfly/litefs/issues/264)) and I’ll get it fixed up in the morning.
