Blue green deployment failing: 'bg_deployments_http' has invalid or missing port

I am trying to switch the deployment from rolling to blue green for my Shopify app hosted on fly.io (deploying using Github Actions). Here is the current configuration

app = 'myApp'
primary_region = 'region'

[build]

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

[[services.http_checks]]
  interval = 10000
  grace_period = "5s"
  method = "GET"
  path = "/check"
  protocol = "http"
  port = 3000
  timeout = 2000
  tls_skip_verify = false



[[vm]]
  cpu_kind = 'shared'
  cpus = 1
  memory_mb = 1024

[deploy]
  strategy = "bluegreen"

But it is failing with the following error

Updating existing machines in 'myApp' with bluegreen strategy
Creating green machines
Deployment failed after error: failed to create green machines: failed to launch VM: Check 'bg_deployments_http' has invalid or missing port
Checking DNS configuration for myApp.dev
Error: failed to create green machines: failed to launch VM: Check 'bg_deployments_http' has invalid or missing port (Request ID: XXX)

I am trying to find out what bg_deployments_http is, and wondering what I am missing in my configuration.

Hi @Kiyo921—I think that the [[services.http_checks]] line implicitly defines a new (empty) [[services]] section, rather than applying to the [http_service] above it. I believe that replacing it with [[http_service.checks]] should do what you want.

Thank you for the reply. Do you mean this?

[[http_service.checks]]
  internal_port = 3000
  force_https = true
  auto_stop_machines = true
  auto_start_machines = true
  min_machines_running = 1
  processes = ['app']

[[http_service.http_checks]]
  interval = 10000
  grace_period = "5s"
  method = "GET"
  path = "/check"
  protocol = "http"
  port = 3000
  timeout = 2000
  tls_skip_verify = false

This still give " Deployment failed after error: failed to create green machines: failed to launch VM: Check ‘bg_deployments_http’ has invalid or missing port"

This config worked for me (sharing for anyone who faced the same issue)! Thank you for your help!

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

[[http_service.checks]]
  interval = "2s"
  grace_period = "5s"
  method = "GET"
  path = "/check"
  protocol = "http"
  port = 3000
  timeout = "2s"
  tls_skip_verify = false
1 Like

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