Ask Your Question
0

interpolation.rb "warning: already initialized constant"

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

marcp gravatar image

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

joshc gravatar image

Hi,

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

Comments

This isn't a question. Go there → https://tickets.puppetlabs.com/ to file an issue about software bugs.

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

1 Answer

Sort by » oldest newest most voted
0

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

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

Your Answer

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

Add Answer

Question Tools

1 follower

Stats

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

Seen: 63 times

Last updated: Aug 10