Ask Your Question

interpolation.rb "warning: already initialized constant"

asked 2017-07-09 08:58:50 -0600

marcp gravatar image

updated 2017-08-10 00:08:51 -0600

joshc gravatar image


I'm not quite sure what the issue is with the warning messages. This is a fresh install of PE 2017.2 on a RHEL 7.3 machine. I suspect that this is due to the symlink of /apps/puppetlabs/puppet-enterprise-2017.2/data/opt to /opt/puppetlabs but that is just specuation.

[root@servername ~]# puppet agent -t
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/pops/lookup/interpolation.rb:33: warning: already initialized constant Puppet::Pops::Lookup::Interpolation::EMPTY_INTERPOLATIONS
/apps/puppetlabs/puppet-enterprise-2017.2/data/opt/puppet/lib/ruby/vendor_ruby/puppet/pops/lookup/interpolation.rb:33: warning: previous definition of EMPTY_INTERPOLATIONS was here
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/pops/lookup/interpolation.rb:43: warning: already initialized constant Puppet::Pops::Lookup::Interpolation::QUOTED_KEY
/apps/puppetlabs/puppet-enterprise-2017.2/data/opt/puppet/lib/ruby/vendor_ruby/puppet/pops/lookup/interpolation.rb:43: warning: previous definition of QUOTED_KEY was here
Info: Using configured environment 'production'
Info: Retrieving pluginfacts
Info: Retrieving plugin
Info: Loading facts
Info: Caching catalog for <servername>


edit retag flag offensive close merge delete


This isn't a question. Go there → to file an issue about software bugs.

Kai Burghardt gravatar imageKai Burghardt ( 2017-07-09 11:17:07 -0600 )edit

1 Answer

Sort by » oldest newest most voted

answered 2017-08-10 00:14:47 -0600

joshc gravatar image

The error occurs if you try to redefine a constant in ruby. In this case, I think puppet's ruby code appears in the $LOAD_PATH twice due to the symlink. As a result the puppet code is parsed twice, and the second parse generates the harmless warning. That said you could see performance problems when puppet needs to load code during compilation.

What does the following print?

 $ /opt/puppetlabs/puppet/bin/ruby -rpp -e 'puts $LOAD_PATH'
edit flag offensive delete link more


Than you for the information, what is the fix for this error? We created symlinks on our puppetmasters and now this error is thrown.

JMcMahan gravatar imageJMcMahan ( 2017-10-24 06:39:26 -0600 )edit

Cmd /opt/puppetlabs/puppet/lib/ruby/site_ruby/2.1.0 /opt/puppetlabs/puppet/lib/ruby/site_ruby/2.1.0/x86_64-linux /opt/puppetlabs/puppet/lib/ruby/site_ruby /opt/puppetlabs/puppet/lib/ruby/vendor_ruby/2.1.0 /opt/puppetlabs/puppet/lib/ruby/vendor_ruby/2.1.0/x86_64-linux

JMcMahan gravatar imageJMcMahan ( 2017-10-24 06:40:41 -0600 )edit

and finally /opt/puppetlabs/puppet/lib/ruby/vendor_ruby /opt/puppetlabs/puppet/lib/ruby/2.1.0 /opt/puppetlabs/puppet/lib/ruby/2.1.0/x86_64-linux

JMcMahan gravatar imageJMcMahan ( 2017-10-24 06:42:00 -0600 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools



Asked: 2017-07-09 08:58:50 -0600

Seen: 273 times

Last updated: Aug 10 '17