Skip to content

chef > 15 issue #166

@viv86od

Description

@viv86od

Hi,

getting error on chef version higher then 15

NoMethodError

undefined method `td_agent_gem' for cookbook: td-agent, recipe: configure :Chef::Recipe

Cookbook Trace: (most recent call first)

/var/chef/cache/cookbooks/td-agent/recipes/configure.rb:36:in `block in from_file'
/var/chef/cache/cookbooks/td-agent/recipes/configure.rb:25:in `each'
/var/chef/cache/cookbooks/td-agent/recipes/configure.rb:25:in `from_file'
/var/chef/cache/cookbooks/td-agent/recipes/default.rb:9:in `from_file'
/var/chef/cache/cookbooks/base/recipes/_td_agent.rb:34:in `from_file'
/var/chef/cache/cookbooks/base/recipes/chef.rb:130:in `from_file'
/var/chef/cache/cookbooks/base/recipes/default.rb:168:in `from_file'

Relevant File Content:

/var/chef/cache/cookbooks/td-agent/recipes/configure.rb:

29: plugin true
30: %w{action version source options gem_binary}.each do |attr|
31: send(attr, plugin_attributes[attr]) if plugin_attributes[attr]
32: end
33: notifies :restart, "service[td-agent]", :delayed
34: end
35: elsif plugin.is_a?(String)
36>> td_agent_gem plugin do
37: plugin true
38: notifies :restart, "service[td-agent]", :delayed
39: end
40: end
41: end
42:
43: service "td-agent" do
44: supports :restart => true, :reload => (reload_action == :reload), :status => true
45: restart_command "/etc/init.d/td-agent restart || /etc/init.d/td-agent start"

System Info:

chef_version=16.18.30
platform=ubuntu
platform_version=16.04
ruby=ruby 2.7.5p203 (2021-11-24 revision f69aeb8314) [x86_64-linux]
program_name=/usr/bin/chef-client
executable=/opt/chef/bin/chef-client

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions