v3 failed - Failed due to unhealthy allocations - no stable job version to auto revert to and deploying as v4 error

  ID            = 26b83868
  Process       = app
  Version       = 3
  Region        = sin
  Desired       = stop
  Status        = complete
  Health Checks = 1 total, 1 critical
  Restarts      = 0
  Created       = 6m2s ago

TIMESTAMP               TYPE            MESSAGE
2023-01-15T15:53:48Z    Received        Task received by client
2023-01-15T15:53:48Z    Task Setup      Building Task Directory
2023-01-15T15:55:26Z    Started         Task started by client
2023-01-15T15:58:48Z    Alloc Unhealthy Task not running for min_healthy_time of 10s by deadline
2023-01-15T15:58:49Z    Killing         Sent interrupt. Waiting 5s before force killing
2023-01-15T15:59:12Z    Terminated      Exit Code: 0
2023-01-15T15:59:12Z    Killed          Task successfully killed

ID                                      SERVICE         STATE           OUTPUT

230cd37130e7f9c96f951ed2ad499c8f        tcp-8080        critical        dial tcp connect: connection refused

This is my Docker file

FROM python:3.10
COPY requirements.txt /bot/
RUN pip install -r requirements.txt
COPY . /bot
CMD python bot.py

The bot is running fine but why do this error occurs when I deploy an update

Not sure what your fly.toml looks like, but by default there is a health check configuration in place. In the logs you shared above, you can see Health Checks = 1 total, 1 critical – this means there was a health check issue. I’d recommend looking into whether your app is configured correctly to receive and respond to the health check. Your Dockerfile is set to expose 8080, but is there any code responding to health check requests?

If you’re running an app that doesn’t need a health check, it’s also possible to disable it.