Application is healthy till the application.properties are bundled with app.
As a next step, moved properties to configs repo and created config-service in cloud foundry using below statement.
cf create-service -c '{ "git": { "uri": "https://bitbucket.company.com/scm/abcdefg/app-configs", "label": "master", "searchPaths": "TOPFOLDER/app-folder", "username": "abcdef", "password": "123456" } }' p-config-server standard company-appname-config-server
Then added dependency into my java app (build.gradle)
compile("io.pivotal.spring.cloud:spring-cloud-services-starter-config-client:${pivotalSpringCloud}")
compile("org.springframework.cloud:spring-cloud-dependencies:Camden.SR4")
Re-deployed and application came up healthy with the right properties. In the logs i see
2017-04-24T08:10:48.16-0500 [APP/PROC/WEB/0]OUT 2017-04-24 13:10:48.162 INFO 19 --- [ main] c.c.c.ConfigServicePropertySourceLocator : Fetching config from server at: https://config-d45c8d75-67f0-4031-804a-3a23cb139b4a.company.com
Application is up in less than 20secs. Here are the logs (increased the healthchecktimeout to 180 from default).
2017-04-24T08:07:56.67-0500 [APP/PROC/WEB/0]OUT 2017-04-24 13:07:56.670 INFO 14 --- [ main] o.s.i.a.i.AmqpInboundChannelAdapter : started inbound
2017-04-24T08:07:56.67-0500 [APP/PROC/WEB/0]OUT 2017-04-24 13:07:56.670 INFO 14 --- [ main] o.s.c.support.DefaultLifecycleProcessor : Starting beans in phase 2147483647
2017-04-24T08:07:56.74-0500 [APP/PROC/WEB/0]OUT 2017-04-24 13:07:56.742 INFO 14 --- [ main] s.b.c.e.t.TomcatEmbeddedServletContainer : Tomcat started on port(s): 8008 (http)
2017-04-24T08:07:56.74-0500 [APP/PROC/WEB/0]OUT Running as daemon
2017-04-24T08:07:56.75-0500 [APP/PROC/WEB/0]OUT 2017-04-24 13:07:56.752 INFO 14 --- [ main] c.company.app.MainApplication : Started CoordinatorBotApplication in 16.636 seconds (JVM running for 17.211)
2017-04-24T08:08:06.91-0500 [APP/PROC/WEB/0]OUT 2017-04-24 13:08:06.915 DEBUG 14 --- [ask-scheduler-1] heduler$$EnhancerBySpringCGLIB$$cbc32e8f : []
2017-04-24T08:09:37.08-0500 [APP/PROC/WEB/0]OUT 2017-04-24 13:09:37.086 DEBUG 14 --- [ask-scheduler-1] heduler$$EnhancerBySpringCGLIB$$cbc32e8f : []
2017-04-24T08:10:40.65-0500 [CELL/0] ERR Timed out after 3m0s: health check never passed.
2017-04-24T08:10:40.65-0500 [CELL/0] OUT Exit status 0
2017-04-24T08:10:40.66-0500 [APP/PROC/WEB/0]OUT 2017-04-24 13:10:40.660 INFO 14 --- [ Thread-4] ationConfigEmbeddedWebApplicationContext : Closing org.springframework.boot.context.embedded.AnnotationConfigEmbeddedWebApplicationContext@5ae9a829: startup date [Mon Apr 24 08:07:44 CDT 2017]; parent: org.springframework.context.annotation.AnnotationConfigApplicationContext@15327b79 }
After the shutdown logs i see this error which follows with again creating a container.
2017-04-24T08:10:40.76-0500 [APP/PROC/WEB/0]OUT 2017-04-24 13:10:40.762 INFO 14 --- [ Thread-4] j.LocalContainerEntityManagerFactoryBean : Closing JPA EntityManagerFactory for persistence unit 'default'
2017-04-24T08:10:41.17-0500 [APP/PROC/WEB/0]OUT Exit status 143
2017-04-24T08:10:41.18-0500 [CELL/0] OUT Destroying container
2017-04-24T08:10:41.20-0500 [API/1] OUT Process has crashed with type: "web"
2017-04-24T08:10:41.21-0500 [API/1] OUT App instance exited with guid dc395017-3770-4617-a439-2a0fd5fb6dda payload: {"instance"=>"", "index"=>0, "reason"=>"CRASHED", "exit_description"=>"2 error(s) occurred:\n\n* 1 error(s) occurred:\n\n* Exited with status 4\n* 2 error(s) occurred:\n\n* cancelled\n* cancelled", "crash_count"=>1, "crash_timestamp"=>1493039441179549849, "version"=>"246e48d2-45fe-47ed-a1ee-d4b05bd6599e"}
2017-04-24T08:10:41.22-0500 [CELL/0] OUT Creating container
Any suggestions ? Doing somthing wrong ? Any ways i can get further debug details ?
Resolved.
The issue was related to specific port number i was trying to use using boot properties.
Initially I was running this application standalone (and since i had multiple boot applications, I was planning to run each application on specific ports.)
But in PCF, we dont need specific port, since each app runs on its container with different unique route(component+domain).
Removing the specific port - resolved my issue