Chef infra Can';t从windows工作站上载烹饪书

Chef infra Can';t从windows工作站上载烹饪书,chef-infra,Chef Infra,我已经在linux机器上运行了我的chef服务器。我有我的工作站设置(刀配置) 在我的Windows7机器上。我已输入命令刀节点列表。它工作正常,并显示与服务器连接的节点。 但当我试图上传烹饪书时,它显示了以下错误。我找了很多关于这个错误的东西弄糊涂了这是怎么回事 $knife cookbook upload mycookbook ERROR: knife encountered an unexpected error This may be a bug in the 'cookbook u

我已经在linux机器上运行了我的chef服务器。我有我的工作站设置(刀配置) 在我的Windows7机器上。我已输入命令刀节点列表。它工作正常,并显示与服务器连接的节点。 但当我试图上传烹饪书时,它显示了以下错误。我找了很多关于这个错误的东西弄糊涂了这是怎么回事

$knife cookbook upload mycookbook


ERROR: knife encountered an unexpected error
This may be a bug in the 'cookbook upload' knife command or plugin
Please collect the output of this command with the `-VV` option before filing a bug report.
Exception: NoMethodError: undefined method `on_create' for Chef::Cookbook::FileVendor:Class
任何建议

INFO: Using configuration from F:/chef-repo/.chef/knife.rb
DEBUG: Chef::HTTP calling Chef::HTTP::JSONInput#handle_request
DEBUG: Chef::HTTP calling Chef::HTTP::JSONToModelOutput#handle_request
DEBUG: Chef::HTTP calling Chef::HTTP::CookieManager#handle_request
DEBUG: Chef::HTTP calling Chef::HTTP::Decompressor#handle_request
DEBUG: Chef::HTTP calling Chef::HTTP::Authenticator#handle_request
DEBUG: Signing the request as admin
DEBUG: Chef::HTTP calling Chef::HTTP::RemoteRequestID#handle_request
DEBUG: Chef::HTTP calling Chef::HTTP::ValidateContentLength#handle_request
DEBUG: Initiating GET to serverurl?num_versions=all
DEBUG: ---- HTTP Request Header Data: ----
DEBUG: Accept: application/json
DEBUG: Accept-Encoding: gzip;q=1.0,deflate;q=0.6,identity;q=0.3
DEBUG: X-OPS-SIGN: algorithm=sha1;version=1.0;
DEBUG: X-OPS-USERID: admin
DEBUG: X-OPS-TIMESTAMP: 2015-01-12T05:49:21Z
DEBUG: X-OPS-CONTENT-HASH: 2jmj7l5rSw0yVb/vlWAYkK/YBwk=
DEBUG: X-OPS-AUTHORIZATION-1: h8n6BlUYhBvdDhRgstYdefwD+g48+BNqRmiEKaHJ2xGjgfwQm79BPTZfp5rE
DEBUG: X-OPS-AUTHORIZATION-2: ABDYQEs8VPwPknNStKOiG6ldH1omKs3uaTB+dihAAvSaK45wtu0T+J3WMK5J
DEBUG: X-OPS-AUTHORIZATION-3: 3jJjujyC9DzkuNpyjj9UikVRi6a+39OVLaJkONu6il+w4L4TInHJ+ktxcmfw
DEBUG: X-OPS-AUTHORIZATION-4: rBKKgDIuDOJNRNauIYxwlSuSSOWqidum++fM+OIy9HxGSuxdX9Km71Z3txJa
DEBUG: X-OPS-AUTHORIZATION-5: Iie3p4PItta9iQbtCof9je8DYh/kJr0SgibWwHIb46XRia8W+GPywS3eI0WQ
DEBUG: X-OPS-AUTHORIZATION-6: 6wjRrXcUwuB2PbdRAAVzU/15mObukJohXBOxclbyzg==
DEBUG: HOST: hostname
DEBUG: X-REMOTE-REQUEST-ID: 921c227b-2a13-4a53-b44d-98d8efee0722
DEBUG: ---- End HTTP Request Header Data ----
DEBUG: ---- HTTP Status and Header Data: ----
DEBUG: HTTP 1.1 200 OK
DEBUG: server: nginx/1.4.4
DEBUG: date: Mon, 12 Jan 2015 05:46:36 GMT
DEBUG: content-type: application/json
DEBUG: transfer-encoding: chunked
DEBUG: connection: close
DEBUG: x-ops-api-info: flavor=osc;version=11.0.2;erchef=1.4.1
DEBUG: content-encoding: gzip
DEBUG: ---- End HTTP Status/Header Data ----
DEBUG: Chef::HTTP calling Chef::HTTP::ValidateContentLength#handle_response
DEBUG: HTTP server did not include a Content-Length header in response, cannot identify truncated downloads.
DEBUG: Chef::HTTP calling Chef::HTTP::RemoteRequestID#handle_response
DEBUG: Chef::HTTP calling Chef::HTTP::Authenticator#handle_response
DEBUG: Chef::HTTP calling Chef::HTTP::Decompressor#handle_response
DEBUG: decompressing gzip response
DEBUG: Chef::HTTP calling Chef::HTTP::CookieManager#handle_response
DEBUG: Chef::HTTP calling Chef::HTTP::JSONToModelOutput#handle_response
DEBUG: Chef::HTTP calling Chef::HTTP::JSONInput#handle_response
C:/opscode/chefdk/embedded/lib/ruby/gems/2.0.0/gems/chef-11.6.0/lib/chef/knife/cookbook_upload.rb:179:in `cookbook_repo': undefined method `on_create' for Chef::C
ookbook::FileVendor:Class (NoMethodError)
        from C:/opscode/chefdk/embedded/lib/ruby/gems/2.0.0/gems/chef-11.6.0/lib/chef/knife/cookbook_upload.rb:163:in `block in cookbooks_to_upload'
        from C:/opscode/chefdk/embedded/lib/ruby/gems/2.0.0/gems/chef-11.6.0/lib/chef/knife/cookbook_upload.rb:160:in `each'
        from C:/opscode/chefdk/embedded/lib/ruby/gems/2.0.0/gems/chef-11.6.0/lib/chef/knife/cookbook_upload.rb:160:in `cookbooks_to_upload'
        from C:/opscode/chefdk/embedded/lib/ruby/gems/2.0.0/gems/chef-11.6.0/lib/chef/knife/cookbook_upload.rb:119:in `run'
        from C:/opscode/chefdk/embedded/lib/ruby/gems/2.0.0/gems/chef-12.0.0.rc.0-x86-mingw32/lib/chef/knife.rb:409:in `block in run_with_pretty_exceptions'
        from C:/opscode/chefdk/embedded/lib/ruby/gems/2.0.0/gems/chef-12.0.0.rc.0-x86-mingw32/lib/chef/local_mode.rb:38:in `with_server_connectivity'
        from C:/opscode/chefdk/embedded/lib/ruby/gems/2.0.0/gems/chef-12.0.0.rc.0-x86-mingw32/lib/chef/knife.rb:408:in `run_with_pretty_exceptions'
        from C:/opscode/chefdk/embedded/lib/ruby/gems/2.0.0/gems/chef-12.0.0.rc.0-x86-mingw32/lib/chef/knife.rb:205:in `run'
        from C:/opscode/chefdk/embedded/lib/ruby/gems/2.0.0/gems/chef-12.0.0.rc.0-x86-mingw32/lib/chef/application/knife.rb:139:in `run'
        from C:/opscode/chefdk/embedded/lib/ruby/gems/2.0.0/gems/chef-12.0.0.rc.0-x86-mingw32/bin/knife:25:in `<top (required)>'
        from C:/opscode/chefdk/embedded/bin/knife:23:in `load'
        from C:/opscode/chefdk/embedded/bin/knife:23:in `<main>'
