1

我正在尝试在厨师中运行推送作业,但出现以下错误。尝试安装所需的宝石,但仍然错误相同。

[root@chefserver chef-repo]# knife node status
devapp1 available
[root@chefserver chef-repo]# knife job start uptime devapp1
/opt/chefdk/embedded/lib/ruby/2.4.0/rubygems/core_ext/kernel_require.rb:55:in `require': cannot load such file -- chef/rest (LoadError)
    from /opt/chefdk/embedded/lib/ruby/2.4.0/rubygems/core_ext/kernel_require.rb:55:in `require'
    from /opt/chefdk/embedded/lib/ruby/gems/2.4.0/gems/knife-push-1.0.2/lib/chef/knife/job_start.rb:27:in `block in <class:JobStart>'
    from /opt/chefdk/embedded/lib/ruby/gems/2.4.0/gems/chef-13.2.20/lib/chef/knife.rb:232:in `block in load_deps'
    from /opt/chefdk/embedded/lib/ruby/gems/2.4.0/gems/chef-13.2.20/lib/chef/knife.rb:231:in `each'
    from /opt/chefdk/embedded/lib/ruby/gems/2.4.0/gems/chef-13.2.20/lib/chef/knife.rb:231:in `load_deps'
    from /opt/chefdk/embedded/lib/ruby/gems/2.4.0/gems/chef-13.2.20/lib/chef/knife.rb:216:in `run'
    from /opt/chefdk/embedded/lib/ruby/gems/2.4.0/gems/chef-13.2.20/lib/chef/application/knife.rb:156:in `run'
    from /opt/chefdk/embedded/lib/ruby/gems/2.4.0/gems/chef-13.2.20/bin/knife:25:in `<top (required)>'
    from /bin/knife:263:in `load'
    from /bin/knife:263:in `<main>'
[root@chefserver chef-repo]# chef gem list |grep rest
rest (3.0.8)
stuartpreston-azure-sdk-for-ruby (0.7.2)
[root@chefserver chef-repo]# 
4

1 回答 1

0

在其他服务器上成功测试推送作业几天后,我自己得到了这个错误。看来这是在 chef-client 上引入的错误13.x。但是,我没有在他们的跟踪器上找到任何错误报告。

我正在使用chef-13.0.118-1并降级为chef-12.20.3-1) 并且它立即起作用:

$ knife job start teste nodetest --capture
Started.  Job ID: fa5f210d826e112b335abce48b1a27b7
.Complete.
capture_output: true
command:        teste
created_at:     Mon, 31 Jul 2017 20:45:15 GMT
env:
id:             fa5f210d826e112b335abce48b1a27b7
nodes:
  failed: nodetest
run_timeout:    3600
status:         complete
updated_at:     Mon, 31 Jul 2017 20:45:15 GMT
于 2017-07-31T20:53:07.700 回答