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.

- 121
- 1
- 1
- 5
-
and the exception: java.lang.IllegalStateException: LifecycleProcessor not initialized - call 'refresh' before invoking lifecycle methods via the context: – Csepi Feb 07 '16 at 12:13
3 Answers
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
-
7Alternatively, add `health-check-type: process` to your **manifest.yml**. Also, this seems to be the right answer. – Grant Lindsay Apr 05 '17 at 18:11
-
FYI: I was also able to resolve this error with the solution provided in this answer: `ERR Failed to make TCP connection to port 8080: connection refused when scaling instances` – Maximus2012 Jul 17 '18 at 20:27
-
If you already pushed your app and wanted to change `healthcheck` value then use [this command](https://cli.cloudfoundry.org/en-US/v6/set-health-check.html) – Parixit Oct 21 '22 at 13:53
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 to8080
, so if your application is not listening on8080
(or is bound to127.0.0.1
instead of0.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 havecf 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?

- 2,049
- 18
- 23
-
I followed this example: https://github.com/cloudfoundry-samples/hello-spring-cloud – Csepi Feb 07 '16 at 14:39
-
... without any services such as elephantsql, mondogdb, redis and I am using java build pack. After I gave more memory for my app instead of 512 M, 1024M and worked once but after a while terminated. – Csepi Feb 07 '16 at 14:45
-
-
You can't, which is why you normally don't want to set the `--no-route` option. Are you able to include the log output from PWS? – ipsi Feb 07 '16 at 14:54
-
In this case, you *must* bind a PostGres, RabbitMQ, MongoDB, and Redis service to the application. I will edit my answer with the actual solution to your problem. – ipsi Feb 07 '16 at 15:02
-
I really don't get it, I added manually the route condition and hasn't terminated yet. I try it with more complex apps. Remark: The host name from the cloud application info is 0.0.0.0 – Csepi Feb 07 '16 at 15:15
-
Yeah, I'm not quite sure what's going on with it. I added the same app (without services), and it crashed the first time it deployed. It got automatically restarted and worked the second time :-/ – ipsi Feb 07 '16 at 15:16
-
I removed the services from the app as I sad, but a I got this error as well. – Csepi Feb 07 '16 at 15:16
-
So is the application currently deployed with or without services? And are you able to access the application via your browser? – ipsi Feb 07 '16 at 15:17
-
-
2This is very likely a PWS problem. I boosted the timeout to 3 minutes, and observed things happening very, very slowly in the log files. I'd delete the app, reset all the config back to whatever you want originally and re-deploy. Even if it fails the first time, Cloud Foundry will auto-restart it until it works. – ipsi Feb 07 '16 at 15:34
-
-
I have deployed a eureka app into PWS and the eureka client didn't find the server. Locally works:) – Csepi Feb 07 '16 at 17:17
You can disable the health with the below command (Short term solution)
cf push app_name -p target/app.jar -u none

- 137
- 2
- 10