2

我正在尝试在我的 Rackspace 服务器上创建一个 Bosh 微实例并收到以下错误:

E, [2013-10-29T15:17:25.113723 #30341] [0xc9c00c] ERROR -- : Unable to connect to the OpenStack Compute API. Check task debug log for details.
I, [2013-10-29T16:38:36.928221 #1754] [0x335004]  INFO -- : No existing deployments found (will save to /root/bosh-deployments.yml)
I, [2013-10-29T16:39:14.636310 #1768] [0xfa9010]  INFO -- : Loading existing deployment data from: /root/bosh-workspace/deployments/bosh-deployments.yml
I, [2013-10-29T16:39:20.766583 #1768] [0xfa9010]  INFO -- : bosh-registry is ready on port 25889
I, [2013-10-29T16:39:26.731953 #1768] [0xfa9010]  INFO -- : Loading yaml from /tmp/d20131029-1768-ewe5t0/sc-20131029-1768-ansv2l/stemcell.MF
E, [2013-10-29T16:39:28.626135 #1768] [0xfa9010] ERROR -- : Expected([200, 204]) <=> Actual(401 Unauthorized)
  response => #<Excon::Response:0x0000000382cdc0 @data={:body=>"{\"unauthorized\":{\"code\":401,\"message\":\"Unable to authenticate user with credentials provided.\"}}", :headers=>{"Server"=>"nginx/0.8.55", "Date"=>"Tue, 29 Oct 2013 16:39:27 GMT", "Content-Type"=>"application/json", "Transfer-Encoding"=>"chunked", "Connection"=>"keep-alive", "vary"=>"Accept, Accept-Encoding, X-Auth-Token", "VIA"=>"1.0 Repose (Repose/2.3.5)"}, :status=>401, :remote_ip=>"72.3.138.129"}, @body="{\"unauthorized\":{\"code\":401,\"message\":\"Unable to authenticate user with credentials provided.\"}}", @headers={"Server"=>"nginx/0.8.55", "Date"=>"Tue, 29 Oct 2013 16:39:27 GMT", "Content-Type"=>"application/json", "Transfer-Encoding"=>"chunked", "Connection"=>"keep-alive", "vary"=>"Accept, Accept-Encoding, X-Auth-Token", "VIA"=>"1.0 Repose (Repose/2.3.5)"}, @status=401, @remote_ip="72.3.138.129"> (Excon::Errors::Unauthorized)
/usr/local/rvm/gems/ruby-1.9.3-p448/gems/excon-0.25.3/lib/excon/middlewares/expects.rb:10:in `response_call'
/usr/local/rvm/gems/ruby-1.9.3-p448/gems/excon-0.25.3/lib/excon/middlewares/response_parser.rb:8:in `response_call'
/usr/local/rvm/gems/ruby-1.9.3-p448/gems/excon-0.25.3/lib/excon/connection.rb:349:in `response'
/usr/local/rvm/gems/ruby-1.9.3-p448/gems/excon-0.25.3/lib/excon/connection.rb:247:in `request'
/usr/local/rvm/gems/ruby-1.9.3-p448/gems/fog-1.14.0/lib/fog/core/connection.rb:57:in `request'
/usr/local/rvm/gems/ruby-1.9.3-p448/gems/fog-1.14.0/lib/fog/core/deprecated/connection.rb:20:in `request'
/usr/local/rvm/gems/ruby-1.9.3-p448/gems/fog-1.14.0/lib/fog/openstack.rb:195:in `retrieve_tokens_v2'
/usr/local/rvm/gems/ruby-1.9.3-p448/gems/fog-1.14.0/lib/fog/openstack.rb:88:in `authenticate_v2'
/usr/local/rvm/gems/ruby-1.9.3-p448/gems/fog-1.14.0/lib/fog/openstack/compute.rb:392:in `authenticate'
/usr/local/rvm/gems/ruby-1.9.3-p448/gems/fog-1.14.0/lib/fog/openstack/compute.rb:316:in `initialize'
/usr/local/rvm/gems/ruby-1.9.3-p448/gems/fog-1.14.0/lib/fog/core/service.rb:68:in `new'
/usr/local/rvm/gems/ruby-1.9.3-p448/gems/fog-1.14.0/lib/fog/core/service.rb:68:in `new'
/usr/local/rvm/gems/ruby-1.9.3-p448/gems/fog-1.14.0/lib/fog/compute.rb:44:in `new'
/usr/local/rvm/gems/ruby-1.9.3-p448/gems/bosh_openstack_cpi-1.5.0.pre.1181/lib/cloud/openstack/cloud.rb:55:in `initialize'
/usr/local/rvm/gems/ruby-1.9.3-p448/gems/bosh_cpi-1.5.0.pre.1181/lib/cloud/provider.rb:11:in `new'
/usr/local/rvm/gems/ruby-1.9.3-p448/gems/bosh_cpi-1.5.0.pre.1181/lib/cloud/provider.rb:11:in `create'
/usr/local/rvm/gems/ruby-1.9.3-p448/gems/bosh_cli_plugin_micro-1.5.0.pre.1181/lib/bosh/deployer/configuration.rb:65:in `cloud'
/usr/local/rvm/gems/ruby-1.9.3-p448/gems/bosh_cli_plugin_micro-1.5.0.pre.1181/lib/bosh/deployer/instance_manager.rb:54:in `cloud'
/usr/local/rvm/gems/ruby-1.9.3-p448/gems/bosh_cli_plugin_micro-1.5.0.pre.1181/lib/bosh/deployer/instance_manager.rb:229:in `block (2 levels) in create_stemcell'
/usr/local/rvm/gems/ruby-1.9.3-p448/gems/bosh_cli_plugin_micro-1.5.0.pre.1181/lib/bosh/deployer/instance_manager.rb:79:in `step'
/usr/local/rvm/gems/ruby-1.9.3-p448/gems/bosh_cli_plugin_micro-1.5.0.pre.1181/lib/bosh/deployer/instance_manager.rb:228:in `block in create_stemcell'
/usr/local/rvm/rubies/ruby-1.9.3-p448/lib/ruby/1.9.1/tmpdir.rb:83:in `mktmpdir'
/usr/local/rvm/gems/ruby-1.9.3-p448/gems/bosh_cli_plugin_micro-1.5.0.pre.1181/lib/bosh/deployer/instance_manager.rb:214:in `create_stemcell'
/usr/local/rvm/gems/ruby-1.9.3-p448/gems/bosh_cli_plugin_micro-1.5.0.pre.1181/lib/bosh/deployer/instance_manager.rb:118:in `create'
"microbosh-openstack/bosh_micro_deploy.log" 215L, 28192C

我设置了一个 .yml 文件,出于安全原因,我无法真正发布该文件,但我已经通过我的 IAAS 支持验证我拥有正确的凭据。

有没有人在 Openstack 上看到过这样的错误?此外,我得到了一个堆栈跟踪,并且有一半想尝试调试。问题是我不精通调试这些大型开放项目。有谁知道解释如何开始调试它们的好资源?

4

1 回答 1

2

您看到的错误是由 OpenStack 拒绝您提供的凭据引起的。一个可能的陷阱:您是否将 Rackspace 帐户密码用于“PASSWORD”而不是 API 密钥?您可以通过登录您的帐户,单击右上角的用户名,然后从下拉菜单中选择“帐户设置”来找到您的 API 密钥。(由于问题标签,我假设您正在使用 Rackspace。)

您提到您已经通过您的提供商验证了它们——也许它们没有被正确传递?根据文档,您应该将它们放在micro_bosh.yml具有以下格式的文件中:

# ...
cloud:
  plugin: openstack
  properties:
    openstack:
      auth_url: http://<identity_server>:5000/v2.0
      username: <username>
      api_key: <password>
      tenant: <tenant>
      region: <region> # Optional
      default_security_groups: ["ssh", "bosh"]
      default_key_name: <microbosh_keypair>
      private_key: <path_to_microbosh_keypar_private_key>
# ...

请记住,YAML 对空格敏感。

至于调试开源项目,我能给的最好的指导就是不要害怕源码,要有耐心。bosh的源代码可在GitHub上找到,因此您可以轻松地在堆栈跟踪中浏览 源代码以尝试找出发生了什么。从您看到的实际异常或错误消息向后工作;尝试确定是什么进入了意外状态,并跟踪调用者以找出它是如何以这种方式结束的。阅读其他人的源代码是一项非常有用的技能,而且通过练习会变得更容易,所以努力吧!

于 2013-10-29T21:15:02.900 回答