flyctl --json broken for machines-based apps

It looks like the --json flag isn’t working in the current flyctl. Our deployment script relies on this, so deployments are currently failing for us.

$ flyctl status --json --app enaia-pr-1602
App
  Name     = enaia-pr-1602          
  Owner    = enaia                  
  Hostname = enaia-pr-1602.fly.dev  
  Image    = -                      
  Platform = machines
$ flyctl version
flyctl v0.0.484 darwin/arm64 Commit: 58efc900 BuildDate: 2023-03-11T05:44:31Z

(I emailed support about this as well)

Thanks for reporting this. As far as I can tell, flyctl status doesn’t currently support JSON output for apps on the machines platform.

When did you start running into this issue? (Did you recently switch to using apps v2/the machines platform?) Also, if you’re able/willing to share publicly, could you tell me a little more about what you’re using the JSON output for?

@MatthewIngwersen thanks, actually I got a response from Sam via email as well. He suggested forcing nomad as a workaround:

  • fly launch --force-nomad
  • fly deploy --force-nomad
  • fly apps create --nomad

I did recently change our default for new apps to machines. We are planning on migrating our production app to v2, so it’s good to know that we’ll either need to wait for this bug to be resolved in flyctl or change our deployment workflow (obviously, the former would be preferable). In the short term, for our “per-PR” apps such as this one, forcing nomad should be fine.

2 Likes

Neat! Do you use the JSON output to record deployment status or something more fun?

We just released flyctl version 0.0.487, which ships with an implementation of flyctl status --json for Apps v2. We tried to keep the output close to the original, though there a few changes to be aware of:

  • The DeploymentStatus field is gone, since it’s not set for v2 apps.
  • The Allocations field is replaced with Machines, which lists all Apps v2–managed machines in the general case or, for a Postgres app, just all machines. (This is the same behavior as the tabular text output.) The data comes from the Machines API and is exactly what you’d get if you accessed it directly.
  • There’s a new PlatformVersion field that’s set to machines so that you can differentiate it from Apps v1.

If you have any further issues with this, please let me know!

2 Likes

Thanks @MatthewIngwersen, great that you took care of that so quickly.

@fideloper-fly - we use the status in our CI to check the current state of the “per-PR” apps we create to determine the right action to take…

if ! [[ $(flyctl status --json --app enaia-pr-${{ github.event.number }} | jq '.Status') =~ running|pending ]]; then
  ...do some things
fi
1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.