Failed due to unhealthy allocations - Remix - Blues Stack

Reading all the help articles on this topic.

This a is a Remix (Blues Stack) app using postgres. I have followed all the documentation on the Remix repo: GitHub - remix-run/blues-stack: The Remix Stack for deploying to Fly with PostgreSQL, authentication, testing, linting, formatting, etc.

Any ideas?

flyctl status -all

Name     = pharmicated-apparel          
  Owner    = personal                     
  Version  = 10                           
  Status   = running                      
  Hostname = apparel.fly.dev  

Deployment Status
  ID          = aeb9d083-984b-3021-738c-d1cb39f677a1                                           
  Version     = v10                                                                            
  Status      = failed                                                                         
  Description = Failed due to unhealthy allocations - no stable job version to auto revert to  
  Instances   = 1 desired, 1 placed, 0 healthy, 1 unhealthy                                    

Instances
ID              PROCESS VERSION REGION  DESIRED STATUS          HEALTH CHECKS           RESTARTS        CREATED    
62c8027d        app     10 ⇡    dfw     stop    running         1 total, 1 critical     0               5m25s ago 
bc4d4df3        app     9       dfw     stop    complete        1 total, 1 critical     0               48m31s ago
1a016b97        app     8       dfw     stop    complete        1 total, 1 critical     0               1h23m ago 
a71d9f3c        app     7       dfw     run     running         1 total, 1 critical     0               1h41m ago 
b27fb10a        app     6       dfw     stop    failed          1 total                 2               1h49m ago 
543a4780        app     5       dfw     stop    failed          1 total, 1 critical     2               1h54m ago 
94b4f27e        app     4       dfw     stop    failed          1 total                 2               1h57m ago 
f779fb71        app     3       dfw     stop    failed          1 total, 1 critical     2               2h19m ago 
5da68862        app     2       dfw     stop    failed          1 total                 2               2h58m ago 
241ffeef        app     1       dfw     stop    failed          1 total                 2               3h58m ago 
6dec7d91        app     0       dfw     stop    failed          1 total                 2               4h0m ago

flyctl checks list

Health Checks for -apparel
  NAME                             | STATUS   | ALLOCATION | REGION | TYPE | LAST UPDATED | OUTPUT                                                      
-----------------------------------*----------*------------*--------*------*--------------*-------------------------------------------------------------
  3df2415693844068640885b45074b954 | critical | a71d9f3c   | dfw    | TCP  | 1h57m ago    | dial tcp 172.19.13.18:8080: connect: connection refused[✓]  
                                   |          |            |        |      |              |                                                             
                                   |          |            |        |      |              |

flyctl logs -i 62c8027d

2022-11-02T22:09:52Z runner[62c8027d] dfw [info]Starting instance
2022-11-02T22:09:54Z runner[62c8027d] dfw [info]Configuring virtual machine
2022-11-02T22:09:54Z runner[62c8027d] dfw [info]Pulling container image
2022-11-02T22:09:57Z runner[62c8027d] dfw [info]Unpacking image
2022-11-02T22:10:04Z runner[62c8027d] dfw [info]Preparing kernel init
2022-11-02T22:10:05Z runner[62c8027d] dfw [info]Configuring firecracker
2022-11-02T22:10:05Z runner[62c8027d] dfw [info]Starting virtual machine
2022-11-02T22:10:05Z app[62c8027d] dfw [info]Starting init (commit: ce4cf1b)...
2022-11-02T22:10:05Z app[62c8027d] dfw [info]Preparing to run: `docker-entrypoint.sh npm start` as root
2022-11-02T22:10:05Z app[62c8027d] dfw [info]2022/11/02 22:10:05 listening on [fdaa:0:52e7:a7b:9f67:62c8:27d:2]:22 (DNS: [fdaa::3]:53)
2022-11-02T22:10:06Z app[62c8027d] dfw [info]> start
2022-11-02T22:10:06Z app[62c8027d] dfw [info]> cross-env NODE_ENV=production node ./build/server.js
2022-11-02T22:10:07Z app[62c8027d] dfw [info]🔌 setting up prisma client to dfw.top2.nearest.of.-apparel-db.internal:5432
2022-11-02T22:10:09Z app[62c8027d] dfw [info]✅ app ready: http://localhost:3000
2022-11-02T22:15:07Z runner[62c8027d] dfw [info]Shutting down virtual machine
2022-11-02T22:15:07Z app[62c8027d] dfw [info]Sending signal SIGINT to main child process w/ PID 520

Hey, it looks like you’re not telling fly to stay awake and listen to that specific port. I’d recommend having your server listen on port 8080, and updating the services section in your fly.toml file, see below for examples on how to do this

change port

module.exports = {
  devServerPort: 8080
  ...
};

add services section

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

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

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

@shortdiv thank you for the reply.

My fly.toml file is already listening on that port:

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"

Your server is listening on port 3000 from your logs, can you add this to the [env] bit?

[env]
PORT=8080

We recently improved our CLI to make that just work next time when there’s a FlyCTL release:

@lubien that was the issue. Thank you!

1 Like