Why do i keep getting Failed to proxy HTTP request (error: no known healthy instances found for route tcp/443?

Hi all, so my deployment of my django + celery got all greens

But when i visit the app, aininjas.fly.dev, I keep getting the following error.

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 20)

The fly.toml is below:


app = "aininjas"
primary_region = "mia"

[build]
  dockerfile = "compose/production/django/Dockerfile"

[deploy]
  release_command = "python /app/manage.py migrate"

[env]
  DJANGO_DEBUG = "0"
  PORT = "5000"
  RUNTIME_ENV = "PROD"
  kill_signal = "SIGINT"
  kill_timeout = "5"

[processes]
  celeryworker = "/start-celeryworker"
  django = "/usr/local/bin/gunicorn config.wsgi --bind 0.0.0.0:5000 --chdir=/app"

[[services]]
  protocol = "tcp"
  internal_port = 5000
  processes = ["django"]

  [[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


Any ideas on how I can resolve this?

You might want to see if the app is listening on the right port, run fly ssh shell to shell into the instance and wget -O- http://localhost:5000 or curl http://localhost:5000 to see if you get anything.

I’m having the same issues with a completely different stack. In the last few hours the website is going down because of the hilighted errors in this thread

The Status is saying is back to normal no incidents and my application is still down…why is that?

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 20 ms (attempt 1)

No changes/deployments where made…

What is your app?

I can access @bsliu17’s app above now.

I’ve managed to resolve my issue.

The issue (i think) is my incorrect setting of ALLOWED_HOSTS, and after adding .fly.dev,aininjas.fly.dev,localhost,127.0.0.1 to it the app works.

Hope this is helpful to other django devs out there :slight_smile:
And thanks to @shortdiv to help me further troubleshoot my apps within the instances.

2 Likes

Should I just open a different thread?

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