Re: Application only starts when a bogus service is attached


Daniel Mikusa
 

On Fri, Sep 4, 2015 at 4:32 AM, Ramon Makkelie <ramon.makkelie(a)klm.com>
wrote:

we have some application that since our upgrade from 207 to 214 would not
run
What version of the Java build pack do you have installed? `cf
buildpacks`? What does your `cf push` command & manifest.yml look like?



If I push an app (java web/ Spring) on cf without any services, CF loop on
the push and sometime at the end (10 or 15minutes) the app running or not.

I have this trace in the events :

2015-08-26T13:19:28.00+0200 app.crash pocretform
index: 0, reason: CRASHED, exit_description: failed to accept
connections within health check timeout, exit_status: -1
2015-08-26T13:18:10.00+0200 app.crash pocretform
index: 0, reason: CRASHED, exit_description: failed to accept
connections within health check timeout, exit_status: -1
2015-08-26T13:16:48.00+0200 app.crash pocretform
index: 0, reason: CRASHED, exit_description: failed to accept
connections within health check timeout, exit_status: -1

and in the stdout :

2015-08-26T13:16:48.00+0200 [DEA/8] ERR Instance (index 0) failed to
start accepting connections

If I bind a fake service (like mongo), the app is pushed without any
problem
What do you mean by "fake"? Is it an actual service attached to a DB? Is
it a user provided service with no info?



and in the log (stdout) I have :

2015-08-26T13:29:50.87+0200 [App/0] OUT [CONTAINER]
org.apache.catalina.startup.HostConfig INFO Deployment of
web application directory
/home/vcap/app/.java-buildpack/tomcat/webapps/ROOT has finished in 6,502 ms
2015-08-26T13:29:50.87+0200 [App/0] OUT [CONTAINER]
org.apache.coyote.http11.Http11NioProtocol INFO Starting
ProtocolHandler ["http-nio-61230"]
2015-08-26T13:29:50.88+0200 [App/0] OUT [CONTAINER]
org.apache.tomcat.util.net.NioSelectorPool INFO Using a shared
selector for servlet write/read
2015-08-26T13:29:50.88+0200 [App/0] OUT [CONTAINER]
org.apache.catalina.startup.Catalina INFO Server startup
in 6540 ms

This trace does not appear, if I unbind the service.
Some suggestions for troubleshooting...

1.) Run `cf logs <app>` in a second terminal. Then run `cf push`. After
the build pack completes, you should see a line that says CF is starting
the app. If you see no logging between that and the notice that the app
exited, you might try this. Sometimes when an app exits too fast, logging
is lost.

http://support.run.pivotal.io/entries/82506749-Help-My-app-is-crashing-and-I-don-t-see-any-thing-in-the-logs

2.) Because it's a Java app, you might also try this.

http://support.run.pivotal.io/entries/59869725-Java-Web-Applications-Slow-Startup-or-Failing

(sorry for the PWS links, those should be relevant for anyone running CF
though)



I have also tried to push the Tomcat demo app (
https://tomcat.apache.org/tomcat-6.0-doc/appdev/sample/), same behaviour.
So it's not our app problem
You might try the samples for Tomcat 8, since that's what the Java build
pack has been deploying for a while.

Dan

Join cf-dev@lists.cloudfoundry.org to automatically receive all group messages.