Rails aplication timeout reached waiting for health checks to pass for machine

Hello! I’m trying to deploy my app and I’m having this issue :point_down:

-------
 ✖ Failed: timeout reached waiting for health checks to pass for machine 3d8d9563f49d08: failed to get VM 3d8d9563f49d08: Get "https://api…
-------
Checking DNS configuration for ecommerce-ruby.fly.dev
Error: timeout reached waiting for health checks to pass for machine 3d8d9563f49d08: failed to get VM 3d8d9563f49d08: Get "https://api.machines.dev/v1/apps/ecommerce-ruby/machines/3d8d9563f49d08": net/http: request canceled
Your machine never reached the state "%s".

Here is the fly.toml :point_down:


# fly.toml app configuration file generated for ecommerce-ruby on 2024-02-14T12:33:38-05:00
#
# See https://fly.io/docs/reference/configuration/ for information about how to use this file.
#

app = 'ecommerce-ruby'
primary_region = 'mia'
console_command = '/rails/bin/rails console'

[build]

[deploy]
  release_command = './bin/rails db:prepare'

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

[checks]
  [checks.status]
    port = 3000
    type = 'http'
    interval = '10s'
    timeout = '2s'
    grace_period = '5s'
    method = 'GET'
    path = '/up'
    protocol = 'http'
    tls_skip_verify = false

    [checks.status.headers]
      X-Forwarded-Proto = 'https'

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

[[statics]]
  guest_path = '/rails/public'
  url_prefix = '/'

I have use the --wait-timeout flag fly deploy --wait-timeout=15m :point_down:

fly deploy --wait-timeout=15m
==> Verifying app config
Validating /home/franclobo/microverse/ecommerce_ruby/fly.toml
✓ Configuration is valid
--> Verified app config
==> Building image
Remote builder fly-builder-wispy-feather-7622 ready
Remote builder fly-builder-wispy-feather-7622 ready
==> Building image with Docker
--> docker host: 20.10.12 linux x86_64
[+] Building 19.3s (21/21) FINISHED                                                                                                          
 => [internal] load build definition from Dockerfile                                                                                    2.2s
 => => transferring dockerfile: 32B                                                                                                     2.2s
 => [internal] load .dockerignore                                                                                                       2.2s
 => => transferring context: 35B                                                                                                        2.2s
 => resolve image config for docker.io/docker/dockerfile:1                                                                              0.3s
 => CACHED docker-image://docker.io/docker/dockerfile:1@sha256:ac85f380a63b13dfcefa89046420e1781752bab202122f8f50032edf31be0021         0.0s
 => [internal] load build definition from Dockerfile                                                                                    0.0s
 => [internal] load metadata for registry.docker.com/library/ruby:3.2.2-slim                                                            1.7s
 => [internal] load .dockerignore                                                                                                       0.0s
 => [internal] load build context                                                                                                       1.6s
 => => transferring context: 24.29kB                                                                                                    1.6s
 => [base 1/2] FROM registry.docker.com/library/ruby:3.2.2-slim@sha256:b1b1636eb4e9d3499fc6166f54f7bb96d792e005b887091346fd1ae01ad9722  0.0s
 => CACHED [base 2/2] WORKDIR /rails                                                                                                    0.0s
 => CACHED [build 1/6] RUN apt-get update -qq &&     apt-get install --no-install-recommends -y build-essential git libpq-dev libvips   0.0s
 => CACHED [build 2/6] COPY Gemfile Gemfile.lock ./                                                                                     0.0s
 => CACHED [build 3/6] RUN bundle install &&     rm -rf ~/.bundle/ "/usr/local/bundle"/ruby/*/cache "/usr/local/bundle"/ruby/*/bundler  0.0s
 => [build 4/6] COPY . .                                                                                                                0.1s
 => [build 5/6] RUN bundle exec bootsnap precompile app/ lib/                                                                           1.0s
 => [build 6/6] RUN SECRET_KEY_BASE_DUMMY=1 ./bin/rails assets:precompile                                                               5.7s
 => CACHED [stage-2 1/4] RUN apt-get update -qq &&     apt-get install --no-install-recommends -y curl libvips postgresql-client &&     0.0s
 => CACHED [stage-2 2/4] COPY --from=build /usr/local/bundle /usr/local/bundle                                                          0.0s
 => [stage-2 3/4] COPY --from=build /rails /rails                                                                                       0.7s
 => [stage-2 4/4] RUN useradd rails --create-home --shell /bin/bash &&     chown -R rails:rails db log storage tmp                      3.0s
 => exporting to image                                                                                                                  0.8s
 => => exporting layers                                                                                                                 0.8s
 => => writing image sha256:f60f843bbd8ef14e31117f1a6d5b1fbaf84027390abe5528cc1be076c1c97ba4                                            0.0s
 => => naming to registry.fly.io/ecommerce-ruby:deployment-01HPMAXN19A9B0J6YKM4Y69229                                                   0.0s
--> Building image done
==> Pushing image to fly
The push refers to repository [registry.fly.io/ecommerce-ruby]
0d50d51c17f3: Pushed 
daee39da6c15: Pushed 
c25669cfc65e: Pushed 
99bdb9a86090: Pushed 
8cd55b3db8ff: Pushed 
5997bcc5c659: Pushed 
bc7ab3c53adb: Pushed 
8ce475735ec6: Pushed 
d349c55f562a: Pushed 
571ade696b26: Pushed 
deployment-01HPMAXN19A9B0J6YKM4Y69229: digest: sha256:1620079bdd160088c54beece75176acbf4e992aaf4e1a98817b0bb0803d41dbd size: 2421
--> Pushing image done
image: registry.fly.io/ecommerce-ruby:deployment-01HPMAXN19A9B0J6YKM4Y69229
image size: 590 MB

Watch your deployment at https://fly.io/apps/ecommerce-ruby/monitoring

INFO Using wait timeout: 15m0s lease timeout: 13s delay between lease refreshes: 4s

Provisioning ips for ecommerce-ruby
  Dedicated ipv6: 2a09:8280:1::2a:b95c:0
  Shared ipv4: 66.241.125.34
  Add a dedicated ipv4 with: fly ips allocate-v4

Running ecommerce-ruby release_command: ./bin/rails db:prepare

-------
 ✔ release_command 178113d9c10748 completed successfully
-------
This deployment will:
 * create 2 "app" machines

No machines in group app, launching a new machine
2024/02/14 12:48:49 traces export: context deadline exceeded: rpc error: code = DeadlineExceeded desc = context deadline exceeded
WARN failed to release lease for machine 3d8d9563f49d08: lease not found
-------

-------
 ✖ Failed: timeout reached waiting for health checks to pass for machine 3d8d9563f49d08: failed to get VM 3d8d9563f49d08: Get "https://api…
-------
Checking DNS configuration for ecommerce-ruby.fly.dev
Error: timeout reached waiting for health checks to pass for machine 3d8d9563f49d08: failed to get VM 3d8d9563f49d08: Get "https://api.machines.dev/v1/apps/ecommerce-ruby/machines/3d8d9563f49d08": net/http: request canceled
Your machine never reached the state "%s".

You can try increasing the timeout with the --wait-timeout flag

What does fly logs for the app look like?

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.