joshlong-attic/service-registration-and-discovery

Deployment to run.pivotal.io fails

jtuchscherer opened this issue · 2 comments

I am running the cf.sh script and all the services get created successfully. But the passport service fails to start correctly. In the logs I actually see it come up, but it shuts down right away:

[...]
2015-03-10T11:18:27.31+0100 [App/0]      OUT    XADataSourceAutoConfiguration
2015-03-10T11:18:27.32+0100 [App/0]      OUT 2015-03-10 10:18:27.325  INFO 31 --- [           main] s.c.a.AnnotationConfigApplicationContext : Refreshing org.springframework.context.annotation.AnnotationConfigApplicationContext@170195ea: startup date [Tue Mar 10 10:18:27 UTC 2015]; parent: org.springframework.context.annotation.AnnotationConfigApplicationContext@6f7c6c88
2015-03-10T11:18:27.61+0100 [App/0]      OUT 2015-03-10 10:18:27.619  INFO 31 --- [           main] c.netflix.config.ChainedDynamicProperty  : Flipping property: bookmark-service.ribbon.ActiveConnectionsLimit to use NEXT property: niws.loadbalancer.availabilityFilteringRule.activeConnectionsLimit = 2147483647
2015-03-10T11:18:27.68+0100 [App/0]      OUT 2015-03-10 10:18:27.681  INFO 31 --- [           main] c.netflix.loadbalancer.BaseLoadBalancer  : Client:bookmark-service instantiated a LoadBalancer:DynamicServerListLoadBalancer:{NFLoadBalancer:name=bookmark-service,current list of Servers=[],Load balancer stats=Zone stats: {},Server stats: []}ServerList:null
2015-03-10T11:18:27.71+0100 [App/0]      OUT 2015-03-10 10:18:27.714  INFO 31 --- [           main] c.netflix.config.ChainedDynamicProperty  : Flipping property: bookmark-service.ribbon.ActiveConnectionsLimit to use NEXT property: niws.loadbalancer.availabilityFilteringRule.activeConnectionsLimit = 2147483647
2015-03-10T11:18:27.71+0100 [App/0]      OUT 2015-03-10 10:18:27.718  INFO 31 --- [           main] c.n.l.DynamicServerListLoadBalancer      : DynamicServerListLoadBalancer for client bookmark-service initialized: DynamicServerListLoadBalancer:{NFLoadBalancer:name=bookmark-service,current list of Servers=[bookmark-service-nonbiographical-disafforestment.cfapps.io:80],Load balancer stats=Zone stats: {defaultzone=[Zone:defaultzone;   Instance count:1;   Active connections count: 0;    Circuit breaker tripped count: 0;   Active connections per server: 0.0;]
2015-03-10T11:18:27.71+0100 [App/0]      OUT },Server stats: [[Server:bookmark-service-nonbiographical-disafforestment.cfapps.io:80;    Zone:defaultZone;   Total Requests:0;   Successive connection failure:0;    Total blackout seconds:0;   Last connection made:Thu Jan 01 00:00:00 UTC 1970;  First connection made: Thu Jan 01 00:00:00 UTC 1970;    Active Connections:0;   total failure count in last (1000) msecs:0; average resp time:0.0;  90 percentile resp time:0.0;    95 percentile resp time:0.0;    min resp time:0.0;  max resp time:0.0;  stddev resp time:0.0]
2015-03-10T11:18:27.71+0100 [App/0]      OUT ]}ServerList:org.springframework.cloud.netflix.ribbon.eureka.DomainExtractingServerList@7cb78143
2015-03-10T11:18:27.79+0100 [App/0]      OUT 2015-03-10 10:18:27.790  INFO 31 --- [           main] com.netflix.http4.ConnectionPoolCleaner  : Initializing ConnectionPoolCleaner for NFHttpClient:bookmark-service
2015-03-10T11:18:27.86+0100 [App/0]      OUT 2015-03-10 10:18:27.864  INFO 31 --- [           main] com.netflix.http4.ConnectionPoolCleaner  : Initializing ConnectionPoolCleaner for NFHttpClient:bookmark-service
2015-03-10T11:18:28.12+0100 [App/0]      OUT Bookmark{id=2, href='http://some-other-hostjlong.com/', label='jlong', description='A description for jlong's link', userId='jlong'}
2015-03-10T11:18:28.15+0100 [App/0]      OUT Bookmark{id=1, href='http://some-other-hostmstine.com/', label='mstine', description='A description for mstine's link', userId='mstine'}
2015-03-10T11:18:28.18+0100 [App/0]      OUT org.springframework.cloud.netflix.eureka.EurekaDiscoveryClient$EurekaServiceInstance@4e1231a5[instance=com.netflix.appinfo.InstanceInfo@b8ee954f]
2015-03-10T11:18:28.18+0100 [App/0]      OUT org.springframework.cloud.netflix.eureka.EurekaDiscoveryClient$EurekaServiceInstance@68019ddf[instance=com.netflix.appinfo.InstanceInfo@116b67da]
2015-03-10T11:18:28.18+0100 [App/0]      OUT 2015-03-10 10:18:28.182  INFO 31 --- [           main] passport.Application                     : Started Application in 6.954 seconds (JVM running for 7.874)
2015-03-10T11:18:28.18+0100 [App/0]      OUT 2015-03-10 10:18:28.183  INFO 31 --- [       Thread-2] s.c.a.AnnotationConfigApplicationContext : Closing org.springframework.context.annotation.AnnotationConfigApplicationContext@6c9c8d26: startup date [Tue Mar 10 10:18:22 UTC 2015]; root of context hierarchy
2015-03-10T11:18:28.18+0100 [App/0]      OUT 2015-03-10 10:18:28.184  INFO 31 --- [       Thread-2] s.c.a.AnnotationConfigApplicationContext : Closing org.springframework.context.annotation.AnnotationConfigApplicationContext@6f7c6c88: startup date [Tue Mar 10 10:18:23 UTC 2015]; parent: org.springframework.context.annotation.AnnotationConfigApplicationContext@6c9c8d26
2015-03-10T11:18:28.18+0100 [App/0]      OUT 2015-03-10 10:18:28.186  INFO 31 --- [       Thread-2] o.s.c.support.DefaultLifecycleProcessor  : Stopping beans in phase 0
2015-03-10T11:18:28.18+0100 [App/0]      OUT 2015-03-10 10:18:28.189  INFO 31 --- [       Thread-4] c.n.l.DynamicServerListLoadBalancer      : Shutting down the Executor Pool for DynamicServerListLoadBalancer
2015-03-10T11:18:28.23+0100 [App/0]      OUT 2015-03-10 10:18:28.230  INFO 31 --- [       Thread-2] com.netflix.discovery.DiscoveryClient    : DiscoveryClient_PASSPORT-SERVICE/passport-service-imbibitional-pinetum.cfapps.io - deregister  status: 404
[...]

The eureka services seems fine, although it is hard to tell since its log output is dominated by its failing attempts to connect to the replica server running on localhost. Is that maybe relevant to the failure of the passport app?

Ok, I had some time last night to look into this and actually noticed that the Application class in the passport service is not a Web App anymore. It used to be in a previous version. If I understand it correctly, the passport app (in its current state) is not meant to be pushed to Cloud Foundry.

I created a fork that changed the passport service back to a Web App and all works as intended.

thank u for your tips,I commented out code
// .web(false)
it works