Initial `fly deploy` with `[mounts]` should error when we forget `primary_region`
flyctl v0.1.84
I forgot to put the primary region into fly.toml when deploying an app, that needs a volume, for the first time.
Without LOG_LEVEL=debug, the last feedback I get is:
Creating 1GB volume 'corro_data' for process group 'app'. Use 'fly vol extend' to increase its size
It just hangs there, though.
With LOG_LEVEL=debug it tells me why it stopped:
Creating 1GB volume 'corro_data' for process group 'app'. Use 'fly vol extend' to increase its size
DEBUG --> POST https://api.machines.dev/v1/apps/junk/volumes
DEBUG {
"name": "corro_data",
"region": "",
"size_gb": 1,
"encrypted": true,
"require_unique_zone": null,
"machines_only": null,
"snapshot_id": null,
"source_volume_id": null,
"compute": null
}
DEBUG {0x14000dd8ae0}
DEBUG <-- 422 https://api.machines.dev/v1/apps/junk/volumes (94.07ms)
DEBUG {
"error": "Region '' cannot host your machine. Please use an alternative region (see `fly platform regions`)."
}
In both cases fly deploy never returns (and doesn't respond to ctrl-C).
fly.toml:
app = "corrosion2"
[env]
RUST_BACKTRACE="1"
# RUST_LOG="info,foca=debug"
[mounts]
source = "corro_data"
destination = "/var/lib/corrosion"
[metrics]
port = 9090
path = "/"
Have we decided on any wording for the error?
This is my first ever PR on an open-source project!
Revisiting this, I understand I should add a check for the [mounts] section.
related: #2871
This needs to be a config validation check, not just an error on fly deploy.