Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I've got a reasonably small (~10 hosts) puppet installation, and recently, I've started to get warning messages on every puppet agent run. The message is:

Info: Loading facts in /etc/puppet/modules/stdlib/lib/facter/root_home.rb
Info: Loading facts in /etc/puppet/modules/stdlib/lib/facter/facter_dot_d.rb
Info: Loading facts in /etc/puppet/modules/stdlib/lib/facter/puppet_vardir.rb
Info: Loading facts in /etc/puppet/modules/firewall/lib/facter/iptables.rb
Info: Loading facts in /etc/puppet/modules/concat/lib/facter/concat_basedir.rb
Info: Loading facts in /var/lib/puppet/lib/facter/root_home.rb
Info: Loading facts in /var/lib/puppet/lib/facter/concat_basedir.rb
Info: Loading facts in /var/lib/puppet/lib/facter/facter_dot_d.rb
Info: Loading facts in /var/lib/puppet/lib/facter/iptables.rb
Info: Loading facts in /var/lib/puppet/lib/facter/puppet_vardir.rb
Debug: catalog supports formats: b64_zlib_yaml dot pson raw yaml; using pson
Warning: Puppet.features.rubygems? is deprecated. Require rubygems in your application's entry point if you need it.
   (at /usr/lib/ruby/vendor_ruby/puppet/util/feature.rb:17:in `add')
Info: Caching catalog for hostname.example.com

I'm not 100% sure what changed - this is only a test environment, so we're not quite as strict about change management as we should be. It could be that a new puppet package was installed, or an extra module added - we don't know.

The problem is, I've no information to go on regarding what could be causing this. Grepping through my /etc/puppet/modules folder reveals a bunch of modules that use rubygems.

What's causing this warning, and how do I fix it?

share|improve this question

2 Answers 2

up vote 2 down vote accepted

This is by design as of Puppet 3.0.1.

If bundler is loaded, e.g. bundler exec puppet, then don’t load rubygems, since bundler has its own logic for managing gems in the current application environment. And the set of gems, versions, etc is often different than what gems you may have installed, via rvm for example.

If bundler is not loaded, fall back on the old behavior, which is to ensure rubygems is loaded before calling any puppet code. Ideally, this should be done in the bin/puppet script, however, that doesn’t work for rack setups, so we moved rubygems loading to the command line code, which is effectively the puppet application entry point.

Several features, e.g. stomp, were calling Puppet.features.rubygems? only for its side-effect of loading rubygems before evaluating the calling feature’s gems. This is no longer necessary now that we ensure the gem loading system is sane early on.

Custom features may be calling Puppet.features.rubygems?, so we’ve added a deprecation warning and preserved the old behavior (of explicitly requiring rubygems). It may be necessary to modify custom features in order to ensure puppet works correctly in a bundler environment.

If you've updated your puppetmaster to 3.0.1, you should update all your puppet agents as well. Or vice-versa.

share|improve this answer
    
I'm on puppet deb 3.1.0-1puppetlabs1 for both master and all clients and have been since first install. I'm confused as to why this has just started happening... –  growse Feb 26 '13 at 14:05
    
Bug in something? Explore with grep -R perhaps? –  Michael Hampton Feb 26 '13 at 19:57
    
I eventually narrowed this down to an errant few lines in the sensu puppet module. I've filed a bug on github: github.com/sensu/sensu-puppet/issues/23 –  growse Feb 27 '13 at 15:55

if any of the provider or anything else you are using which calls Puppet.features.rubygems? then this warning is shown. In past puppet used to load ruby gems inside libraries which was not the right way and was supposed to be deprecated. But to maintain the backward compatibility they have still kept this call alive and show a warning to indicate that this is not the right way.

share|improve this answer
    
So, given that this warning only just started appearing, how do I track down where it's being called? –  growse Feb 26 '13 at 14:07

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.