Error deploying fly-apps/hello-rust

I’m trying to deploy the fly-apps/hello-rust example and am getting the following error:

Failed due to unhealthy allocations - no stable job version to auto revert to and deploying as v1

Full session output, to help you debug:

:~/code/fly.io/hello-rust main 70afce5 [!] via 🦀 v1.63.0-nightly took 3s 
❮ flyctl launch                                       
An existing fly.toml file was found for app hello-rust
? Would you like to copy its configuration to the new app? No
Creating app in /Users/amorgan/code/fly.io/hello-rust
Scanning source code
Detected a Dockerfile app
? App Name (leave blank to use an auto-generated name): 
Automatically selected personal organization: Adam Morgan
? Select region: sea (Seattle, Washington (US))
Created app red-wind-8705 in organization personal
Wrote config file fly.toml
? Would you like to setup a Postgresql database now? No
? Would you like to deploy now? Yes
Deploying red-wind-8705
==> Validating app configuration
--> Validating app configuration done
Services
TCP 80/443 ⇢ 8080
Remote builder fly-builder-long-rain-4050 ready
==> Creating build context
--> Creating build context done
==> Building image with Docker
--> docker host: 20.10.12 linux x86_64
Sending build context to Docker daemon  33.12kB
[+] Building 143.5s (17/17) FINISHED                                                    
 => [internal] load remote build context                                           0.0s
 => copy /context /                                                                0.1s
 => [internal] load metadata for docker.io/library/rust:latest                     0.2s
 => [internal] load metadata for docker.io/library/debian:bullseye-slim            0.2s
 => [builder 1/8] FROM docker.io/library/rust:latest@sha256:a2dff3d02fbe9a2d4b2ff  0.0s
 => [stage-1 1/4] FROM docker.io/library/debian:bullseye-slim@sha256:06a93cbdd49a  0.0s
 => CACHED [builder 2/8] RUN USER=root cargo new app                               0.0s
 => CACHED [builder 3/8] WORKDIR /usr/src/app                                      0.0s
 => [builder 4/8] COPY Cargo.toml Cargo.lock ./                                    0.0s
 => [builder 5/8] RUN mkdir src && echo "fn main(){}" > src/main.rs                0.3s
 => [builder 6/8] RUN --mount=type=cache,target=/usr/local/cargo/registry     --  43.3s
 => [builder 7/8] COPY . .                                                         0.0s
 => [builder 8/8] RUN cargo install --path .                                      99.4s
 => CACHED [stage-1 2/4] RUN useradd -ms /bin/bash app                             0.0s 
 => CACHED [stage-1 3/4] WORKDIR /app                                              0.0s 
 => [stage-1 4/4] COPY --from=builder /usr/local/cargo/bin/hello /app/hello        0.0s 
 => exporting to image                                                             0.0s 
 => => exporting layers                                                            0.0s
 => => writing image sha256:2e9c4f61412c4e04597b6666b55b3cc1e8e06800b60106756cf45  0.0s 
 => => naming to registry.fly.io/red-wind-8705:deployment-1655352191               0.0s
--> Building image done
==> Pushing image to fly
The push refers to repository [registry.fly.io/red-wind-8705]
09653138d9cd: Pushed 
9c504f90905e: Mounted from holy-leaf-5021 
92470ea4013a: Mounted from holy-leaf-5021 
ad6562704f37: Mounted from holy-leaf-5021 
deployment-1655352191: digest: sha256:eecac2cf10215deecaaf1b077fa19119d33d4e4548ba7ccef78efc0c7831d2ee size: 1155
--> Pushing image done
Image: registry.fly.io/red-wind-8705:deployment-1655352191
Image size: 87 MB
==> Creating release
Release v2 created

You can detach the terminal anytime without stopping the deployment
Monitoring Deployment

1 desired, 1 placed, 0 healthy, 1 unhealthy [restarts: 2] [health checks: 1 total]
v0 failed - Failed due to unhealthy allocations - no stable job version to auto revert to
Failed Instances

==> Failure #1

Instance
  ID            = 00b80e6a  
  Process       =           
  Version       = 0         
  Region        = sea       
  Desired       = run       
  Status        = failed    
  Health Checks = 1 total   
  Restarts      = 2         
  Created       = 23s ago   