INFO:使用来自F:/chef repo/.chef/knife.rb的配置
调试:Chef::HTTP调用Chef::HTTP::JSONInput#handle#u请求
调试:Chef::HTTP调用Chef::HTTP::JSONToModelOutput#处理#请求
调试:Chef::HTTP调用Chef::HTTP::CookieManager#处理请求
调试:Chef::HTTP调用Chef::HTTP::解压缩程序#处理#请求
调试:Chef::HTTP调用Chef::HTTP::Authenticator#handle_请求
调试:以管理员身份对请求进行签名
调试:Chef::HTTP调用Chef::HTTP::RemoteRequestID#处理#请求
调试:Chef::HTTP调用Chef::HTTP::ValidateContentLength#处理请求
调试:启动GET to serverurl?num_versions=all
调试:---HTTP请求头数据:----
调试:接受:应用程序/json
调试:接受编码:gzip;q=1.0,放气;q=0.6,同一性;q=0.3
调试:X-OPS-SIGN:algorithm=sha1;版本=1.0;
调试:X-OPS-USERID:admin
调试:X-OPS-TIMESTAMP:2015-01-12T05:49:21Z
调试:X-OPS-CONTENT-HASH:2jmj7l5rSw0yVb/vlWAYkK/YBwk=
调试:X-OPS-AUTHORIZATION-1:H8N6BLUYHBDDHRGSTYDEFWD+g48+BNqRmiEKaHJ2xGjgfwQm79BPTZfp5rE
调试:X-OPS-AUTHORIZATION-2:ABDYQEs8VPwPknNStKOiG6ldH1omKs3uaTB+dihAAvSaK45wtu0T+J3WMK5J
调试:X-OPS-AUTHORIZATION-3:3JJJJJYC9DZKUNPYJJ9UIKVRI6A+39OVLAJKON6IL+w4L4TInHJ+ktxcmfw
调试:X-OPS-AUTHORIZATION-4:rbkkgdiudojrnauiyxwlsussowqidum++fM+OIy9HxGSuxdX9Km71Z3txJa
调试:X-OPS-AUTHORIZATION-5:Iie3p4PItta9iQbtCof9je8DYh/kJr0SgibWwHIb46XRia8W+GPywS3eI0WQ
调试:X-OPS-AUTHORIZATION-6:6WJRRXCUW2PBDRAAVZU/15mObukJohXBOxclbyzg==
调试:主机:主机名
调试:X-REMOTE-REQUEST-ID:921c227b-2a13-4a53-b44d-98d8efee0722
调试:-----结束HTTP请求头数据----
调试:---HTTP状态和头数据:----
调试:HTTP1.1200OK
调试:服务器:nginx/1.4.4
调试:日期:2015年1月12日星期一05:46:36 GMT
调试:内容类型:application/json
调试:传输编码:分块
调试:连接:关闭
调试:x-ops-api-info:flavor=osc;版本=11.0.2;erchef=1.4.1
调试:内容编码:gzip
调试:-----结束HTTP状态/头数据----
调试:Chef::HTTP调用Chef::HTTP::ValidateContentLength#handle_响应
调试:HTTP服务器响应中未包含内容长度标头,无法识别截断的下载。
调试:Chef::HTTP调用Chef::HTTP::RemoteRequestID#handle#响应
调试:Chef::HTTP调用Chef::HTTP::Authenticator#handle_响应
调试:Chef::HTTP调用Chef::HTTP::解压缩程序#处理#响应
调试:解压缩gzip响应
调试:Chef::HTTP调用Chef::HTTP::CookieManager#处理#响应
调试:Chef::HTTP调用Chef::HTTP::JSONToModelOutput#handle_响应
调试:Chef::HTTP调用Chef::HTTP::JSONInput#handle#u响应
C:/opscode/chefdk/embedded/lib/ruby/gems/2.0.0/gems/chef-11.6.0/lib/chef/knife/cookbook_upload.rb:179:in'cookbook_repo':未定义chef::C的“on_create”方法
ookbook::FileVendor:Class(NoMethodError)
来自C:/opscode/chefdk/embedded/lib/ruby/gems/2.0.0/gems/chef-11.6.0/lib/chef/knife/cookbook_upload.rb:163:'block in cookbooks_to_upload'
来自C:/opscode/chefdk/embedded/lib/ruby/gems/2.0.0/gems/chef-11.6.0/lib/chef/knife/cookbook_upload.rb:160:in'each'
来自C:/opscode/chefdk/embedded/lib/ruby/gems/2.0.0/gems/chef-11.6.0/lib/chef/knife/cookbook_upload.rb:160:in'cookbook_to_upload'
来自C:/opscode/chefdk/embedded/lib/ruby/gems/2.0.0/gems/chef-11.6.0/lib/chef/knife/cookbook_upload.rb:119:in'run'
来自C:/opscode/chefdk/embedded/lib/ruby/gems/2.0.0/gems/chef-12.0.0.rc.0-x86-mingw32/lib/chef/knife.rb:409:in `运行中的块与`漂亮`异常'
来自C:/opscode/chefdk/embedded/lib/ruby/gems/2.0.0/gems/chef-12.0.0.rc.0-x86-mingw32/lib/chef/local_mode.rb:38:“与服务器连接”
来自C:/opscode/chefdk/embedded/lib/ruby/gems/2.0.0/gems/chef-12.0.0.rc.0-x86-mingw32/lib/chef/knife.rb:408:在“运行时有漂亮的例外”
来自C:/opscode/chefdk/embedded/lib/ruby/gems/2.0.0/gems/chef-12.0.0.rc.0-x86-mingw32/lib/chef/knife.rb:205:在“运行”中
来自C:/opscode/chefdk/embedded/lib/ruby/gems/2.0.0/gems/chef-12.0.0.rc.0-x86-mingw32/lib/chef/application/knife.rb:139:在“运行”中
来自C:/opscode/chefdk/embedded/lib/ruby/gems/2.0.0/gems/chef-12.0.0.rc.0-x86-mingw32/bin/knife:25:in`'
从C:/opscode/chefdk/embedded/bin/knife:23:“加载”中
从C:/opscode/chefdk/embedded/bin/knife:23:in`'

真的不确定为什么会出现这种厨师版本的混合,您是否在chef dk之外添加了宝石,这可能会导致出现这种情况

from C:/opscode/chefdk/embedded/lib/ruby/gems/2.0.0/gems/chef-11.6.0/lib/chef/knife/cookbook_upload.rb:119:in `run'
from C:/opscode/chefdk/embedded/lib/ruby/gems/2.0.0/gems/chef-12.0.0.rc.0-x86-mingw32/lib/chef/knife.rb:409:in `block in run_with_pretty_exceptions'
我建议清理并重新安装chef dk(保留pem文件和配置文件)


您也可以尝试使用以下命令清理11.6版本:
c:\opscode\chefdk\embedded\bin\gem uninstall chef-v 11.6.0
,但不能保证它会解决您的问题(或者可能会造成其他问题)。

如果您在MyOkBook目录下的windows下,请走开,使用
cd..
knife必须将dir更改为它,并且无法在Windows下运行如果@Tensibai解决方案对您不起作用,您可以尝试使用
-VV
标志运行命令并提供更多信息吗?可以。我从我的cookbook目录中尝试了这个命令,并提交了带有-VV标志的错误。我在同一台windows计算机上安装了我的chef客户端代理。在我用上面的命令c:\opscode\chefdk\embedded\bin\gem uninstall chef-v 11.6.0 Knife node list命令清理了11.6版本之后,该命令也不起作用。重做一个新的安装,您的path Env var被旧的引用和其他边缘情况搞得一团糟。无论如何,厨师客户是厨师dk的一部分