Search code examples
javacloud-foundrybuildpack

cloudfoundry buildpack compilation failed


I downloaded the cf java buildpack zip from https://github.com/cloudfoundry/java-buildpack and unzipped it(on a windows 7 machine). I made some changes and created a custom buildpack by creating a zip file(By simply compressing to zip and not using buildpack packager). Now my app deployment is failing with error:

2017-05-23T15:14:03.19+0000 [STG/17] OUT -----> Downloaded app package (59M) 2017-05-23T15:14:03.36+0000 [STG/0] OUT Staging failed: Buildpack compilation step failed 2017-05-23T15:14:03.36+0000 [STG/0] ERR 2017-05-23T15:14:03.46+0000 [API/0] ERR encountered error: App staging failed in the buildpack compile phase

These are the only error logs even after setting CF_TRACE=true. Please suggest how to see more descriptive logs on buildpack compilation or any tool which may help in debugging. Thanks in advance.


Solution

  • I made some changes and created a custom buildpack by creating a zip file(By simply compressing to zip and not using buildpack packager).

    Don't do that. If you need a build pack to upload to your CF foundation, then use the instructions here to build a proper build pack.

    https://github.com/cloudfoundry/java-buildpack/#building-packages

    Brief Instructions:

    1. Install Ruby
    2. git clone https://github.com/cloudfoundry/java-buildpack.git
    3. cd java-buildpack
    4. git checkout <version> ex: git checkout v3.16
    5. bundle install
    6. bundle exec rake clean package for a version without dependencies or bundle exec rake clean package OFFLINE=true PINNED=true for a version with dependencies.

    or

    If you don't need a build pack to upload and just want to test your changes then...

    • Fork the Java build pack.
    • Make your changes.
    • Push them to your fork.
    • Run cf push -b <url-to-your-git-project>. Ex: cf push -b https://github.com/dmikusa-pivotal/java-buildpack.

    This will instruct the single app to use your copy of the build pack. This will only work if your CF foundation has network access to the Git URL specified.

    Hope that helps!