Forums/Cloud Foundry Forums/CloudFoundry.com Q&A

Answered

error 306: error retrieving file 'logs/startup.log'

raghava
asked this on July 22, 2011 04:14

Hi,

Getting the following error when I am trying to push one of RoR application in Cloud Foundry.

error 306: error retrieving file 'logs/startup.log'

let me know the error cause and solution ASAP.

 

thanks,

Raghava

error 306: error retrieving file 'logs/startup.log'

 

Comments

User photo
Senthil Vaiyapuri
Ajax_loader_small Answer

Hi Raghava,

  Please see whether you have any migration failures :

  % vmc files <appname> logs/migration.log

  Please review the following article regarding rails/ruby in cloudfoundry:

  http://support.cloudfoundry.com/entries/20019747-ruby-and-cloudfoun...

  If the problem still persists, please try 'vmc push' with -t option 

  % vmc push <appname> -t 

  and share the output.  Also share the commands of 

  % vmc crashes <appname>

  and 

  % vmc crashlogs <appname>

  Best Regards,

  -senthil

July 22, 2011 10:18
User photo
Senthil Vaiyapuri

Hi Raghava,

  Due to no response, marking this as answered for now.  Please let us know with details if 

  the problem persists.

  Best Regards,

  -senthil

July 26, 2011 10:51
User photo
Anand Kannan

Senthil,

We are deploying a java application and I did a vmc crashlogs <appname> right after the vmc push, but the challenge is that the error happens as a part of the vmc push. Any other idea on where to look or what to do? All the services show as RUNNING as well.

July 28, 2011 13:58
User photo
Senthil Vaiyapuri

Hi Anand,

  What error you are getting at the end of vmc push ?   Also, where are you targetting, to cloudfoundry.com

  or do you have a local vcap setup ?

  Please run vmc push with -t option and share the output.  'vmc logs <appname>' and 'vmc crashlogs <appname>'  would be useful as well, if they provide output.

  % vmc target

  % vmc info

  % vmc push <appname> -t

  % vmc logs <appname>

  % vmc crashlogs <appname>

  Another hint is to generate a war file for your application, put this in it's own directory and do a vmc push from there.

  Please provide us with more details.

  Best Regards,

  -senthil

July 28, 2011 14:13
User photo
Raul.Sobon

I get the same too here, (locally created vcap server)  (btw where are these apps stored /var/vcap/ ? )

I did a vcap update APPNAME -t

PROXY:
REQUEST: get http://api.vcap.me/apps/fmemanager/instances/0/files/logs/startup.log
RESPONSE_HEADERS:
x_ua_compatible : IE=Edge
x_vcap_router : 0.0.0.0
transfer_encoding : chunked
connection : keep-alive
date : Tue, 27 Sep 2011 02:28:30 GMT
server : nginx/0.7.65
cache_control : no-cache
x_vcap_backend : 127.0.0.1:9022
keep_alive : timeout=20
content_type : application/json; charset=utf-8
RESPONSE: [500]
{
"code": 306,
"description": "Error retrieving file 'logs/startup.log'"
}

 

The local vmc logs/errors arent that much help, but looking on the server side.

Running ./bin/vcap tail

I get 

 

