basho-labs/riak-chef-cookbook

chef-client in daemon mode fails due to try to redeclare the Tuple class

Closed this issue · 6 comments

When chef-client is running in daemon mode it returns this error:

TypeError: superclass mismatch for class Tuple
/var/cache/chef/cookbooks/riak/libraries/riak_template_helper.rb:21
/usr/lib/ruby/vendor_ruby/chef/run_context.rb:82:in load' /usr/lib/ruby/vendor_ruby/chef/run_context.rb:82:inload_libraries'
/usr/lib/ruby/vendor_ruby/chef/run_context.rb:120:in call' /usr/lib/ruby/vendor_ruby/chef/run_context.rb:120:inforeach_cookbook_load_segment'
/usr/lib/ruby/vendor_ruby/chef/run_context.rb:119:in each' /usr/lib/ruby/vendor_ruby/chef/run_context.rb:119:inforeach_cookbook_load_segment'
/usr/lib/ruby/vendor_ruby/chef/run_context.rb:117:in each' /usr/lib/ruby/vendor_ruby/chef/run_context.rb:117:inforeach_cookbook_load_segment'
/usr/lib/ruby/vendor_ruby/chef/run_context.rb:80:in load_libraries' /usr/lib/ruby/vendor_ruby/chef/run_context.rb:57:inload'
/usr/lib/ruby/vendor_ruby/chef/client.rb:199:in setup_run_context' /usr/lib/ruby/vendor_ruby/chef/client.rb:162:inrun'
/usr/lib/ruby/vendor_ruby/chef/application/client.rb:254:in run_application' /usr/lib/ruby/vendor_ruby/chef/application/client.rb:241:inloop'
/usr/lib/ruby/vendor_ruby/chef/application/client.rb:241:in run_application' /usr/lib/ruby/vendor_ruby/chef/application.rb:70:inrun'
/usr/bin/chef-client:25

Debian version: 6.0.5
chef-client varsion: 10.12.0
chef debian package version: 10.12.0-1
riak cookbook version: 1.1.0

What is the ruby version?

I forgot to mention it... sorry

ruby 1.8.7 (2010-08-16 patchlevel 302) [x86_64-linux]

I can't seem to reproduce this given the versions provided on a fresh VM. What gems do you have installed (gem list)?

So I am able to replicate the superclass mismatch if I have two copies of the riak cookbook in the cookbooks directory (chef-solo). Do you happen to have another cookbook defining or opening a Tuple class? It could also be another gem that is installed on the system. It seems that not using DelegateClass sidesteps the issue so I'll check that changing it doesn't break anything.

So what is the solution? I'm having exactly the same problem in a multi-server setup.

As of b647f81 we've moved to an entirely new template helper that resolves the issues encountered with the old riak_template_helper.