Recent Events
TIMESTAMP            TYPE            MESSAGE                                                         
2022-06-16T04:05:48Z Received        Task received by client                                         
2022-06-16T04:05:48Z Task Setup      Building Task Directory                                         
2022-06-16T04:06:00Z Started         Task started by client                                          
2022-06-16T04:06:02Z Terminated      Exit Code: 0                                                    
2022-06-16T04:06:02Z Restarting      Task restarting in 1.044881298s                                 
2022-06-16T04:06:08Z Started         Task started by client                                          
2022-06-16T04:06:10Z Terminated      Exit Code: 0                                                    
2022-06-16T04:06:10Z Restarting      Task restarting in 1.093170026s                                 
2022-06-16T04:06:17Z Started         Task started by client                                          
2022-06-16T04:06:19Z Terminated      Exit Code: 0                                                    
2022-06-16T04:06:19Z Not Restarting  Exceeded allowed attempts 2 in interval 5m0s and mode is "fail" 
2022-06-16T04:06:19Z Alloc Unhealthy Unhealthy because of failed task                                

Recent Logs
2022-06-16T04:05:59.000 [info] Starting virtual machine
2022-06-16T04:06:00.000 [info] Starting init (commit: e21acb3)...
2022-06-16T04:06:00.000 [info] Preparing to run: `bash` as app
2022-06-16T04:06:00.000 [info] 2022/06/16 04:06:00 listening on [fdaa:0:6f7c:a7b:a45c:b8:e6a:2]:22 (DNS: [fdaa::3]:53)
2022-06-16T04:06:01.000 [info] Main child exited normally with code: 0
2022-06-16T04:06:01.000 [info] Starting clean up.
2022-06-16T04:06:07.000 [info] Starting instance
2022-06-16T04:06:07.000 [info] Configuring virtual machine
2022-06-16T04:06:07.000 [info] Pulling container image
2022-06-16T04:06:07.000 [info] Unpacking image
2022-06-16T04:06:07.000 [info] Preparing kernel init
2022-06-16T04:06:08.000 [info] Configuring firecracker
2022-06-16T04:06:08.000 [info] Starting virtual machine
2022-06-16T04:06:08.000 [info] Starting init (commit: e21acb3)...
2022-06-16T04:06:08.000 [info] Preparing to run: `bash` as app
2022-06-16T04:06:08.000 [info] 2022/06/16 04:06:08 listening on [fdaa:0:6f7c:a7b:a45c:b8:e6a:2]:22 (DNS: [fdaa::3]:53)
2022-06-16T04:06:09.000 [info] Main child exited normally with code: 0
2022-06-16T04:06:09.000 [info] Starting clean up.
2022-06-16T04:06:15.000 [info] Starting instance
2022-06-16T04:06:15.000 [info] Configuring virtual machine
2022-06-16T04:06:15.000 [info] Pulling container image
2022-06-16T04:06:16.000 [info] Unpacking image
2022-06-16T04:06:16.000 [info] Preparing kernel init
2022-06-16T04:06:16.000 [info] Configuring firecracker
2022-06-16T04:06:17.000 [info] Starting virtual machine
2022-06-16T04:06:17.000 [info] Starting init (commit: e21acb3)...
2022-06-16T04:06:17.000 [info] Preparing to run: `bash` as app
2022-06-16T04:06:17.000 [info] 2022/06/16 04:06:17 listening on [fdaa:0:6f7c:a7b:a45c:b8:e6a:2]:22 (DNS: [fdaa::3]:53)
2022-06-16T04:06:18.000 [info] Main child exited normally with code: 0
2022-06-16T04:06:18.000 [info] Starting clean up.
***v0 failed - Failed due to unhealthy allocations - no stable job version to auto revert to and deploying as v1 

Troubleshooting guide at https://fly.io/docs/getting-started/troubleshooting/
Error abort

Those logs make me think that the cmd in the [experimental] section of the fly.toml either isn’t present or isn’t working.

As a workaround, does the app deploy if you add a CMD to the Dockerfile?

No luck. The code is here: GitHub - fly-apps/hello-rust: Rust example app on Fly.io if you’d like to try it locally.

hmm. So I did get this to work by adding CMD ./hello to the Dockerfile and removing the [experimental] section from the fly.toml, both by deploying with --remote-only and also by building locally and pushing the image.

if that doesn’t work for you, would you mind running the deploy with LOG_LEVEL=debug?