dokku / docker-container-healthchecker

Runs healthchecks against local docker containers
BSD 3-Clause "New" or "Revised" License
16 stars 4 forks source link

healthcheck with initialDelay: 120 do not wait 120 seconds, just bails out immediately #97

Closed cyberimp closed 1 year ago

cyberimp commented 1 year ago

Description of problem

My app creates cache from remote webserver with slow db before serving requests, so healthcheck need to wait for ~2 mins before checking, but it just fails with error without wait, old CHECKS was working correctly btw

Steps to reproduce

{
  "healthchecks": {
    "web": [
      {
        "type": "startup",
        "name": "ready check",
        "description": "Checking if the app responds to the /hi endpoint",
        "initialDelay": 120,
        "timeout": 200,
        "path": "/hi",
        "content": "Hi",
        "attempts": 1
      }
    ]
  }
}

docker-container-healthchecker version

0.6.4

Output of failing command

remote: -----> Deploying web (count=1)        
remote:        Attempting pre-flight checks (web.1)        
remote: -----> Executing 1 healthchecks                                                                
remote:        Running healthcheck name='ready check' delay=120 path='/hi' retries=0 timeout=200 type='path'        
remote:  !     Failure in name='ready check': Get "http://172.17.0.3:5000/hi": dial tcp 172.17.0.3:5000: connect: connection refused        
remote: 523965d64289ae9533659fb92f7f6e63c4e05c5df1ec73be76ab777bbc78c905        
remote:  !     Could not start due to 1 failed checks (web.1)
josegonzalez commented 1 year ago

Ah I found an issue. I inverted the wait check. I'll fix that now :)