New Flask & Postgresql app on deployment gets suspended

Hi All,
I am new to Fly and deployment with Flask + Postgresql

Upon deploying the code I do not see any issues, but the machine gets suspended.
I have tried increasing size and scaled to other regions but of no help.
Looking at the logs, I can identify certain problem areas :
2024-06-08T20:12:10Z proxy[3d8dd655c19958] ams [info]waiting for machine to be reachable on 0.0.0.0:8080 (waited 7.429210351s so far)
2024-06-08T20:12:16Z proxy[3d8dd655c19958] ams [info]waiting for machine to be reachable on 0.0.0.0:8080 (waited 13.434490507s so far)
2024-06-08T20:12:22Z proxy[3d8dd655c19958] ams [info]waiting for machine to be reachable on 0.0.0.0:8080 (waited 19.399171651s so far)

Here is the updated fly.toml -


app = 'bestinterestsv2app'
primary_region = 'ams'

[build]
  builder = 'paketobuildpacks/builder:base'

[env]
  PORT = '8080'

[http_service]
  internal_port = 8080
  force_https = true
  auto_stop_machines = true
  auto_start_machines = true
  min_machines_running = 0
  processes = ['app']

[[services]]
  protocol = 'tcp'
  internal_port = 8080

  [[services.ports]]
    port = 5432
    handlers = ['pg_tls']

[[vm]]
  memory = '1gb'
  cpu_kind = 'shared'
  cpus = 1

Below are the latest logs -
$ fly logs -a bestinterestsv2app

Waiting for logs…

2024-06-08T20:12:03.975 runner[3d8dd655c19958] ams [info] machine exited with exit code 0, not restarting

2024-06-08T20:12:10.277 proxy[3d8dd655c19958] ams [info] waiting for machine to be reachable on 0.0.0.0:8080 (waited 7.429210351s so far)

2024-06-08T20:12:16.283 proxy[3d8dd655c19958] ams [info] waiting for machine to be reachable on 0.0.0.0:8080 (waited 13.434490507s so far)

2024-06-08T20:12:22.247 proxy[3d8dd655c19958] ams [info] waiting for machine to be reachable on 0.0.0.0:8080 (waited 19.399171651s so far)

2024-06-08T20:12:27.250 proxy[3d8dd655c19958] ams [error] [PM05] failed to connect to machine: gave up after 15 attempts (in 24.402288302s)

2024-06-08T20:12:27.290 proxy[e2867493f660d8] ams [info] Starting machine

2024-06-08T20:12:27.357 app[e2867493f660d8] ams [info] 2024-06-08T20:12:27.357843133 [01HZWQHXB6A6JS0Y77P8JQPVVV:main] Running Firecracker v1.7.0

2024-06-08T20:12:27.468 app[e2867493f660d8] ams [info] [ 0.046987] PCI: Fatal: No config space access function found

2024-06-08T20:12:27.739 app[e2867493f660d8] ams [info] INFO Starting init (commit: dec752a2)…

2024-06-08T20:12:27.756 app[e2867493f660d8] ams [info] INFO Preparing to run: /cnb/process/web as 1000

2024-06-08T20:12:27.760 app[e2867493f660d8] ams [info] INFO [fly api proxy] listening at /.fly/api

2024-06-08T20:12:27.770 app[e2867493f660d8] ams [info] 2024/06/08 20:12:27 INFO SSH listening listen_address=[fdaa:9:6545:a7b:43:678d:b5ab:2]:22 dns_server=[fdaa::3]:53

2024-06-08T20:12:27.777 runner[e2867493f660d8] ams [info] Machine started in 484ms

2024-06-08T20:12:27.778 proxy[e2867493f660d8] ams [info] machine started in 489.598154ms

2024-06-08T20:12:28.764 app[e2867493f660d8] ams [info] INFO Main child exited normally with code: 0

2024-06-08T20:12:28.775 app[e2867493f660d8] ams [info] INFO Starting clean up.

2024-06-08T20:12:28.786 app[e2867493f660d8] ams [info] [ 1.361984] reboot: Restarting system

2024-06-08T20:12:28.955 runner[e2867493f660d8] ams [info] machine exited with exit code 0, not restarting

