Cannot get http_service.checks to work

Hi all,

Trying to get the health checks on a web app working. We have an endpoint at /up that returns a 200 when you hit it and it’s confirmed to be working in a browser. However, I cannot get it to work as part of a deployment. It is more or less a cut and paste from the documentation. What am I missing?

Thanks,
John

..SNIP..

[build]
dockerfile = 'Dockerfile.production'

[env]
..SNIP..

[processes]
app = './bin/rails server'

[http_service]
internal_port = 3000
force_https = true
auto_stop_machines = true
auto_start_machines = true
min_machines_running = 2
processes = ['app']

[[http_service.checks]]
grace_period = "10s"
interval = "60s"
method = "GET"
timeout = "5s"
path = "/up"

[http_service.concurrency]
type = 'requests'
hard_limit = 250
soft_limit = 200

[[vm]]
size = 'shared-cpu-2x'
memory = '1gb'
cpu_kind = 'shared'
cpus = 2

[[statics]]
guest_path = '/app/public'
url_prefix = '/'

Also tried adding protocol = "https" but also not working.

Hi,

Strange … :thinking:

You are right in that looks exactly as it is in the docs:

If you run flyctl logs from the folder the fly.toml is in, do you see Fly attempting to call that /up?

If so, what response is it getting back? It sounds like when it is calling it, it’s failing, so the logs may hopefully show why that is.

It gets stuck in this state in the flyctl

 ⠇ [1/2] Waiting for 32874d32a93918 [app] to become healthy: 0/1
   [2/2] Waiting for job

I never see a log entry for a request to /up (triggered from the http_service.checks). However, if I manually open a browser or cURL to /up then I see a request log from the app.

Eventually it times out.

 ✖ [1/2] Machine SNIP [app] update failed: timeout reached waiting for health checks to pass for machine SNIP: failed to get VM SNIP: Get "https://api.machines.dev/v1/apps/SNIP": net/http: re…
   [2/2] Waiting for job
-------
Checking DNS configuration for SNIP
Error: timeout reached waiting for health checks to pass for machine SNIP: failed to get VM SNIP: Get "https://api.machines.dev/v1/apps/SNIP": net/http: request canceled
Your machine never reached the state "%s".

You can try increasing the timeout with the --wait-timeout flag

I’m not sure, I’m afraid :neutral_face:

There are some good Rails people on here who may know more. If you see the option to categorise/tag your post, try adding “rails” to it.

rails, :sparkles:

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