cloudfoundry-community-attic / LEGACY-bosh-getting-started

LEGACY documentation - please go here...
https://bosh.cloudfoundry.org/docs
95 stars 36 forks source link

Excon::Errors::MultipleChoices #32

Open jdcloud opened 11 years ago

jdcloud commented 11 years ago

Hi, @drnic I was in openstack (Folsom) micro bosh installation created by the VM, the following error occurred.

console output:


ubuntu@jae-bosh-cli:~/deployments$ bosh micro deploy /home/ubuntu/stemcells/micro-bosh-stemcell-openstack-0.7.0.tgz 
Deploying new micro BOSH instance `microbosh-openstack/micro_bosh.yml' to `http://10.23.54.115:25555' (type 'yes' to continue): yes

Verifying stemcell...
File exists and readable                                     OK
Using cached manifest...
Stemcell properties                                          OK

Stemcell info
-------------
Name:    micro-bosh-stemcell
Version: 0.7.0

Deploy Micro BOSH
  unpacking stemcell (00:00:16)                                                                     
Uploading stemcell                  |oo                      | 1/11 00:01:06  ETA: 00:01:52/home/ubuntu/.rvm/gems/ruby-1.9.3-p374/gems/excon-0.16.10/lib/excon/connection.rb:292:in `request_kernel': Expected(201) <=> Actual(300 Multiple Choices) (Excon::Errors::MultipleChoices)
  request => {:chunk_size=>1048576, :connect_timeout=>60, :headers=>{"User-Agent"=>"fog/1.9.0", "Content-Type"=>"application/octet-stream", "X-Auth-Token"=>"4d48f1b5daa64c348a194776b2c31181", "x-image-meta-name"=>"BOSH-f739944a-c7a0-46e8-95b6-e26875ef4031-AKI", "x-image-meta-disk-format"=>"aki", "x-image-meta-container-format"=>"aki", "x-image-meta-size"=>4599664, "x-image-meta-property-\#{key}"=>"BOSH-f739944a-c7a0-46e8-95b6-e26875ef4031", "Host"=>"10.23.54.150:9292", "Content-Length"=>4599664}, :instrumentor_name=>"excon", :mock=>false, :nonblock=>true, :read_timeout=>60, :retry_limit=>4, :ssl_ca_file=>"/home/ubuntu/.rvm/gems/ruby-1.9.3-p374/gems/excon-0.16.10/data/cacert.pem", :ssl_verify_peer=>true, :write_timeout=>60, :host=>"10.23.54.150", :host_port=>"10.23.54.150:9292", :path=>"/images", :port=>"9292", :query=>nil, :scheme=>"http", :body=>#, :expects=>201, :method=>"POST"}
  response => #"application/json", "Content-Length"=>"331", "Date"=>"Wed, 30 Jan 2013 08:19:46 GMT"}, @status=300>
    from /home/ubuntu/.rvm/gems/ruby-1.9.3-p374/gems/excon-0.16.10/lib/excon/connection.rb:103:in `request'
    from /home/ubuntu/.rvm/gems/ruby-1.9.3-p374/gems/fog-1.9.0/lib/fog/core/connection.rb:21:in `request'
    from /home/ubuntu/.rvm/gems/ruby-1.9.3-p374/gems/fog-1.9.0/lib/fog/openstack/image.rb:144:in `request'
    from /home/ubuntu/.rvm/gems/ruby-1.9.3-p374/gems/fog-1.9.0/lib/fog/openstack/requests/image/create_image.rb:39:in `create_image'
    from /home/ubuntu/.rvm/gems/ruby-1.9.3-p374/gems/fog-1.9.0/lib/fog/openstack/models/image/image.rb:47:in `create'
    from /home/ubuntu/.rvm/gems/ruby-1.9.3-p374/gems/fog-1.9.0/lib/fog/openstack/models/image/image.rb:42:in `save'
    from /home/ubuntu/.rvm/gems/ruby-1.9.3-p374/gems/fog-1.9.0/lib/fog/core/collection.rb:52:in `create'
    from /home/ubuntu/.rvm/gems/ruby-1.9.3-p374/gems/bosh_openstack_cpi-0.0.7/lib/cloud/openstack/cloud.rb:728:in `upload_image'
    from /home/ubuntu/.rvm/gems/ruby-1.9.3-p374/gems/bosh_openstack_cpi-0.0.7/lib/cloud/openstack/cloud.rb:119:in `block (2 levels) in create_stemcell'
    from /home/ubuntu/.rvm/rubies/ruby-1.9.3-p374/lib/ruby/1.9.1/tmpdir.rb:83:in `mktmpdir'
    from /home/ubuntu/.rvm/gems/ruby-1.9.3-p374/gems/bosh_openstack_cpi-0.0.7/lib/cloud/openstack/cloud.rb:90:in `block in create_stemcell'
    from /home/ubuntu/.rvm/gems/ruby-1.9.3-p374/gems/bosh_common-0.5.4/lib/common/thread_formatter.rb:46:in `with_thread_name'
    from /home/ubuntu/.rvm/gems/ruby-1.9.3-p374/gems/bosh_openstack_cpi-0.0.7/lib/cloud/openstack/cloud.rb:88:in `create_stemcell'
    from /home/ubuntu/.rvm/gems/ruby-1.9.3-p374/gems/bosh_deployer-1.4.0/lib/deployer/instance_manager.rb:215:in `block (2 levels) in create_stemcell'
    from /home/ubuntu/.rvm/gems/ruby-1.9.3-p374/gems/bosh_deployer-1.4.0/lib/deployer/instance_manager.rb:84:in `step'
    from /home/ubuntu/.rvm/gems/ruby-1.9.3-p374/gems/bosh_deployer-1.4.0/lib/deployer/instance_manager.rb:214:in `block in create_stemcell'
    from /home/ubuntu/.rvm/rubies/ruby-1.9.3-p374/lib/ruby/1.9.1/tmpdir.rb:83:in `mktmpdir'
    from /home/ubuntu/.rvm/gems/ruby-1.9.3-p374/gems/bosh_deployer-1.4.0/lib/deployer/instance_manager.rb:200:in `create_stemcell'
    from /home/ubuntu/.rvm/gems/ruby-1.9.3-p374/gems/bosh_deployer-1.4.0/lib/deployer/instance_manager.rb:128:in `create'
    from /home/ubuntu/.rvm/gems/ruby-1.9.3-p374/gems/bosh_deployer-1.4.0/lib/deployer/instance_manager.rb:104:in `block in create_deployment'
    from /home/ubuntu/.rvm/gems/ruby-1.9.3-p374/gems/bosh_deployer-1.4.0/lib/deployer/instance_manager.rb:97:in `with_lifecycle'
    from /home/ubuntu/.rvm/gems/ruby-1.9.3-p374/gems/bosh_deployer-1.4.0/lib/deployer/instance_manager.rb:103:in `create_deployment'
    from /home/ubuntu/.rvm/gems/ruby-1.9.3-p374/gems/bosh_deployer-1.4.0/lib/bosh/cli/commands/micro.rb:171:in `perform'
    from /home/ubuntu/.rvm/gems/ruby-1.9.3-p374/gems/bosh_cli-1.0.3/lib/cli/command_handler.rb:57:in `run'
    from /home/ubuntu/.rvm/gems/ruby-1.9.3-p374/gems/bosh_cli-1.0.3/lib/cli/runner.rb:61:in `run'
    from /home/ubuntu/.rvm/gems/ruby-1.9.3-p374/gems/bosh_cli-1.0.3/lib/cli/runner.rb:18:in `run'
    from /home/ubuntu/.rvm/gems/ruby-1.9.3-p374/gems/bosh_cli-1.0.3/bin/bosh:16:in `'
    from /home/ubuntu/.rvm/gems/ruby-1.9.3-p374/bin/bosh:19:in `load'
    from /home/ubuntu/.rvm/gems/ruby-1.9.3-p374/bin/bosh:19:in `
