Skip to content

Commit b90162b

Browse files
Sbussisoclaude
andcommitted
fix(deploy): set max_unavailable=1 so Fly can free volume on deploy
`strategy = "immediate"` alone wasn't enough — flyctl's default `max_unavailable = 0.33` still forces create-before-destroy, which trips over the single-volume constraint with the same error ("creating a new machine in group 'app' requires an unattached 'opensentry_data' volume"). Setting `max_unavailable = 1` lets Fly stop the existing machine first, freeing the volume so the new machine can attach to it. This is the documented path for single-machine + persistent-volume apps; the only alternative is migrating storage off the volume. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent b2c3671 commit b90162b

1 file changed

Lines changed: 18 additions & 12 deletions

File tree

fly.toml

Lines changed: 18 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -16,19 +16,25 @@ primary_region = "sjc"
1616
destination = "/data"
1717

1818
[deploy]
19-
# `immediate`, not `rolling`, because we run a single machine with
20-
# a single persistent volume (`opensentry_data` at /data, holding
21-
# the SQLite DB). Rolling deploys want to start a new machine
22-
# alongside the old one, then drain the old — but the volume only
23-
# has one attachment slot, so the new machine has nowhere to mount
24-
# it and Fly errors with "creating a new machine in group 'app'
25-
# requires an unattached 'opensentry_data' volume". `immediate`
26-
# tells Fly to stop the existing machine, redeploy on the same
27-
# volume, restart. ~30-60s of downtime per deploy is the price of
28-
# SQLite-on-a-single-volume; the alternative (multiple volumes)
29-
# would split-brain the DB. Migrating to Postgres (or LiteFS)
30-
# would unlock zero-downtime deploys.
19+
# Single machine + single persistent volume (`opensentry_data` at
20+
# /data, holding the SQLite DB) means we MUST allow downtime during
21+
# deploys — there's only one volume attachment slot, so a new
22+
# machine cannot be brought up alongside the old one without
23+
# erroring "creating a new machine in group 'app' requires an
24+
# unattached 'opensentry_data' volume".
25+
#
26+
# `strategy = "immediate"` alone is insufficient because flyctl's
27+
# default `max_unavailable = 0.33` means it still tries to maintain
28+
# 67% availability by creating-before-destroying. Setting
29+
# `max_unavailable = 1` lets Fly stop the existing machine, free
30+
# the volume, and reattach it to the new machine on the same
31+
# deploy — which is the only path that works with this storage
32+
# setup. Cost: ~30-60s of downtime per deploy.
33+
#
34+
# The path to zero-downtime deploys is migrating off
35+
# SQLite-on-a-single-volume (Postgres or LiteFS).
3136
strategy = "immediate"
37+
max_unavailable = 1
3238

3339
[http_service]
3440
internal_port = 8000

0 commit comments

Comments
 (0)