2024-06-08T20:18:17.029 runner[e2867493f660d8] ams [info] Pulling container image registry.fly.io/bestinterestsv2app:deployment-01HZWQV0TWP3C22NN0QV4QG894

2024-06-08T20:18:24.560 runner[3d8dd655c19958] ams [info] Successfully prepared image registry.fly.io/bestinterestsv2app:deployment-01HZWQV0TWP3C22NN0QV4QG894 (8.070403771s)

2024-06-08T20:18:24.618 runner[e2867493f660d8] ams [info] Successfully prepared image registry.fly.io/bestinterestsv2app:deployment-01HZWQV0TWP3C22NN0QV4QG894 (7.589712215s)

2024-06-08T20:18:24.954 runner[3d8dd655c19958] ams [info] Configuring firecracker

2024-06-08T20:18:24.963 runner[e2867493f660d8] ams [info] Configuring firecracker

2024-06-08T20:27:17.161 runner[3d8dd655c19958] ams [info] Pulling container image registry.fly.io/bestinterestsv2app:deployment-01HZWR8CNVQ2ZZ3G4QQ6W686JM

2024-06-08T20:27:17.694 runner[e2867493f660d8] ams [info] Pulling container image registry.fly.io/bestinterestsv2app:deployment-01HZWR8CNVQ2ZZ3G4QQ6W686JM

2024-06-08T20:27:28.255 runner[e2867493f660d8] ams [info] Successfully prepared image registry.fly.io/bestinterestsv2app:deployment-01HZWR8CNVQ2ZZ3G4QQ6W686JM (10.561019432s)

2024-06-08T20:27:28.660 runner[e2867493f660d8] ams [info] Configuring firecracker

2024-06-08T20:27:29.199 runner[3d8dd655c19958] ams [info] Successfully prepared image registry.fly.io/bestinterestsv2app:deployment-01HZWR8CNVQ2ZZ3G4QQ6W686JM (12.038323516s)

2024-06-08T20:27:29.578 runner[3d8dd655c19958] ams [info] Configuring firecracker

2024-06-08T20:28:58.615 proxy[3d8dd655c19958] ams [info] Starting machine

2024-06-08T20:28:58.681 app[3d8dd655c19958] ams [info] 2024-06-08T20:28:58.681424945 [01HZWRHD8S2YXWE9HY3D3H5GS3:main] Running Firecracker v1.7.0

2024-06-08T20:28:58.804 app[3d8dd655c19958] ams [info] [ 0.054699] PCI: Fatal: No config space access function found

2024-06-08T20:28:59.091 app[3d8dd655c19958] ams [info] INFO Starting init (commit: dec752a2)…

2024-06-08T20:28:59.112 app[3d8dd655c19958] ams [info] INFO Preparing to run: /cnb/process/web as 1000

2024-06-08T20:28:59.116 app[3d8dd655c19958] ams [info] INFO [fly api proxy] listening at /.fly/api

2024-06-08T20:28:59.127 app[3d8dd655c19958] ams [info] 2024/06/08 20:28:59 INFO SSH listening listen_address=[fdaa:9:6545:a7b:38:d0d2:5026:2]:22 dns_server=[fdaa::3]:53

2024-06-08T20:28:59.129 runner[3d8dd655c19958] ams [info] Machine started in 511ms

2024-06-08T20:28:59.131 proxy[3d8dd655c19958] ams [info] machine started in 515.545717ms

2024-06-08T20:29:00.117 app[3d8dd655c19958] ams [info] INFO Main child exited normally with code: 0

2024-06-08T20:29:00.130 app[3d8dd655c19958] ams [info] INFO Starting clean up.

2024-06-08T20:29:00.142 app[3d8dd655c19958] ams [info] [ 1.392167] reboot: Restarting system

2024-06-08T20:29:00.256 runner[3d8dd655c19958] ams [info] machine exited with exit code 0, not restarting

2024-06-08T20:29:06.600 proxy[3d8dd655c19958] ams [info] waiting for machine to be reachable on 0.0.0.0:8080 (waited 7.469097088s so far)

