Deployment Failed for Python App: v1 failed - Failed due to unhealthy allocations - no stable job version to auto revert to and deploying as v2

2022-12-28T13:41:56Z [info]Starting virtual machine
2022-12-28T13:41:57Z [info]Starting init (commit: f447594)…
2022-12-28T13:41:57Z [info]Preparing to run: /cnb/process/web as 1000
2022-12-28T13:41:57Z [info]2022/12/28 13:41:57 listening on [fdaa:1:1434:a7b:be65:b493:5ea2:2]:22 (DNS: [fdaa::3]:53)
2022-12-28T13:41:57Z [info]bash: gunicorn: command not found
2022-12-28T13:41:58Z [info]Starting clean up.
2022-12-28T13:42:04Z [info]Starting instance
2022-12-28T13:42:05Z [info]Configuring virtual machine
2022-12-28T13:42:05Z [info]Pulling container image
2022-12-28T13:42:06Z [info]Unpacking image
2022-12-28T13:42:06Z [info]Preparing kernel init
2022-12-28T13:42:06Z [info]Configuring firecracker
2022-12-28T13:42:06Z [info]Starting virtual machine
2022-12-28T13:42:06Z [info]Starting init (commit: f447594)…
2022-12-28T13:42:06Z [info]Preparing to run: /cnb/process/web as 1000
2022-12-28T13:42:06Z [info]2022/12/28 13:42:06 listening on [fdaa:1:1434:a7b:be65:b493:5ea2:2]:22 (DNS: [fdaa::3]:53)
2022-12-28T13:42:07Z [info]bash: gunicorn: command not found
2022-12-28T13:42:07Z [info]Starting clean up.
2022-12-28T13:42:14Z [info]Starting instance
2022-12-28T13:42:15Z [info]Configuring virtual machine

2022-12-28T13:42:15Z [info]Pulling container image
2022-12-28T13:42:16Z [info]Unpacking image
2022-12-28T13:42:16Z [info]Preparing kernel init
2022-12-28T13:42:16Z [info]Configuring firecracker
2022-12-28T13:42:16Z [info]Starting virtual machine
2022-12-28T13:42:16Z [info]Starting init (commit: f447594)…
2022-12-28T13:42:16Z [info]Preparing to run: /cnb/process/web as 1000
2022-12-28T13:42:17Z [info]2022/12/28 13:42:16 listening on [fdaa:1:1434:a7b:be65:b493:5ea2:2]:22 (DNS: [fdaa::3]:53)
2022-12-28T13:42:17Z [info]bash: gunicorn: command not found
2022-12-28T13:42:17Z [info]Starting clean up.
→ v1 failed - Failed due to unhealthy allocations - no stable job version to auto revert to and deploying as v2

→ Troubleshooting guide at Troubleshooting your Deployment · Fly Docs
Error abort

add a requirements.txt file in you directory

1 Like

Hi, thanks for the prompt reply, I already have that but I created another one anyways, I am following this: Run a Python App · Fly Docs however it still throws error. Here is the snippet of the error now:

2022-12-28T18:39:54Z [info]Preparing to run: /cnb/process/web as 1000
2022-12-28T18:39:54Z [info]2022/12/28 18:39:54 listening on [fdaa:1:1434:a7b:a98:f81f:f8ad:2]:22 (DNS: [fdaa::3]:53)
2022-12-28T18:39:54Z [info]bash: gunicorn: command not found
2022-12-28T18:39:55Z [info]Starting clean up.
2022-12-28T18:40:02Z [info]Starting instance
2022-12-28T18:40:04Z [info]Configuring virtual machine
2022-12-28T18:40:04Z [info]Pulling container image
2022-12-28T18:40:04Z [info]Unpacking image
2022-12-28T18:40:04Z [info]Preparing kernel init
2022-12-28T18:40:05Z [info]Configuring firecracker
2022-12-28T18:40:05Z [info]Starting virtual machine
2022-12-28T18:40:05Z [info]Starting init (commit: f447594)…
2022-12-28T18:40:05Z [info]Preparing to run: /cnb/process/web as 1000
2022-12-28T18:40:05Z [info]2022/12/28 18:40:05 listening on [fdaa:1:1434:a7b:a98:f81f:f8ad:2]:22 (DNS: [fdaa::3]:53)
2022-12-28T18:40:05Z [info]bash: gunicorn: command not found
2022-12-28T18:40:06Z [info]Starting clean up.
2022-12-28T18:40:12Z [info]Starting instance
2022-12-28T18:40:14Z [info]Configuring virtual machine
2022-12-28T18:40:14Z [info]Pulling container image
2022-12-28T18:40:15Z [info]Unpacking image
2022-12-28T18:40:15Z [info]Preparing kernel init
2022-12-28T18:40:15Z [info]Configuring firecracker
2022-12-28T18:40:15Z [info]Starting virtual machine
2022-12-28T18:40:15Z [info]Starting init (commit: f447594)…
2022-12-28T18:40:15Z [info]Preparing to run: /cnb/process/web as 1000
2022-12-28T18:40:15Z [info]2022/12/28 18:40:15 listening on [fdaa:1:1434:a7b:a98:f81f:f8ad:2]:22 (DNS: [fdaa::3]:53)
2022-12-28T18:40:15Z [info]bash: gunicorn: command not found
2022-12-28T18:40:16Z [info]Starting clean up.
→ v2 failed - Failed due to unhealthy allocations - no stable job version to auto revert to and deploying as v3

It looks like gunicorn is not installed or is not in the path when the app is started. Could you share your Dockerfile and fly.toml? Folks here might be able to help resolve with those.

1 Like

I have pip installed gunicorn now and added into requirements.txt file, thank you for that! This has solved previous original error I have posted here however I now get an error of:

Error failed to fetch an image or build from source: app does not have a Dockerfile or buildpacks configured.

I do not have Dockerfile for the project, I do not need Dockerfile for my project I believe unless fly.io deployment must have docker file, I am newbie to fly.io and was wanting to migrate my python app that was previously hosted in heroku, previously I had required procfile I believe for heroku and so in that sense would I need dockerfile for my context for fly.io? I have read about buildpacks from fly.io documentation and was wondering if I need to create a buildpack myself? Also I do have fly.toml created now.

Here if my FLY.toml file:

fly.toml file generated for purple-darkness-5696 on 2022-12-28T22:58:05Z

app = “purple-darkness-5696”
kill_signal = “SIGINT”
kill_timeout = 5
processes =

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