My Machines are not running

Hi,
I am deploying my first application, and facing issues. Need your help.

I completed my application and run fly launch and fly deploy command. It says the both commands worked successfully and my application is launched. It gave me url to visit my newly deployed app. When I visit this app it keeps on loading for long time and nothing happens.

My logs says that machines failed to start after trying 10 times.

unable to understand what the issue is.

I have launched and deployed my app without any changes in my configs or any other file. Is that the issue? because in docs of phoenix, they have just mentioned to run these commands of launch and deploy.

If i have to make any changes in my configs or anyother file, please tell me which changes i should make before launching and deploying, as it is my first time doing this process.

here are my logs

Thanks
Looking for urgent help.

We’ll need to know more about what your configuration looks like to be of any help.

I don’t have experience with phoenix, but it looks like it’s crashing during initialization, and the error messages there provide line numbers that might point to what your problem is.

If you want to troubleshoot from within a Fly machine itself, you can make sure your Fly app config (via Fly.toml) specifies an entrypoint to just /bin/sh -c sleep infinity when the machine starts, instead of running your phoenix app. Then, when the machine is online and just sleeping, you can use fly ssh console -a [my-appname] to get a shell inside the machine so you can inspect its environment. You can try the same commands in there that you normally would to boot the app, and see how it behaves and what might be wrong.

@miend
Thankf for replying to me. the ssh console command is not running because my machines are not running. When I start them they stopped after few time.

here is my toml flle

my machines are not starting up properly.
Both machines are shared-cpu-1x@1024MB

I am also getting this alert


,my location is spain madrid

My third machine for db is also not showing up, it shows me sometime in my dashboard but again disappears and my other two machines for app are suspended.

Unable to debug the whole situation.
Please need help

In order to use fly ssh console on a crashy app, you’ll need to modify it to sleep (or do some other non-crashing lengthy task) instead of running your app. Take a look at the experimental section of the config options to find cmd and entrypoint. It may be enough to add this to your config.toml:

[experimental]
  entrypoint = ['/bin/sleep', '1d']

I would also disable any auto-start/stop things. While you’re troubleshooting app startup you might just disable the whole http_service for simplicity.

My third machine for db is also not showing up, it shows me sometime in my dashboard but again disappears and my other two machines for app are suspended.

Does the successful initialization of your app depend on the existence of the DB? If so, the DB not being available might be a good clue as to why they’re crashing. How is the DB configured and deployed?

I haven’t done anything extra for DB. My app is using postgreSQL. during deployment, they jsut asked me to assign 1 gb for fly_postgres which i agreed. and simply deploy. I am deploying for first time so just follow the steps mentioned.

Alright, so now I know you’re using Fly Postgres. Without seeing the configuration of everything, the verbose logs from your app, some attempts at troubleshooting, etc it’s hard to make any judgements. But I would:

  1. Spin up the app with the [experimental] section of the TOML config as I mentioned, and try running your code from within the container while it’s sleeping (so it doesn’t crash/restart the machine). Then you can inspect the whole state of the machine to your heart’s desire to find the issue.
  2. Make sure there’s some verbose logging capturing initialization errors, because what’s emitted by the app looks vague. I don’t know how this is done in your stack.
  3. I can’t be sure, but suspect that lack of DB connection is causing an issue. Check whether the Fly Postgres DB is online. Check whether the connection details you’ve provided to your app are correct. Check if you can psql into the postgres DB yourself using the credentials provided to your app.

I also admittedly am not familiar with the steps you’re following to deploy, as I tend to deploy things with very explicit configuration details (or interact with the machines API directly), so I can only provide general troubleshooting advice.