cloud_controller --> [2011-09-27 12:23:41] cc - 26492 d2e2 7829 ERROR -- Exception Caught (CloudError): Error retrieving file 'logs/startup.log'
cloud_controller --> [2011-09-27 12:23:41] cc exception 26492 d2e2 7829 ERROR -- CloudError("Error retrieving file 'logs/startup.log'", [/root/cloudfoundry/vcap/cloud_controller/app/controllers/apps_controller.rb:184:in `files',/usr/local/rvm/gems/ruby-1.9.2-p180/gems/actionpack-3.0.5/lib/action_controller/metal/implicit_render.rb:4:in `send_action',/usr/local/rvm/gems/ruby-1.9.2-p180/gems/actionpack-3.0.5/lib/abstract_controller/base.rb:150:in `process_action',/usr/local/rvm/gems/ruby-1.9.2-p180/gems/actionpack-3.0.5/lib/action_controller/metal/rendering.rb:11:in `process_action',/usr/local/rvm/gems/ruby-1.9.2-p180/gems/actionpack-3.0.5/lib/abstract_controller/callbacks.rb:18:in `block in process_action',/usr/local/rvm/gems/ruby-1.9.2-p180/gems/activesupport-3.0.5/lib/active_support/callbacks.rb:445:in `_run__773147142576738247__process_action__3229249342433270065__callbacks',/usr/local/rvm/gems/ruby-1.9.2-p180/gems/activesupport-3.0.5/lib/active_support/callbacks.rb:409:in `_run_process_action_callbacks',/usr/local/rvm/gems/ruby-1.9.2-p180/gems/activesupport-3.0.5/lib/active_support/callbacks.rb:93:in `run_callbacks',/usr/local/rvm/gems/ruby-1.9.2-p180/gems/actionpack-3.0.5/lib/abstract_controller/callbacks.rb:17:in `process_action',/usr/local/rvm/gems/ruby-1.9.2-p180/gems/actionpack-3.0.5/lib/action_controller/metal/instrumentation.rb:30:in `block in process_action',/usr/local/rvm/gems/ruby-1.9.2-p180/gems/activesupport-3.0.5/lib/active_support/notifications.rb:52:in `block in instrument',/usr/local/rvm/gems/ruby-1.9.2-p180/gems/activesupport-3.0.5/lib/active_support/notifications/instrumenter.rb:21:in `instrument',/usr/local/rvm/gems/ruby-1.9.2-p180/gems/activesupport-3.0.5/lib/active_support/notifications.rb:52:in `instrument',/usr/local/rvm/gems/ruby-1.9.2-p180/gems/actionpack-3.0.5/lib/action_controller/metal/instrumentation.rb:29:in `process_action',/usr/local/rvm/gems/ruby-1.9.2-p180/gems/actionpack-3.0.5/lib/action_controller/metal/rescue.rb:17:in `process_action',/root/cloudfoundry/vcap/cloud_controller/app/controllers/application_controller.rb:16:in `process_action',/root/cloudfoundry/vcap/cloud_controller/app/controllers/apps_controller.rb:8:in `process_action',/usr/local/rvm/gems/ruby-1.9.2-p180/gems/actionpack-3.0.5/lib/abstract_controller/base.rb:119:in `process',/usr/local/rvm/gems/ruby-1.9.2-p180/gems/actionpack-3.0.5/lib/abstract_controller/rendering.rb:41:in `process',/usr/local/rvm/gems/ruby-1.9.2-p180/gems/actionpack-3.0.5/lib/action_controller/metal.rb:138:in `dispatch',/usr/local/rvm/gems/ruby-1.9.2-p180/gems/actionpack-3.0.5/lib/action_controller/metal/rack_delegation.rb:14:in `dispatch',/usr/local/rvm/gems/ruby-1.9.2-p180/gems/actionpack-3.0.5/lib/action_controller/metal.rb:178:in `block in action',/usr/local/rvm/gems/ruby-1.9.2-p180/gems/actionpack-3.0.5/lib/action_dispatch/routing/route_set.rb:62:in `call',/usr/local/rvm/gems/ruby-1.9.2-p180/gems/actionpack-3.0.5/lib/action_dispatch/routing/route_set.rb:62:in `dispatch',/usr/local/rvm/gems/ruby-1.9.2-p180/gems/actionpack-3.0.5/lib/action_dispatch/routing/route_set.rb:27:in `call',/usr/local/rvm/gems/ruby-1.9.2-p180/gems/rack-mount-0.6.14/lib/rack/mount/route_set.rb:148:in `block in call',/usr/local/rvm/gems/ruby-1.9.2-p180/gems/rack-mount-0.6.14/lib/rack/mount/code_generation.rb:93:in `block in recognize',/usr/local/rvm/gems/ruby-1.9.2-p180/gems/rack-mount-0.6.14/lib/rack/mount/code_generation.rb:124:in `optimized_each',/usr/local/rvm/gems/ruby-1.9.2-p180/gems/rack-mount-0.6.14/lib/rack/mount/code_generation.rb:92:in `recognize',/usr/local/rvm/gems/ruby-1.9.2-p180/gems/rack-mount-0.6.14/lib/rack/mount/route_set.rb:139:in `call',/usr/local/rvm/gems/ruby-1.9.2-p180/gems/actionpack-3.0.5/lib/action_dispatch/routing/route_set.rb:492:in `call',/usr/local/rvm/gems/ruby-1.9.2-p180/gems/actionpack-3.0.5/lib/action_dispatch/middleware/best_standards_support.rb:17:in `call',/usr/local/rvm/gems/ruby-1.9.2-p180/gems/actionpack-3.0.5/lib/action_dispatch/middleware/head.rb:14:in `call',/usr/local/rvm/gems/ruby-1.9.2-p180/gems/rack-1.2.2/lib/rack/methodoverride.rb:24:in `call',/usr/local/rvm/gems/ruby-1.9.2-p180/gems/actionpack-3.0.5/lib/action_dispatch/middleware/params_parser.rb:21:in `call',/usr/local/rvm/gems/ruby-1.9.2-p180/gems/actionpack-3.0.5/lib/action_dispatch/middleware/cookies.rb:302:in `call',/usr/local/rvm/gems/ruby-1.9.2-p180/gems/activerecord-3.0.5/lib/active_record/query_cache.rb:32:in `block in call',/usr/local/rvm/gems/ruby-1.9.2-p180/gems/activerecord-3.0.5/lib/active_record/connection_adapters/abstract/query_cache.rb:28:in `cache',/usr/local/rvm/gems/ruby-1.9.2-p180/gems/activerecord-3.0.5/lib/active_record/query_cache.rb:12:in `cache',/usr/local/rvm/gems/ruby-1.9.2-p180/gems/activerecord-3.0.5/lib/active_record/query_cache.rb:31:in `call',/usr/local/rvm/gems/ruby-1.9.2-p180/gems/activerecord-3.0.5/lib/active_record/connection_adapters/abstract/connection_pool.rb:354:in `call',/usr/local/rvm/gems/ruby-1.9.2-p180/gems/actionpack-3.0.5/lib/action_dispatch/middleware/callbacks.rb:46:in `block in call',/usr/local/rvm/gems/ruby-1.9.2-p180/gems/activesupport-3.0.5/lib/active_support/callbacks.rb:415:in `_run_call_callbacks',/usr/local/rvm/gems/ruby-1.9.2-p180/gems/actionpack-3.0.5/lib/action_dispatch/middleware/callbacks.rb:44:in `call',/usr/local/rvm/gems/ruby-1.9.2-p180/gems/rack-1.2.2/lib/rack/sendfile.rb:107:in `call',/usr/local/rvm/gems/ruby-1.9.2-p180/gems/actionpack-3.0.5/lib/action_dispatch/middleware/remote_ip.rb:48:in `call',/usr/local/rvm/gems/ruby-1.9.2-p180/gems/actionpack-3.0.5/lib/action_dispatch/middleware/show_exceptions.rb:47:in `call',/usr/local/rvm/gems/ruby-1.9.2-p180/gems/railties-3.0.5/lib/rails/rack/logger.rb:13:in `call',/usr/local/rvm/gems/ruby-1.9.2-p180/gems/rack-fiber_pool-0.9.1/lib/rack/fiber_pool.rb:19:in `block in call',/usr/local/rvm/gems/ruby-1.9.2-p180/gems/rack-fiber_pool-0.9.1/lib/fiber_pool.rb:48:in `call',/usr/local/rvm/gems/ruby-1.9.2-p180/gems/rack-fiber_pool-0.9.1/lib/fiber_pool.rb:48:in `block (3 levels) in initialize',/usr/local/rvm/gems/ruby-1.9.2-p180/gems/rack-fiber_pool-0.9.1/lib/fiber_pool.rb:47:in `loop',/usr/local/rvm/gems/ruby-1.9.2-p180/gems/rack-fiber_pool-0.9.1/lib/fiber_pool.rb:47:in `block (2 levels) in initialize'])
cloud_controller --> [2011-09-27 12:23:41 +1000, :USER, "USERNAME", "GET:/apps/test_app/instances/0/files/logs/startup.log", "test_app", :FAILED, "Error retrieving file 'logs/startup.log'"]
dea --> [2011-09-27 12:23:41] dea - 2576 5779 6690 DEBUG -- DEA received find droplet message: {"droplet":1,"indices":[0],"states":["STARTING","RUNNING","CRASHED"],"version":"702237ea55097bc3da5b44a805f1390142cc933e-1"}
health_manager --> [2011-09-27 12:23:46] hm - 2600 c740 e359 DEBUG -- heartbeat: {"droplets":[{"droplet":1,"version":"702237ea55097bc3da5b44a805f1390142cc933e-1","instance":"bba732fbaca2c36fc883d8a426de08fa","index":0,"state":"CRASHED","state_timestamp":1317090166},{"droplet":1,"version":"702237ea55097bc3da5b44a805f1390142cc933e-1","instance":"c03b39dcc2d4732bd9b47a74c573511a","index":0,"state":"CRASHED","state_timestamp":1317090167},{"droplet":1,"version":"702237ea55097bc3da5b44a805f1390142cc933e-1","instance":"a0bd8a51f62f8c96aaaffaf663771026","index":0,"state":"CRASHED","state_timestamp":1317090169},{"droplet":1,"version":"702237ea55097bc3da5b44a805f1390142cc933e-1","instance":"ffd2edcc6bd367457c1a40dda48aef39","index":0,"state":"CRASHED","state_timestamp":1317090169}]}

 

 

September 26, 2011 19:42
User photo
Glenn Oppegard
Cloud Foundry

Hi Raul,

The file 'logs/startup.log' isn't always generated, so the error returned by vmc can be a red herring. What's the output from 'vmc files APPNAME logs/' for each file under the logs directory?

September 27, 2011 17:39
User photo
Raul.Sobon

No problem, sorted it out by doing a vmc logs APP --all

To receive all the logs and that pointed me to the correct fault of the app failing to connect to a specific IP, getting a connection refused, once that was sorted, it was all good.

 

Thanks

September 27, 2011 19:02