Skip to content

Sometimes health_check_http_endpoint parameter being ignored even when set, failing app update #446

Open
@erezdeveleap

Description

@erezdeveleap

Hey!

We have re-defined out health checks yesterday to use http and their relative endpoints, and run the deployment
I.e:

health_check_http_endpoint = "/health"
health_check_type          = "http"

The deployment ran on numerous spaces for the space services, in which some spaces the got update just fine, and others didnt, outputting:
Error: The app is invalid: health_check_http_endpoint HTTP health check endpoint is not a valid URI path:

In my attempt to debug, I noticed that sometimes the health_check_http_endpoint wasn't applied, even though it was set fine
positive example:

~ resource "cloudfoundry_app" "app" {
      ~ docker_image               = "..." -> "..."
      + health_check_http_endpoint = "/health"
      ~ health_check_type          = "process" -> "http"
        id                         = "..."
        name                       = "..."
        # (17 unchanged attributes hidden)

        # (1 unchanged block hidden)
    }

negative example:

~ resource "cloudfoundry_app" "app" {
    ~ docker_image               = "..." -> "..."
    ~ health_check_type          = "process" -> "http"
      id                         = "..."
      name                       = "client"
      # (17 unchanged attributes hidden)
      # (1 unchanged block hidden)
  }

Looking at the tfstate, looks like it did configured it OK, however running cf get-health-check <APP> shows:

Getting health check type for...

health check type:          process
endpoint (for http type):

So now the state has "/health" and since it's not changing when I re-deploy, it won't add the endpoint - and continue to fail with the same error

I thought it had something with d.HasChange("health_check_http_endpoint"), but I am not sure anymore..
The manual fix is to revert this change (in our case - go back to process), let it deploy OK, and then re-deploy with the hope it will pick these 3 again

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions