Error: could not find an instance to route to

Hi I have a Python app which deployed successfully

$ flyctl status
Deployment Status
  Version     = v3
  Status      = successful
  Description = Deployment completed successfully
  Instances   = 1 desired, 1 placed, 1 healthy, 0 unhealthy

I’m also able to successfully make requests to localhost when I ssh into the instance

2022-11-28T00:38:11Z  dfw [info]127.0.0.1 - - [28/Nov/2022:00:38:11 +0000] "GET / HTTP/1.1" 200 9311 "-" "curl/7.68.0"

But the app remains unreachable when I try to reach it on my browser, and I see this in the logs

2022-11-28T00:58:50Z proxy jnb [error]Error: could not find an instance to route to

The most peculiar part is that it seems to be routing requests to a different region (jnb) than the app is in (dfw).
Destroying and recreating the app didn’t help either.

Ah, there does seem to be an issue with Fly then. As someone else got the same error message (“could not find an instance to route to”). In their case, it appeared to be caused by the app’s name. However that can’t be the case as you are getting the same:

Given a 502 is returned by the Fly proxy, and you have a proxy error in your log, it may be related to this (now resolved) issue:

If not and it’s still happening, if you can get a request ID (from the headers) that will assist Fly in debugging.

Thanks Greg. I’ve been able to resolve this by removing the processes sections specified in the toml file and I can now access the application.

For anyone’s reference this is what I have now


app = "xxxx"
kill_signal = "SIGINT"
kill_timeout = 5
## processes = []

[env]

[[services]]
  http_checks = []
  internal_port = 8080
##  processes = ["web"]
  protocol = "tcp"
  script_checks = []
  [services.concurrency]
    hard_limit = 25
    soft_limit = 20
    type = "connections"

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

  [[services.ports]]
    handlers = ["tls", "http"]
    port = 443

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

[build]
  builder = "heroku/buildpacks:20"

1 Like