Chef infra 厨师工作站错误

Chef infra 厨师工作站错误,chef-infra,Chef Infra,我以前设置过chef服务器和工作站,为其配置了节点,运行了菜谱并在chef上工作过。但最近我一直面临着这个问题,这几天来一直困扰着我 当我运行设置工作站的命令时 刀配置-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:

我以前设置过chef服务器和工作站,为其配置了节点,运行了菜谱并在chef上工作过。但最近我一直面临着这个问题,这几天来一直困扰着我

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

刀配置-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>'
[root@chef-server.chef]#刀配置-i
是否覆盖/root/.chef/knife.rb?(是/否)是
请输入厨师长服务器URL:[https://myserver.example.com:443]
请输入新用户的名称:[root]anyuser
请输入现有管理员名称:[管理员]
请输入现有管理员私钥的位置:[/etc/chef server/admin.pem]~/.chef/admin.pem
请输入验证客户端名称:[chef validator]
请输入验证密钥的位置:[/etc/chef-server/chef-validator.pem]~/.chef/chef-validator.pem
请输入厨师库的路径(或留空):
正在创建初始API用户。。。
请输入新用户的密码:
错误:服务暂时不可用
/opt/chef/embedded/lib/ruby/2.1.0/net/http/response.rb:325:in'stream_check':nil:NilClass(NoMethodError)的未定义方法“closed”
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'
来自/opt/chef/embedded/apps/chef/lib/chef/knife.rb:502:“格式中的救援\u rest\u错误”
from/opt/chef/embedded/apps/chef/lib/chef/knife.rb:500:格式错误
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“人性化例外”
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`'
from/usr/bin/DOVE:40:in“装载”
from/usr/bin/knife:40:in`'
这是痕迹。
谢谢。

您使用的是什么版本的chef?我想知道您是否在注册新用户时遇到了问题。(刀命令的“-i”参数)

作为Chef Server 11的解决方案,我建议在Chef Server上使用预先配置的“admin”用户。见:


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

unset http_proxy
unset https_proxy 

非常感谢,这很有帮助,但我想知道这个错误是什么,是什么解决了这个问题。我们使用自己的参数,而不是刀子提示的参数。我想知道它怎么没有提示passwd,而passwd创建了问题。@vikramiyer“-i”参数在chef服务器上创建了一个新用户。这就是为什么我问您使用的是什么版本的chef(chef-4010在11.6.0版中修复)。我建议的解决方法使用了所有新chef服务器上的“admin”用户,解释了为什么没有提示您输入密码。解释得很好!:)现在,当我试图将节点(客户机)注册到服务器时,它抛出以下错误。如果这是一个新的Chef服务器,您应该真正使用Chef服务器12,而且它与Chef服务器12不兼容。@coderanger:请检查链接,我也在使用Chef 12时遇到了一些问题。