App deployment times out on health check

Hello, I’ve been trying to deploy the app I have right here: GitHub - kizwolak/mini-message-board
Everything works on my local machine, but deploying to fly always fails. I have secrets which I think I have set correctly:
flyctl secrets set SECRET_MONGODB_LINK=‘mongodb+srv://kizwolak:(PASSWORD)@cluster0.nzilhsf.mongodb.net/?retryWrites=true&w=majority’ PORT=8080
I have also followed this guide:
Continuous Deployment with Fly.io and GitHub Actions · Fly Docs
But nothing has worked so far. The strangest thing is that fly only once asked me if I wanted to deploy right away, the first time I followed the linked guide. Otherwise, I am only informed that the app is ready for deployment. I have also followed the basic Node guide. I set all the ports to 8080 and I am not sure what else might need changing. What could be the reason for my problems? Thanks!

hi @kizwolak , can you try upgrading to latest flyctl (v0.0.536+) and run fly deploy again?

I see your app has “auto_stop_machines = true” set. There are big chances you hit by a bug caused by Fly Proxy stopping your machines while Fly was waiting for its health checks, so the timeouts.

Hello! I’ve updated to the latest flyctl and set auto_stop_machines to false, but unfortunately it still does not work. Thanks for your help either way! I’ve been fighting with this since yesterday and it doesn’t seem like any fix at all works. I’ve also changed fly.toml around to no avail.

I have however found that removing
[checks]
[checks.alive]
type = “tcp”
interval = “15s”
timeout = “2s”
grace_period = “5s”
from my fly.toml file and instead putting in

[services.checks]
type = “http”
path = “/”
method = “GET”
protocol = “http”
timeout = “2s”
interval = “15s”

under [[services]] does make my app deploy, but it does not load under the generated link - instead, it’s simply a perpetual loading screen.
threshold = 5

Hey, I tried to run your app and found this in logs:

2023-04-21T22:33:55Z app[9080e603a62668] lax [info]2023/04/21 22:33:55 listening on [fdaa:0:5ea6:a7b:112:71af:7fd:2]:22 (DNS: [fdaa::3]:53)
2023-04-21T22:33:56Z app[9080e603a62668] lax [info]> mini-message-board@0.0.0 start
2023-04-21T22:33:56Z app[9080e603a62668] lax [info]> nodemon ./bin/www
2023-04-21T22:33:56Z app[9080e603a62668] lax [info]sh: 1: nodemon: not found
2023-04-21T22:33:56Z app[9080e603a62668] lax [info]Starting clean up.
2023-04-21T22:33:57Z app[9080e603a62668] lax [info][    2.099777] reboot: Restarting system

The important part is:

sh: 1: nodemon: not found

Have you tried to build the docker image locally and run it?
looks like it is not valid.

IT WORKS!! Thank you so much!! I had npm start set to nodemon ./bin/www, and nodemon was saved as a dev dependency, so it wasn’t included by Docker. Now I get why people create separate scripts for nodemon and that’s something I will definitely remember! Have a good one!

1 Like

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