Static buildpack deploy now failing due to unsuppo

2019-07-08 10:09发布

问题:

I'm trying to deploy an update to a simple HTML application using static files. Using the static buildpack, I've previously deployed the application with no issues.

Pushing an application update, the command fails with the following message:

----> Downloaded app package (4.0K)
Cloning into '/tmp/buildpacks/staticfile-buildpack'...
Submodule 'compile-extensions' (https://github.com/cloudfoundry-incubator/compile-extensions.git) registered for path 'compile-extensions'

FAILED
Server error, status code: 400, error code: 170004, message: App staging failed in the buildpack compile phase

Looking in the logs for the application, the platform fails staging due to an incompatibility with the stack.

ERR Cloning into '/tmp/buildpacks/staticfile-buildpack'...
OUT Submodule 'compile-extensions' (https://github.com/cloudfoundry-incubator/compile-extensions.git) registered for path 'compile-extensions'
ERR Cloning into 'compile-extensions'...
OUT Submodule path 'compile-extensions': checked out '1f260464c156bddfb654adb14298344797d030a1'
ERR It looks like you're deploying on a stack that's not supported by this buildpack.
ERR That could be because you're using a recent buildpack release on a deprecated stack.
ERR If you're using the buildpack installed by your CF admin, please let your admin know you saw this error message.
ERR If you at one point specified a buildpack that's at git URL, please make sure you're pointed at a version that supports this stack.
OUT Staging failed: Buildpack compilation step failed
ERR encountered error: App staging failed in the buildpack compile phase

How can I resolve this?

回答1:

Cloud Foundry recently added support for a new stack, cflinuxfs2, based upon Ubuntu 14.04. IBM Bluemix still supports the old lucid64 build stack, which appears to be chosen by default if a stack isn't specified on the command line.

Looking at the "Static Buildpack" manifest, the old stack isn't supported.

cf_stacks:
    - cflinuxfs2

You can explicitly set the application stack during deploying using the '-s' command-line parameter.

    cf push -b https://github.com/cloudfoundry/staticfile-buildpack.git -s cflinuxfs2

Using the 'cflinuxfs2' will fix the issue.



回答2:

For anyone else having this issue on bluemix I was actually unable to use the cflinuxfs stack on the external bluemix, but pushing with cflinuxfs2 seems to work

cf push -b https://github.com/cloudfoundry/staticfile-buildpack.git -s cflinuxfs2

Edit: Running this command on the api endpoint that I was using I got the following output, hence the reason i had to use cflinuxfs2:

> cf stacks
name         description
lucid64      Ubuntu 10.04
seDEA        private
cflinuxfs2   Ubuntu 14.04.2 trusty

Also: https://developer.ibm.com/answers/questions/198303/cloudfoundry-static-buildpack-not-compatible.html