2024-06-08T20:40:17.623 runner[1781e60b665489] ewr [info] Pulling container image registry.fly.io/bestinterestsv2app:deployment-01HZWR8CNVQ2ZZ3G4QQ6W686JM

2024-06-08T20:40:17.764 runner[28750d7b023948] ewr [info] Pulling container image registry.fly.io/bestinterestsv2app:deployment-01HZWR8CNVQ2ZZ3G4QQ6W686JM

2024-06-08T20:40:17.771 runner[3d8d27ea552089] ewr [info] Pulling container image registry.fly.io/bestinterestsv2app:deployment-01HZWR8CNVQ2ZZ3G4QQ6W686JM

2024-06-08T20:40:18.561 runner[e784127b574683] ewr [info] Pulling container image registry.fly.io/bestinterestsv2app:deployment-01HZWR8CNVQ2ZZ3G4QQ6W686JM

2024-06-08T20:40:24.497 runner[28750d7b023948] ewr [info] Successfully prepared image registry.fly.io/bestinterestsv2app:deployment-01HZWR8CNVQ2ZZ3G4QQ6W686JM (6.733444154s)

2024-06-08T20:40:24.883 runner[28750d7b023948] ewr [info] Configuring firecracker

2024-06-08T20:40:24.949 app[28750d7b023948] ewr [info] 2024-06-08T20:40:24.949261319 [01HZWS97HSZ2K0YCDSRYD9RCAZ:main] Running Firecracker v1.7.0

2024-06-08T20:40:25.072 app[28750d7b023948] ewr [info] [ 0.052360] PCI: Fatal: No config space access function found

2024-06-08T20:40:25.371 app[28750d7b023948] ewr [info] INFO Starting init (commit: dec752a2)…

2024-06-08T20:40:25.395 app[28750d7b023948] ewr [info] INFO Preparing to run: /cnb/process/web as 1000

2024-06-08T20:40:25.399 app[28750d7b023948] ewr [info] INFO [fly api proxy] listening at /.fly/api

2024-06-08T20:40:25.418 runner[28750d7b023948] ewr [info] Machine created and started in 7.657s

2024-06-08T20:40:25.765 runner[1781e60b665489] ewr [info] Successfully prepared image registry.fly.io/bestinterestsv2app:deployment-01HZWR8CNVQ2ZZ3G4QQ6W686JM (8.142161342s)

2024-06-08T20:40:25.767 runner[3d8d27ea552089] ewr [info] Successfully prepared image registry.fly.io/bestinterestsv2app:deployment-01HZWR8CNVQ2ZZ3G4QQ6W686JM (7.995327886s)

2024-06-08T20:40:26.336 runner[3d8d27ea552089] ewr [info] Configuring firecracker

2024-06-08T20:40:26.401 app[28750d7b023948] ewr [info] INFO Main child exited normally with code: 0

2024-06-08T20:40:26.406 app[3d8d27ea552089] ewr [info] 2024-06-08T20:40:26.406853871 [01HZWS97HZ25T1KN1814D34PPW:main] Running Firecracker v1.7.0

2024-06-08T20:40:26.412 app[28750d7b023948] ewr [info] INFO Starting clean up.

2024-06-08T20:40:26.423 app[28750d7b023948] ewr [info] [ 1.402455] reboot: Restarting system

2024-06-08T20:40:26.432 runner[1781e60b665489] ewr [info] Configuring firecracker

2024-06-08T20:40:26.498 app[1781e60b665489] ewr [info] 2024-06-08T20:40:26.498557105 [01HZWS97D72MS9E17WR3PNJD5X:main] Running Firecracker v1.7.0

2024-06-08T20:40:26.515 app[3d8d27ea552089] ewr [info] [ 0.047131] PCI: Fatal: No config space access function found

2024-06-08T20:40:26.574 runner[28750d7b023948] ewr [info] machine exited with exit code 0, not restarting

2024-06-08T20:40:26.604 app[1781e60b665489] ewr [info] [ 0.046171] PCI: Fatal: No config space access function found

2024-06-08T20:40:26.787 app[3d8d27ea552089] ewr [info] INFO Starting init (commit: dec752a2)…

2024-06-08T20:40:26.809 app[3d8d27ea552089] ewr [info] INFO Preparing to run: /cnb/process/web as 1000

