厨师工作站错误

时间:2014-12-29 11:23:07

标签: chef

我之前已经设置了厨师服务器和工作站,为它配置了节点,运行食谱并为厨师工作。但是最近我一直面对这个问题,过去几天一直困扰着我。

当我运行设置工作站的命令时,

knife configure -i

提示要求我们输入pem文件和服务器FQDN等位置的详细信息。

以下是错误:

[root@chef-server .chef]# knife configure -i
Overwrite /root/.chef/knife.rb? (Y/N) Y
Please enter the chef server URL: [https://myserver.example.com:443]
Please enter a name for the new user: [root] anyuser
Please enter the existing admin name: [admin]
Please enter the location of the existing admin's private key: [/etc/chef-server/admin.pem] ~/.chef/admin.pem
Please enter the validation clientname: [chef-validator]
Please enter the location of the validation key: [/etc/chef-server/chef-validator.pem] ~/.chef/chef-validator.pem
Please enter the path to a chef repository (or leave blank):
Creating initial API user...
Please enter a password for the new user:
ERROR: Service temporarily unavailable
/opt/chef/embedded/lib/ruby/2.1.0/net/http/response.rb:325:in `stream_check': undefined method `closed?' for nil:NilClass (NoMethodError)
        from /opt/chef/embedded/lib/ruby/2.1.0/net/http/response.rb:199:in `read_body'
        from /opt/chef/embedded/lib/ruby/2.1.0/net/http/response.rb:226:in `body'
        from /opt/chef/embedded/apps/chef/lib/chef/knife.rb:502:in `rescue in format_rest_error'
        from /opt/chef/embedded/apps/chef/lib/chef/knife.rb:500:in `format_rest_error'
        from /opt/chef/embedded/apps/chef/lib/chef/knife.rb:480:in `humanize_http_exception'
        from /opt/chef/embedded/apps/chef/lib/chef/knife.rb:430:in `humanize_exception'
        from /opt/chef/embedded/apps/chef/lib/chef/knife.rb:421:in `rescue in run_with_pretty_exceptions'
        from /opt/chef/embedded/apps/chef/lib/chef/knife.rb:412:in `run_with_pretty_exceptions'
        from /opt/chef/embedded/apps/chef/lib/chef/knife.rb:213:in `run'
        from /opt/chef/embedded/apps/chef/lib/chef/application/knife.rb:139:in `run'
        from /opt/chef/embedded/apps/chef/bin/knife:25:in `<top (required)>'
        from /usr/bin/knife:40:in `load'
        from /usr/bin/knife:40:in `<main>'

这是追踪。 感谢。

2 个答案:

答案 0 :(得分:5)

有时因代理而发生此错误 只需取消设置代理:

unset http_proxy
unset https_proxy 

答案 1 :(得分:0)

您使用的是哪个版本的厨师?我想知道您是否遇到CHEF-4010这是注册新用户的问题。 (刀命令的“-i”参数)。

作为Chef Server 11的解决方法,我可以建议您在Chef服务器上使用预先配置的“admin”用户。参见: