NoMethodError: undefined 方法 'full_name' for nil:NilClass for the Chef Zabbix cookbook



我正在使用zabbix食谱(https://supermarket.chef.io/cookbooks/zabbix)在我自己的一本食谱中,通过源代码在节点上安装zabbix代理。我指定:include_recipe "zabbix::agent",然后在食谱的berkshelf中。

问题是,如果我在节点上手动执行chef客户端,我认为没有问题。厨师运行成功完成。在每隔30分钟启动一次的厨师运行中,会出现此错误而失败。

[2015-03-26T18:02:01+00:00] INFO: Sending resource update report (run-id: aa2e95d5-32f5-4185-a049-5ea3808c0522)
[2015-03-26T18:02:02+00:00] ERROR: zabbix_source[install_zabbix_agent] (zabbix::agent_source line 36) had an error: NoMethodError: chef_gem[zabbixapi] (zabbix::_providers_common line 1) had an error: NoMethodError: undefined method `full_name' for nil:NilClass
[2015-03-26T18:02:02+00:00] ERROR: Chef::Exceptions::ChildConvergeError: Chef run process exited unsuccessfully (exit code 1)
[2015-03-26T18:02:02+00:00] ERROR: Sleeping for 1800 seconds before trying again

在调查过程中,我发现配方zabbix/recipes/_providers_common.rb就是安装gem zabbixapi的配方。但是,在仅使用zabbix::agent配方时,不会调用此配方,但我确实确认了在的节点中存在gem zabbixapi

/opt/chef/embedded/lib/ruby/gems/1.9.1/gems/zabbixapi-0.6.6/lib/zabbixapi

我也通过github为这本食谱提交了一个问题,但正在等待回复。

PS:厨师客户端11.4在使用

使用以下条目创建/etc/default/chef-client

#!/bin/bash
export LANG='en_US.UTF-8'
export LC_ALL='en_US.UTF-8'

并通过/etc/init.d/chef-client 获取

#added for the zabbix::agent recipe
[ -f /etc/default/chef-client ] && . /etc/default/chef-client

相关内容

最新更新