' from /home/ubuntu/.rvm/gems/ruby-1.9.3-p374/bin/ruby_noexec_wrapper:14:in `eval' from /home/ubuntu/.rvm/gems/ruby-1.9.3-p374/bin/ruby_noexec_wrapper:14:in `
' ubuntu@jae-bosh-cli:~/deployments$
jdcloud commented 11 years ago

Temporary solution: modify excon-0.16.10/lib/excon/connection.rb line number:82


    unless params[:path][0, 1] == '/'
          params[:path].insert(0, '/')
        end
    #add
        if params[:path] == '/images'
          params[:path] = '/v2.0/images'
        end

install continue... hahaha

but


Uploading stemcell                  |oo                      | 1/11 00:00:58  ETA: 00:01:18/home/ubuntu/.rvm/gems/ruby-1.9.3-p374/gems/excon-0.16.10/lib/excon/connection.rb:296:in `request_kernel': Expected(201) <=> Actual(400 Bad Request) (Excon::Errors::BadRequest)
  request => {:chunk_size=>1048576, :connect_timeout=>60, :headers=>{"User-Agent"=>"fog/1.9.0", "Content-Type"=>"application/octet-stream", "X-Auth-Token"=>"2b9660d839c14d288928e1f279899655", "x-image-meta-name"=>"BOSH-3c0d1439-b665-4158-9727-d53006d56042-AKI", "x-image-meta-disk-format"=>"aki", "x-image-meta-container-format"=>"aki", "x-image-meta-size"=>4599664, "x-image-meta-property-\#{key}"=>"BOSH-3c0d1439-b665-4158-9727-d53006d56042", "Host"=>"10.23.54.150:9292", "Content-Length"=>4599664}, :instrumentor_name=>"excon", :mock=>false, :nonblock=>true, :read_timeout=>60, :retry_limit=>4, :ssl_ca_file=>"/home/ubuntu/.rvm/gems/ruby-1.9.3-p374/gems/excon-0.16.10/data/cacert.pem", :ssl_verify_peer=>true, :write_timeout=>60, :host=>"10.23.54.150", :host_port=>"10.23.54.150:9292", :path=>"/v2.0/images", :port=>"9292", :query=>nil, :scheme=>"http", :body=>#, :expects=>201, :method=>"POST"}
  response => #"53", "Content-Type"=>"text/plain; charset=UTF-8", "X-Openstack-Request-Id"=>"req-3003516c-b209-4dff-b180-269bf10533d5", "Date"=>"Wed, 30 Jan 2013 09:19:51 GMT"}, @status=400>
    from /home/ubuntu/.rvm/gems/ruby-1.9.3-p374/gems/excon-0.16.10/lib/excon/connection.rb:108:in `request'
    from /home/ubuntu/.rvm/gems/ruby-1.9.3-p374/gems/fog-1.9.0/lib/fog/core/connection.rb:21:in `request'
    from /home/ubuntu/.rvm/gems/ruby-1.9.3-p374/gems/fog-1.9.0/lib/fog/openstack/image.rb:144:in `request'
    from /home/ubuntu/.rvm/gems/ruby-1.9.3-p374/gems/fog-1.9.0/lib/fog/openstack/requests/image/create_image.rb:39:in `create_image'
    from /home/ubuntu/.rvm/gems/ruby-1.9.3-p374/gems/fog-1.9.0/lib/fog/openstack/models/image/image.rb:47:in `create'
    from /home/ubuntu/.rvm/gems/ruby-1.9.3-p374/gems/fog-1.9.0/lib/fog/openstack/models/image/image.rb:42:in `save'
    from /home/ubuntu/.rvm/gems/ruby-1.9.3-p374/gems/fog-1.9.0/lib/fog/core/collection.rb:52:in `create'
    from /home/ubuntu/.rvm/gems/ruby-1.9.3-p374/gems/bosh_openstack_cpi-0.0.7/lib/cloud/openstack/cloud.rb:728:in `upload_image'
    from /home/ubuntu/.rvm/gems/ruby-1.9.3-p374/gems/bosh_openstack_cpi-0.0.7/lib/cloud/openstack/cloud.rb:119:in `block (2 levels) in create_stemcell'
    from /home/ubuntu/.rvm/rubies/ruby-1.9.3-p374/lib/ruby/1.9.1/tmpdir.rb:83:in `mktmpdir'
    from /home/ubuntu/.rvm/gems/ruby-1.9.3-p374/gems/bosh_openstack_cpi-0.0.7/lib/cloud/openstack/cloud.rb:90:in `block in create_stemcell'
    from /home/ubuntu/.rvm/gems/ruby-1.9.3-p374/gems/bosh_common-0.5.4/lib/common/thread_formatter.rb:46:in `with_thread_name'
    from /home/ubuntu/.rvm/gems/ruby-1.9.3-p374/gems/bosh_openstack_cpi-0.0.7/lib/cloud/openstack/cloud.rb:88:in `create_stemcell'
    from /home/ubuntu/.rvm/gems/ruby-1.9.3-p374/gems/bosh_deployer-1.4.0/lib/deployer/instance_manager.rb:215:in `block (2 levels) in create_stemcell'
    from /home/ubuntu/.rvm/gems/ruby-1.9.3-p374/gems/bosh_deployer-1.4.0/lib/deployer/instance_manager.rb:84:in `step'
    from /home/ubuntu/.rvm/gems/ruby-1.9.3-p374/gems/bosh_deployer-1.4.0/lib/deployer/instance_manager.rb:214:in `block in create_stemcell'
    from /home/ubuntu/.rvm/rubies/ruby-1.9.3-p374/lib/ruby/1.9.1/tmpdir.rb:83:in `mktmpdir'
    from /home/ubuntu/.rvm/gems/ruby-1.9.3-p374/gems/bosh_deployer-1.4.0/lib/deployer/instance_manager.rb:200:in `create_stemcell'
    from /home/ubuntu/.rvm/gems/ruby-1.9.3-p374/gems/bosh_deployer-1.4.0/lib/deployer/instance_manager.rb:128:in `create'
    from /home/ubuntu/.rvm/gems/ruby-1.9.3-p374/gems/bosh_deployer-1.4.0/lib/deployer/instance_manager.rb:104:in `block in create_deployment'
    from /home/ubuntu/.rvm/gems/ruby-1.9.3-p374/gems/bosh_deployer-1.4.0/lib/deployer/instance_manager.rb:97:in `with_lifecycle'
    from /home/ubuntu/.rvm/gems/ruby-1.9.3-p374/gems/bosh_deployer-1.4.0/lib/deployer/instance_manager.rb:103:in `create_deployment'
    from /home/ubuntu/.rvm/gems/ruby-1.9.3-p374/gems/bosh_deployer-1.4.0/lib/bosh/cli/commands/micro.rb:171:in `perform'
    from /home/ubuntu/.rvm/gems/ruby-1.9.3-p374/gems/bosh_cli-1.0.3/lib/cli/command_handler.rb:57:in `run'
    from /home/ubuntu/.rvm/gems/ruby-1.9.3-p374/gems/bosh_cli-1.0.3/lib/cli/runner.rb:61:in `run'
    from /home/ubuntu/.rvm/gems/ruby-1.9.3-p374/gems/bosh_cli-1.0.3/lib/cli/runner.rb:18:in `run'
    from /home/ubuntu/.rvm/gems/ruby-1.9.3-p374/gems/bosh_cli-1.0.3/bin/bosh:16:in `'
    from /home/ubuntu/.rvm/gems/ruby-1.9.3-p374/bin/bosh:19:in `load'
    from /home/ubuntu/.rvm/gems/ruby-1.9.3-p374/bin/bosh:19:in `
' from /home/ubuntu/.rvm/gems/ruby-1.9.3-p374/bin/ruby_noexec_wrapper:14:in `eval' from /home/ubuntu/.rvm/gems/ruby-1.9.3-p374/bin/ruby_noexec_wrapper:14:in `
'

bosh installation so difficult? @drnic @frodenas

jdcloud commented 11 years ago

modify excon-0.16.10/lib/excon/connection.rb line number:88

unless params[:path][0, 1] == '/'
      params[:path].insert(0, '/')
    end
#add
    if params[:path].include?('/images')
      params[:path] = '/v1.1' + params[:path]
    end
drnic commented 11 years ago

@jdcloud can you submit a patch to excon? alternately, since the bug is in the bosh_openstack_cpi, can you create a Jira ticket https://cloudfoundry.atlassian.net/browse/CF for @frodenas to look at?

Bonus request: we can patch excon within bosh-bootstrap until it is fixed downstream. Would you like to add a lib/excon-ext/connection.rb and have it monkey patch in the fix? Mark it clearly as "Please remove when excon is upgraded". @frodenas seem ok?

drnic commented 11 years ago

Damn, I lost track of what project I was in. Sorry, I thought this was https://github.com/StarkAndWayne/bosh-bootstrap :)

Would you like to try using that project - the successor to this v1 Getting Started guide - and see if you have success?

frodenas commented 11 years ago

@drnic @jdcloud This is not an excon issue, it is an OpenStack configuration error. In your OpenStack keystone catalog service, the image service endpoint is not well configured, you should append the version to the endpoint URL.

jdcloud commented 11 years ago

thanks .

https://groups.google.com/a/cloudfoundry.org/forum/?fromgroups=#!search/Malformed$20JSON$20in$20request$20body/bosh-users/bH1xb1b1znE/2eVHt_Yi5VgJ

The "waiting for the agent " with a lot of time. It's been 30 minutes. Is that right?

to : @drnic
my colleagues are trying to bootstarp https://github.com/StarkAndWayne/bosh-bootstrap :)

jdcloud commented 11 years ago

hi : @drnic

https://cloudfoundry.atlassian.net/browse/CF-81?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel

I tried to modify the folder permissions,but error again. how do you solve? thank you!

drnic commented 11 years ago

If you're having Jira troubles, GitHub issues is now open for the bosh project.

Dr Nic Williams http://drnicwilliams.com cell +1 (415) 860-2185