services.machine_checks fails

I have setup the following check to hit the health endpoint that returns:
{ isHealthy: true } as JSON.

[[services.machine_checks]]
  image = "curlimages/curl"
  entrypoint = ["/bin/sh", "-c"]
  command = ["curl", "$FLY_TEST_MACHINE_IP/health", "|", "grep", "true"]
  kill_signal = "SIGKILL"
  kill_timeout = "5s"

However it fails and it seems like echo commands to log the response are muted from the logs.

The only thing I can discern from the logs is:
curl: (3) URL rejected: Port number was not a decimal number between 0 and 65535

Any clues to what’s wrong here?

I’m able to deploy the app with the current config, and /health works as expected.

Include the port number to “$FLY_TEST_MACHINE_IP/health” and see if that makes any change.

command = [“curl”, “$FLY_TEST_MACHINE_IP:3000/health”, “|”, “grep”, “true”]

Fails as well unfortunately

Hey you need to make some changes in command. “/bin/sh”, “-c” should contain a single argument with the bash command that has to be executed. docs has been updated with necessary changes → Fly Launch configuration (fly.toml) · Fly Docs

command should be ["curl http://[$FLY_TEST_MACHINE_IP] | grep ‘true’ "]

You can try with and w/o the port to see if it helps.

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