Failed to proxy HTTP request

Hello, I’m constantly getting this error on my app, result is the app not loading. Anything I can do to fix this?

Tried using APPS V1 and V2.

2023-05-18T13:03:09.937 proxy[64a57a33] gru [warn] Failed to proxy HTTP request (error: no known healthy instances found for route tcp/443. (hint: is your app shutdown? is there an ongoing deployment with a volume or using the ‘immediate’ strategy? if not, this could be a delayed state issue)). Retrying in 1000 ms (attempt 40)

Hi @rodabete, more information is needed to narrow down possible reasons that your app isn’t reachable by the Fly Proxy.

The most common reason people run into is probably a mismatch between the port their app listens on inside its VM, and the internal_port value in the app’s service configuration (http_service or services in fly.toml).

If fly launch can’t find information to the contrary, this gets set to port 8080. You can edit that and redeploy, if your app is bound to some other port.

As it happens, there was an internal discussion on proxy error messages today and this came up: it looks like your app service is configured correctly, but it’s hitting its hard concurrency limit and so some requests fail. If your app VM(s) can handle more traffic, you can just raise the limit in fly.toml. If they can’t, consider scaling vertically or horizontally.

It’s possible to configure V2 apps to put some Machines to sleep when traffic is low (to save costs) and wake them up again when demand picks up – see Automatically Stop and Start Machines · Fly Docs for more if that’s interesting to you.

Hi, I´m using fly for Nightscout (GitHub - nightscout/cgm-remote-monitor at dev), there is likely 4 clients at most connected to the app, I don´t know how it´s reaching the maximum limit, but anyways, I´ve changed the limit from 25 to 50 to see if it helps.

Here are the fly,toml services configuration:

[[services]]
  protocol = "tcp"
  internal_port = 1337
  processes = ["app"]

  [[services.ports]]
    port = 80
    handlers = ["http"]
    force_https = true

  [[services.ports]]
    port = 443
    handlers = ["tls", "http"]
  [services.concurrency]
    type = "connections"
    hard_limit = 25
    soft_limit = 20

  [[services.tcp_checks]]
    interval = "15s"
    timeout = "2s"
    grace_period = "1s"
    restart_limit = 0

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