Csepi
Csepi

Reputation: 121

Cloud foundry: ERR Timed out after 1m0s: health check never passed

After I deployed my app into cloud foundry got the following error message: ERR Timed out after 1m0s: health check never passed. Of course on my local machine works perfectly.

Upvotes: 11

Views: 28729

Answers (3)

Santosh Rachakonda
Santosh Rachakonda

Reputation: 143

You can disable the health with the below command (Short term solution)

cf push app_name -p target/app.jar -u none

Upvotes: 1

Yarix
Yarix

Reputation: 1301

You should change your health check type. if the application does not expose a Web interface you need to change the healthcheck type to process. Valid values are port, process, and http.

To configure a health check while creating or updating an application, use the cf push command:

$ cf push YOUR-APP -u process

See the Health Check doc for more information: https://docs.cloudfoundry.org/devguide/deploy-apps/healthchecks.html

Upvotes: 26

ipsi
ipsi

Reputation: 2070

Based on the discussion in the comments and my own testing of the actual application you are deploying, it appears that this particular app takes an age to start. Possibly related to individual Java service timeouts (as you have not bound any CF services to the application).

Anyway, while I'm not sure what the actual problem is (possibly an issue with PWS itself), this can be sort-of worked around by specifying the -t option when doing a push, or adding the timeout: <int> attribute to the manifest (see the manifest documentation.


OLD ANSWER

Need more details to be sure, but I imagine one of two things are happening:

  • You are not using the correct port. Cloud Foundry exposes the port it expects the application to be deployed using the PORT (or, pre-Diego, VCAP_APP_PORT) environment variable. This defaults to 8080, so if your application is not listening on 8080 (or is bound to 127.0.0.1 instead of 0.0.0.0), then the health check will fail.
  • Your application does not expose any API endpoints, and should be deployed with the --no-route option on CF, and (starting with Diego) needs to have cf set-health-check [app-name] executed against it. This should only be done if your application genuinely does not need a health check.

Some build packs can take care of the first automatically for you. Which build pack are you using? Or, alternatively, which language are you using?

Upvotes: 7

Related Questions