Cloud Foundry Playframework : Error 310: Staging failed:

痞子三分冷 提交于 2020-01-06 07:25:20

问题


I am trying to host a sample (HelloWorld) Play app in Cloud Foundry but am always getting this error at Staging,

Error 310: Staging failed: 'Staging task failed:
 Staging plugin failed: cp: cannot stat `/var/vcap/data/stager/tmp/d20120828-24156-128z05h/unstaged/logs/*': No such file or directory
/var/vcap/data/packages/ruby/6.1/lib/ruby/1.9.1/fileutils.rb:1231:in `chmod': No such file or directory - /var/vcap/data/stager/tmp/d20120828-24156-128z05h/staged/app/start (Errno::ENOENT)
    from /var/vcap/data/packages/ruby/6.1/lib/ruby/1.9.1/fileutils.rb:1231:in `chmod'
    from /var/vcap/data/packages/ruby/6.1/lib/ruby/1.9.1/fileutils.rb:879:in `block in chmod'
    from /var/vcap/data/packages/ruby/6.1/lib/ruby/1.9.1/fileutils.rb:878:in `each'
    from /var/vcap/data/packages/ruby/6.1/lib/ruby/1.9.1/fileutils.rb:878:in `chmod'
    from /var/vcap/packages/stager/vendor/bundle/ruby/1.9.1/gems/vcap_staging-0.1.62/lib/vcap/staging/plugin/play/plugin.rb:14:in `block in stage_application'
    from /var/vcap/packages/stager/vendor/bundle/ruby/1.9.1/gems/vcap_staging-0.1.62/lib/vcap/staging/plugin/play/plugin.rb:11:in `chdir'
    from /var/vcap/packages/stager/vendor/bundle/ruby/1.9.1/gems/vcap_staging-0.1.62/lib/vcap/staging/plugin/play/plugin.rb:11:in `stage_application'
    from /var/vcap/packages/stager/bin/run_plugin:19:in `<main>' 

I am quite new to this so have no idea on what it means. I also tried googling but to no avail.

I tried this one too but it didn't work SO Question similar to this one


EDIT:
The above link pointed works, just make sure you provide the app name in vmc push command as denoted by answer.


Any help much appreciated.

Thanks.

Dev Environment:

  • Play 2.0 - Scala based

  • Ubuntu 12.04

  • vmc to deploy the app.

Additional info:

I followed this tutorial Play scala Cloud Foundry

Would you like to deploy from the current directory? [Yn]: 
Application Name: HelloSample
Detected a Standalone Application, is this correct? [Yn]: n
1: Play
2: Lift
3: JavaWeb
4: Node
5: Standalone
6: Rails
7: Spring
8: Rack
9: Grails
10: Sinatra
Select Application Type: 1
Selected Play Framework Application
Application Deployed URL [HelloSample.cloudfoundry.com]: hellosample.cloudfoundry.com
Memory reservation (128M, 256M, 512M, 1G, 2G) [256M]: 
How many instances? [1]: 
1
Create services to bind to 'HelloSample'? [yN]: 1
Would you like to save this configuration? [yN]: y
Manifest written to manifest.yml.
Creating Application: OK
Uploading Application:
  Checking for available resources: OK
  Processing resources: OK
  Packing application: OK
  Uploading (106K): OK   
Push Status: OK
Staging Application 'HelloSample': ..Error 310: Staging failed: 'Staging task failed:
 Staging plugin failed: cp: cannot stat `/var/vcap/data/stager/tmp/d20120828-24156-128z05h/unstaged/logs/*': No such file or directory
/var/vcap/data/packages/ruby/6.1/lib/ruby/1.9.1/fileutils.rb:1231:in `chmod': No such file or directory - /var/vcap/data/stager/tmp/d20120828-24156-128z05h/staged/app/start (Errno::ENOENT)
    from /var/vcap/data/packages/ruby/6.1/lib/ruby/1.9.1/fileutils.rb:1231:in `chmod'
    from /var/vcap/data/packages/ruby/6.1/lib/ruby/1.9.1/fileutils.rb:879:in `block in chmod'
    from /var/vcap/data/packages/ruby/6.1/lib/ruby/1.9.1/fileutils.rb:878:in `each'
    from /var/vcap/data/packages/ruby/6.1/lib/ruby/1.9.1/fileutils.rb:878:in `chmod'
    from /var/vcap/packages/stager/vendor/bundle/ruby/1.9.1/gems/vcap_staging-0.1.62/lib/vcap/staging/plugin/play/plugin.rb:14:in `block in stage_application'
    from /var/vcap/packages/stager/vendor/bundle/ruby/1.9.1/gems/vcap_staging-0.1.62/lib/vcap/staging/plugin/play/plugin.rb:11:in `chdir'
    from /var/vcap/packages/stager/vendor/bundle/ruby/1.9.1/gems/vcap_staging-0.1.62/lib/vcap/staging/plugin/play/plugin.rb:11:in `stage_application'
    from /var/vcap/packages/stager/bin/run_plugin:19:in `<main>'
'

回答1:


you need to run the "dist" command in Play. This produces a zip file in the ./dist folder, you can the push the app with the 'path' switch like so;

vmc push <app-name-goes-here> --path=dist/<generated-zip-file>.zip

VMC should recognise this as a Play application and deploy it correctly.



来源:https://stackoverflow.com/questions/12161698/cloud-foundry-playframework-error-310-staging-failed

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