Not able to push my local app to bluemix

烂漫一生 提交于 2019-12-14 00:53:54

问题


I had an app running on another bluemix account. I wanted to copy the app and run it in another bluemix account. So I downloaded code from github repo., but when I am trying to push this app to another account I am seeing following error.

Note : I used cf push to push the downloaded app. Any help ?

Log :

2014-12-16T14:49:15.41+0530 [API]     OUT Updated app with guid e2fca26a-c62d-47 5d-8c21-8e959ae6632c ({"state"=>"STOPPED"})
2014-12-16T14:49:42.10+0530 [DEA]     OUT Got staging request for app with id e2 fca26a-c62d-475d-8c21-8e959ae6632c
2014-12-16T14:49:45.08+0530 [API]     OUT Updated app with guid e2fca26a-c62d-47 5d-8c21-8e959ae6632c ({"state"=>"STARTED"})
2014-12-16T14:49:45.65+0530 [STG]     OUT -----> Downloaded app package (4.6M)
2014-12-16T14:49:46.15+0530 [STG]     OUT -----> Downloaded app buildpack cache(4.4M)
2014-12-16T14:49:48.62+0530 [STG]     OUT     Staging failed: An application could not be detected by any available buildpack
2014-12-16T14:49:49.37+0530 [API]     ERR Encountered error: An app was not succ
essfully detected by any available buildpack

回答1:


Please check your Manifest.yml. Either your app is missing it or has some wrong entry. you can look for this file in your downloaded app. And also don't forget to pass build pack name when running push command.

This link could be helpful:

https://ibm.biz/BdEgub




回答2:


What language is the app in? Sometimes Cloud Foundry can't detect the type of app you are running and when you push the app you need to tell it what kind of app it is. We can do that with some of the following commands. I went ahead and posted it for a couple different languages. More info here. https://www.ng.bluemix.net/docs/#starters/byob.html

To see all the "built in" buildpacks run the following command.

cf buildpacks

You will get something like the following.

Getting buildpacks...

buildpack                             position   enabled   locked   filename   
liberty-for-java                      1          true      false    buildpack_liberty-for-java_v1.9-20141202-0947-yp.zip   
sdk-for-nodejs                        2          true      false    buildpack_sdk-for-nodejs_v1.9.1-20141208-1221-yp.zip   
noop-buildpack                        3          true      false    noop-buildpack-20140311-1519.zip   
java_buildpack                        4          true      false    java-buildpack-v2.5.zip   
ruby_buildpack                        5          true      false    ruby_buildpack-offline-v1.1.1.zip   
nodejs_buildpack                      6          true      false    nodejs_buildpack-offline-v1.0.4.zip   
liberty-for-java_v1-8-20141118-1610   7          true      false    buildpack_liberty-for-java_v1.8-20141118-1610-yp.zip   
liberty-for-java_v1-3-20140818-1538   8          true      false    buildpack_liberty-for-java_v1.3-20140818-1538.zip   
sdk-for-nodejs_v1-8-20141104-1654     9          true      false    buildpack_sdk-for-nodejs_v1.8-20141104-1654-yp.zip 

Java App: cf push appname -b liberty-for-java or cf push appname -b java_buildpack

Node.js: cf push appname -b sdk-for-nodejs or cf push appname -b nodejs_buildpack

Ruby: cf push appname -b ruby_buildpack

There are a bunch of other languages supported as well.

For a list head over to https://github.com/cloudfoundry-community/cf-docs-contrib/wiki/Buildpacks.

If for example you wanted to use PHP you would do the following. cf push -b https://github.com/cloudfoundry/php-buildpack.git

If you wanted to do Go you would do the following. cf push appname -b https://github.com/cloudfoundry/go-buildpack.git




回答3:


two ways to sort out this issue(Assuming its a node.js app)

  1. Run command like below from cf tool mentioning app name :

    cf push testmyapp -b sdk-for-nodejs -n testmyapp -m 128M -c 'node main.js'

P.S- "-n" option is used for required hostname on bluemix

  1. mention app name,service name explicitly in manifest.yml file like below:

    applications:

    • name: testmyapp

    host: testmyapp

    memory: 128M

    command: node main.js

P.S- You need to create manifest.yml explicitly if you are using 2nd method.

If you still getting any error,please provide o/p of "cf logs testmyapp --recent"

Alternatively,you can even directly push your app like below:

For Go application to Bluemix, but need to supply -b with the Go Buildpack URL:

cf push appname -b https://github.com/cloudfoundry/go-buildpack.git

Similarly,you can do for other one's.




回答4:


Looking at the below error,your app is not able to detect correct type of SDK.

2014-12-16T14:49:48.62+0530 [STG] OUT Staging failed: An application could not be detected by any available buildpack 2014-12-16T14:49:49.37+0530 [API] ERR Encountered error: An app was not succ essfully detected by any available buildpack

you need to check the correct sdk type and mention it while pushing like below:

cf push myapp -b sdk-for-nodejs -n myapp -m 128M -c 'node main.js'




回答5:


I had a talk in the last CloudFoundry summit on all kinds of app push errors: their symptoms, how to diagnose and what are the solutions. See https://www.slideshare.net/greensight/10-common-errors-when-pushing-apps-to-cloud-foundry. Hopefully it will be helpful.



来源:https://stackoverflow.com/questions/27506058/not-able-to-push-my-local-app-to-bluemix

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!