我的刀具配置正常工作。Chef 服务器已更新到较新的版本。pem 文件匹配,刀具配置应该正确。
但是当我运行任何刀命令时..例如
knife user list
我收到此错误信息:
ERROR: The object you are looking for could not be found
C:/opscode/chefdk/embedded/lib/ruby/2.0.0/net/http/response.rb:325:in `stream_check': undefined method `closed?' for nil:NilClass (NoMethodError)
from C:/opscode/chefdk/embedded/lib/ruby/2.0.0/net/http/response.rb:199:in `read_body'
from C:/opscode/chefdk/embedded/lib/ruby/2.0.0/net/http/response.rb:226:in `body'
from C:/opscode/chefdk/embedded/apps/chef/lib/chef/knife.rb:573:in `rescue in format_rest_error'
from C:/opscode/chefdk/embedded/apps/chef/lib/chef/knife.rb:571:in `format_rest_error'
from C:/opscode/chefdk/embedded/apps/chef/lib/chef/knife.rb:542:in `humanize_http_exception'
from C:/opscode/chefdk/embedded/apps/chef/lib/chef/knife.rb:508:in `humanize_exception'
from C:/opscode/chefdk/embedded/apps/chef/lib/chef/knife.rb:499:in `rescue in run_with_pretty_exceptions'
from C:/opscode/chefdk/embedded/apps/chef/lib/chef/knife.rb:487:in `run_with_pretty_exceptions'
from C:/opscode/chefdk/embedded/apps/chef/lib/chef/knife.rb:174:in `run'
from C:/opscode/chefdk/embedded/apps/chef/lib/chef/application/knife.rb:139:in `run'
from C:/opscode/chefdk/embedded/apps/chef/bin/knife:25:in `<top (required)>'
from C:/opscode/chefdk/bin/knife:44:in `load'
from C:/opscode/chefdk/bin/knife:44:in `<main>'
工作站上的 Chef 版本是 11.16.0,Chef Server 是 12.rc5。
答案1
我在使用 ChefDK 时也遇到了同样的问题。原因是我的 knife.rb 中有一个无法解析的值。我已将配置从 Windows 工作站复制到 Mac。所以我的食谱路径 c:... 毫无意义,所有配置值(包括 pem 路径)都被忽略了。