flyctl icon indicating copy to clipboard operation
flyctl copied to clipboard

Initial `fly deploy` with `[mounts]` should error when we forget `primary_region`

Open catflydotio opened this issue 2 years ago • 4 comments

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 = "/"

catflydotio avatar Aug 23 '23 20:08 catflydotio

Have we decided on any wording for the error?

redjonzaci avatar Aug 25 '23 08:08 redjonzaci

This is my first ever PR on an open-source project!

redjonzaci avatar Aug 27 '23 14:08 redjonzaci

Revisiting this, I understand I should add a check for the [mounts] section.

redjonzaci avatar Sep 05 '23 06:09 redjonzaci

related: #2871

This needs to be a config validation check, not just an error on fly deploy.

andie787 avatar Oct 02 '23 13:10 andie787