Hey folks! I’m not sure what is going on here, but it seems likely that it’s not just a dumb user error .
Most of my commands from the CLI work just fine, I’ve got a prod and a staging environment, and I can deploy to either one with the -a flag. However, every time I try and run a command like flyctl postgres attach it errors with Error get app: Could not resolve App which is… not super helpful. I also have an app set in my ./fly.toml and even if I don’t pass the -a flag I get the same error. Any thoughts on what could be going on here?
I eventually gave up, because nothing was working, and tried to create a new postgres cluster. I created it. It was dead immediately and won’t restart. I’m pretty frustrated with this situation.
Well, I’ve created a third postgres cluster. That one seems to work, and I’ve skipped the broken attach step by just setting the env var directly, so, this is resolved, in a very roundabout way.
Hey, sorry for the trouble. The confusion comes from the awkward command line requirements. You need to specify --postgres-app for anything to work:
This should work in your app directory: fly postgres attach --postgres-app my-db-cluster
Also: fly postgres attach --postgres-app my-db-cluster -a myapp
I tried every variation, including using --postgres-app db-cluster-name --app app-name, and was never able to get anything to work for that combination of app and db cluster.