Issues getting existing app setup on Fly

Hi @kurt, I’m starting a new thread for my general issues of getting my existing Phoenix app running on Fly.

I’m on Phoenix 1.6, but I’m not sure what version we were on when the project was bootstrapped.

I was able to create the container after some mucking around, and deploy. I was able to set all the secrets. I cannot seem to connect to the postgres DB from the application instance though. I wanted to troubleshoot the connection, but the app cannot stay healthy enough, and the app gets shutdown before I can ssh into it to see what’s going on.

I created the app, and postgres instance under an organization, because eventually I will need my team to have access to this as well.

I have a few non-vanilla setup things to do for postgres that I need to connect to the instance before the app can startup:

  1. create a role “app_migration” for a migration Repo. This repo has permissions to modify schema.
  2. create a role for “elixir_app” for the read/write Repo. This is the main repo for the app.
  3. There is also a replica Repo, which I just plan to use the same read/write connection for this POC. Eventually this will connect to a replica.

I ended up destroying the setup, and plan to start again fresh.

Hi Andy,

At least for the app VM troubleshooting part, the below copy-pasted comment from Kurt will help:

"When a deployment fails, the first step is to look at a failed VM and see what you can figure out.

To see the specific VM status, run fly status --all to get a list of VMs.
Find one with status failed, then run fly vm status <id>.
This will give you a lot more information.
Make sure you check the exit code.
If it’s 0 it means health check failures, if it’s not zero it’s some issue crashing the process."

Thanks @FrequentFlyer I’ll give that a shot. I didn’t realize I could inspect the VM after failure!