Virtual machine repeatedly shutting down

I am trying to deploy a Python Django app. The app starts up initially but then receives a SIGINT and dies.

Logs

2021-09-13T00:29:16.925936826Z app[f3ad8656] ord [info] web | Running...
2021-09-13T00:29:17.136205382Z app[f3ad8656] ord [info] web | [2021-09-13 00:29:17 +0000] [527] [INFO] Starting gunicorn 20.1.0
2021-09-13T00:29:17.137796674Z app[f3ad8656] ord [info] web | [2021-09-13 00:29:17 +0000] [527] [INFO] Listening at: http://0.0.0.0:8080 (527)
2021-09-13T00:29:17.138751742Z app[f3ad8656] ord [info] web | [2021-09-13 00:29:17 +0000] [527] [INFO] Using worker: sync
2021-09-13T00:29:17.142718410Z app[f3ad8656] ord [info] web | [2021-09-13 00:29:17 +0000] [529] [INFO] Booting worker with pid: 529
2021-09-13T00:29:34.847291821Z proxy[f3ad8656] ord [info] Health check status changed 'warning' => 'passing'
2021-09-13T00:29:55.421223281Z runner[d4d5cad6] ord [info] Shutting down virtual machine
2021-09-13T00:29:55.452670896Z app[d4d5cad6] ord [info] Sending signal SIGINT to main child process w/ PID 510
2021-09-13T00:29:55.453103909Z app[d4d5cad6] ord [info] web | Interrupting...
2021-09-13T00:29:55.453907888Z app[d4d5cad6] ord [info] web | [2021-09-13 00:29:55 +0000] [526] [INFO] Handling signal: int
2021-09-13T00:29:55.559735315Z app[d4d5cad6] ord [info] web | [2021-09-13 00:29:55 +0000] [528] [INFO] Worker exiting (pid: 528)
2021-09-13T00:29:55.661028885Z app[d4d5cad6] ord [info] web | [2021-09-13 00:29:55 +0000] [526] [INFO] Shutting down: Master
2021-09-13T00:29:55.673344294Z app[d4d5cad6] ord [info] web | signal: interrupt
2021-09-13T00:29:56.452160103Z app[d4d5cad6] ord [info] Main child exited normally with code: 0
2021-09-13T00:29:56.452394749Z app[d4d5cad6] ord [info] Starting clean up.

Not sure what is wrong here. Has anyone come across this issue before?

Here are my files (Procfile, fly.toml)

Procfile

web: gunicorn scout.wsgi

fly.toml

# fly.toml file generated for scout-backend on 2021-09-12T00:17:10-05:00

app = "scout-backend"

kill_signal = "SIGINT"
kill_timeout = 5
processes = []

[build]
  builtin = "python"

[env]

[experimental]
  allowed_public_ports = []
  auto_rollback = true

[[services]]
  http_checks = []
  internal_port = 8080
  processes = ["app"]
  protocol = "tcp"
  script_checks = []

  [services.concurrency]
    hard_limit = 25
    soft_limit = 20
    type = "connections"

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

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

  [[services.tcp_checks]]
    grace_period = "30s"
    interval = "15s"
    restart_limit = 6
    timeout = "2s"

Thanks in advance!

There are various discussion on this forum with similar issues, related to erroneous health checks (too short grace_period, failing checks, …).

I also have this issue and I have tried increasing the grace period, but that just doesn’t fix it.