2024-06-08T20:40:26.813 app[3d8d27ea552089] ewr [info] INFO [fly api proxy] listening at /.fly/api

2024-06-08T20:40:26.827 app[3d8d27ea552089] ewr [info] 2024/06/08 20:40:26 INFO SSH listening listen_address=[fdaa:9:6545:a7b:94:b8ce:22f1:2]:22 dns_server=[fdaa::3]:53

2024-06-08T20:40:26.834 runner[3d8d27ea552089] ewr [info] Machine created and started in 9.07s

2024-06-08T20:40:26.883 app[1781e60b665489] ewr [info] INFO Starting init (commit: dec752a2)…

2024-06-08T20:40:26.911 app[1781e60b665489] ewr [info] INFO Preparing to run: /cnb/process/web as 1000

2024-06-08T20:40:26.915 app[1781e60b665489] ewr [info] INFO [fly api proxy] listening at /.fly/api

2024-06-08T20:40:26.928 app[1781e60b665489] ewr [info] 2024/06/08 20:40:26 INFO SSH listening listen_address=[fdaa:9:6545:a7b:94:9d71:5e76:2]:22 dns_server=[fdaa::3]:53

2024-06-08T20:40:26.931 runner[1781e60b665489] ewr [info] Machine created and started in 9.315s

2024-06-08T20:40:27.131 runner[e784127b574683] ewr [info] Successfully prepared image registry.fly.io/bestinterestsv2app:deployment-01HZWR8CNVQ2ZZ3G4QQ6W686JM (8.569818737s)

2024-06-08T20:40:27.635 runner[e784127b574683] ewr [info] Configuring firecracker

2024-06-08T20:40:27.705 app[e784127b574683] ewr [info] 2024-06-08T20:40:27.705868483 [01HZWS98A3ZR4DWJTH3BYJJW70:main] Running Firecracker v1.7.0

2024-06-08T20:40:27.815 app[3d8d27ea552089] ewr [info] INFO Main child exited normally with code: 0

2024-06-08T20:40:27.819 app[e784127b574683] ewr [info] [ 0.046737] PCI: Fatal: No config space access function found

2024-06-08T20:40:27.830 app[3d8d27ea552089] ewr [info] INFO Starting clean up.

2024-06-08T20:40:27.839 app[3d8d27ea552089] ewr [info] [ 1.367791] reboot: Restarting system

2024-06-08T20:40:27.917 app[1781e60b665489] ewr [info] INFO Main child exited normally with code: 0

2024-06-08T20:40:27.930 app[1781e60b665489] ewr [info] INFO Starting clean up.

2024-06-08T20:40:27.938 app[1781e60b665489] ewr [info] [ 1.377251] reboot: Restarting system

2024-06-08T20:40:27.988 runner[3d8d27ea552089] ewr [info] machine exited with exit code 0, not restarting

2024-06-08T20:40:28.097 runner[1781e60b665489] ewr [info] machine exited with exit code 0, not restarting

2024-06-08T20:40:28.099 app[e784127b574683] ewr [info] INFO Starting init (commit: dec752a2)…

2024-06-08T20:40:28.122 app[e784127b574683] ewr [info] INFO Preparing to run: /cnb/process/web as 1000

2024-06-08T20:40:28.126 app[e784127b574683] ewr [info] INFO [fly api proxy] listening at /.fly/api

2024-06-08T20:40:28.139 app[e784127b574683] ewr [info] 2024/06/08 20:40:28 INFO SSH listening listen_address=[fdaa:9:6545:a7b:95:e91d:52f8:2]:22 dns_server=[fdaa::3]:53

2024-06-08T20:40:28.153 runner[e784127b574683] ewr [info] Machine created and started in 9.601s

2024-06-08T20:40:29.132 app[e784127b574683] ewr [info] INFO Main child exited normally with code: 0

2024-06-08T20:40:29.144 app[e784127b574683] ewr [info] INFO Starting clean up.

2024-06-08T20:40:29.156 app[e784127b574683] ewr [info] [ 1.384675] reboot: Restarting system

2024-06-08T20:40:29.307 runner[e784127b574683] ewr [info] machine exited with exit code 0, not restarting