Groups keyboard shortcuts have been updated
Dismiss
See shortcuts

cf-mysql-java-broker service instance prevents application from staging

46 views
Skip to first unread message

mana

unread,
May 5, 2014, 11:09:21 AM5/5/14
to vcap...@cloudfoundry.org
Hey,

The broker basically works (creating/deleting/binding of services). 

.. but! I have a java application that fails to stage when a service of this broker is bound. That app works perfectly fine with an user provided service for mysql.

2014-05-05T17:01:52.02+0200 [DEA]     OUT Stopped app instance (index 0) with guid db7c3ade-7887-4a33-b066-15d809f1007e
2014-05-05T17:02:04.01+0200 [API]     OUT Updated app with guid db7c3ade-7887-4a33-b066-15d809f1007e ({"name"=>"example-project", "buildpack"=>"https://github.com/cloudfoundry/java-buildpack.git"})
2014-05-05T17:02:10.82+0200 [API]     OUT Updated app with guid db7c3ade-7887-4a33-b066-15d809f1007e ({"state"=>"STOPPED"})
2014-05-05T17:02:11.26+0200 [DEA]     OUT Got staging request for app with id db7c3ade-7887-4a33-b066-15d809f1007e
2014-05-05T17:02:12.05+0200 [API]     OUT Updated app with guid db7c3ade-7887-4a33-b066-15d809f1007e ({"state"=>"STARTED"})
2014-05-05T17:02:12.17+0200 [STG]     OUT -----> Downloaded app package (8.4M)
2014-05-05T17:02:12.54+0200 [STG]     OUT -----> Downloaded app buildpack cache (40M)
2014-05-05T17:02:12.57+0200 [API]     ERR Encountered error: Staging error: failed to stage application:
2014-05-05T17:02:12.57+0200 [API]     ERR undefined method `[]' for nil:NilClass

This is a java (spring boot) app that is run with the default java buildpack (https://github.com/cloudfoundry/java-buildpack.git). Has anyone a hint on how to debug the staging process to find out what is happening here? The CF_TRACE doen't provide useful information I fear.

Thanks in advance,
mana

James Bayer

unread,
May 5, 2014, 11:23:31 AM5/5/14
to vcap...@cloudfoundry.org
you can turn on debugging in the java buildpack as described here [1]. however, it looks like the buildpack isn't actually even starting and that the problem is sooner. i wonder if you getting poorly formed json responses back from the service instance binding? i think you can explore this with cf curl.



To unsubscribe from this group and stop receiving emails from it, send an email to vcap-dev+u...@cloudfoundry.org.



--
Thank you,

James Bayer

Daniel Mikusa

unread,
May 5, 2014, 11:25:43 AM5/5/14
to vcap...@cloudfoundry.org
Is there a full stack trace provided or just this? "ERR undefined method `[]' for nil:NilClass”

If it’s an issue with the build pack, you could try these steps to get more info from the build pack.

https://github.com/cloudfoundry/java-buildpack/blob/master/docs/extending-logging.md

Also, what version of CF are you targeting?

Dan

Ben Hale

unread,
May 6, 2014, 3:50:19 AM5/6/14
to vcap...@cloudfoundry.org
Mana,

You can generate a full stack trace (along with a host of other debugging information) by turning on debug logging.  To do this run the following commands:

cf set-env JBP_LOG_LEVEL DEBUG
cf push
<YOUR-PUSH-ARGUMENTS>

When you get that output, there are two bits that will help us figure out what the problem is.  The first will be right at the top and describes the version of the buildpack.  It will look like the following:

-----> Java Buildpack Version: v2.1.2 | https://github.com/nebhale/java-buildpack.git#074fd9a

The second will be the full stack trace at the bottom of the output.  The buildpack is system tested (every two hours) against a MySQL service.  We test on https://run.pivotal.io so it's actually against the AppDirect service broker, not the cloudfoundry-community broker.  If you can get us some output from what you're seeing we'll be able to decide where any needed fixes will go.


-Ben Hale
Cloud Foundry Java Experience

mana

unread,
May 6, 2014, 5:17:23 AM5/6/14
to vcap...@cloudfoundry.org
This is not caused by the buildpack. I also tried a nginx based "app" and experienced the same effect. Still not sure on how to debug errors that occur so early in the staging -- or even before the staging -- process.

The service broker seems not to be invoked when starting an app with a service created by it. The service credentials are stored in the CCDB or in the CC if I remember correctly. 
The model and JSON-mapping part of the mentioned cf-mysql-service-broker I have not touched. I guess the problem is within the service broker as Daniel mentioned. Let's close this issue.
Reply all
Reply to author
Forward
0 new messages