Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Missing service_name #37

Open
MrMMorris opened this issue Apr 1, 2014 · 1 comment
Open

Missing service_name #37

MrMMorris opened this issue Apr 1, 2014 · 1 comment

Comments

@MrMMorris
Copy link

I have no idea why this is happening... was working before.

Running 1.4.3 on Ubuntu 12.04 w/ vagrant and chef-solo

Chef::Exceptions::InvalidResourceSpecification

The string service[]' is not valid for resource collection lookup. Correct syntax isresource_type[resource_name]'

Cookbook Trace:

/etc/chef/chef-solo-1/cookbooks/munin/recipes/client.rb:50:in `block in from_file'

Relevant File Content:

/etc/chef/chef-solo-1/cookbooks/munin/recipes/client.rb:

43:
44: package 'munin-node'
45:
46: template "#{node['munin']['basedir']}/munin-node.conf" do
47: source 'munin-node.conf.erb'
48: mode '0644'
49: variables :munin_server_ips => munin_server_ips
50>> notifies :restart, "service[#{service_name}]"
51: end
52:
53: case node['platform']
54: when 'arch', 'smartos'
55: execute 'munin-node-configure --shell | sh' do
56: not_if { Dir.entries(node['munin']['plugins']).length > 2 }
57: notifies :restart, "service[#{service_name}]"
58: end
59: end

It works when I explicitly set node.default['munin']['service_name'] = "munin-node" but then fails further down the line almost as if the attributes file doesn't exist....

Please tell me I'm missing something silly :)

@MrMMorris
Copy link
Author

so... more weirdness. If I have node.default['munin']['server_list'] set, then it fails with the above, but If I don't have that set, then it fails (where it should if the attribute isn't set) at line 21:

undefined method `[]' for nil:NilClass

21>> service_name = node['munin']['service_name']

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant