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

require 'xmlsimple' broken puppetserver if xml-simple version 1.1.9 is installed #8

Open
sharewax opened this issue Sep 29, 2022 · 0 comments

Comments

@sharewax
Copy link

after setup new puppet server we receive errors in /var/log/messages like:
/opt/puppetlabs/server/data/puppetserver/jruby-gems/gems/rexml-3.2.5/lib/rexml/parsers/baseparser.rb:108: warning: already initialized constant DEFAULT_ENTITIES

https://github.com/maik/xml-simple FAQ

Answer: The reason for this is, that you’re using XmlSimple explicitly in a rails app. XmlSimple is part of rails (you can find it in ./actionpack-1.12.5/lib/action_controller/vendor/xml_simple.rb). Unfortunately, the library is named "xml_simple.rb" and not "xmlsimple.rb". Ruby’s "require" prevents you from loading a library two times and it does so by checking if a file name occurs more than once. In your case somewhere in the rails framework "require 'xml_simple'" is performed and you run "require 'xmlsimple'" afterwards. Hence, the library is loaded twice and all constants are redefined.

A solution is to only require xml-simple unless XmlSimple has not been defined already.

Also the worst thing is:
ERROR [qtp222747617-2185] [puppetserver] Puppet Could not autoload puppet/parser/functions/clickhouse_config: load error: rexml/document -- java.lang.StackOverflowError: null

ERROR [qtp222747617-2185] [puppetserver] Puppet Evaluation Error: Error while evaluating a Resource Statement, Evaluation Error: Error while evaluating a Function Call, Could not autoload puppet/parser/functions/clickhouse_config: load error: rexml/document -- java.lang.StackOverflowError: null (file: /etc/puppetlabs/code/environments/production/modules/cluster/manifests/user.pp, line: 149, column: 24) (file: /etc/puppetlabs/code/environments/production/modules/cluster/manifests/init.pp, line: 31) on node xxxx.be.core.pw

currently we downgraded xml-simple to 1.1.8, but I suppose that require 'xmlsimple' should be changed to something different in lib/puppet/parser/functions/clickhouse_config.rb

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