Bug 1229703
Summary: | Error 400 on SERVER: Could not retrieve facts for ...: undefined method `sanitize' | ||
---|---|---|---|
Product: | [Fedora] Fedora | Reporter: | Michael J. Chudobiak <mjc> |
Component: | puppet | Assignee: | Jeroen van Meeuwen <vanmeeuwen+fedora> |
Status: | CLOSED EOL | QA Contact: | Fedora Extras Quality Assurance <extras-qa> |
Severity: | unspecified | Docs Contact: | |
Priority: | unspecified | ||
Version: | 22 | CC: | bugzilla.redhat, dcleal, djschaap, erik, fedora, gchamoul, jnimety, jose.p.oliveira.oss, k.georgiou, lzap, marianne, mastahnke, mmagr, moses, m, nman64, s, tmz, vanmeeuwen+fedora |
Target Milestone: | --- | ||
Target Release: | --- | ||
Hardware: | Unspecified | ||
OS: | Unspecified | ||
Whiteboard: | |||
Fixed In Version: | Doc Type: | Bug Fix | |
Doc Text: | Story Points: | --- | |
Clone Of: | Environment: | ||
Last Closed: | 2016-07-19 14:43:43 UTC | Type: | Bug |
Regression: | --- | Mount Type: | --- |
Documentation: | --- | CRM: | |
Verified Versions: | Category: | --- | |
oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |
Cloudforms Team: | --- | Target Upstream Version: | |
Embargoed: |
Description
Michael J. Chudobiak
2015-06-09 13:18:06 UTC
Versions: puppet-4.1.0-1.fc22.noarch puppet-server-4.1.0-1.fc22.noarch We're receiving the same error trying to upgrade to 4.1.0-1, running puppet master with --trace identifies the offending line of code. #/usr/bin/ruby-mri /usr/bin/puppet master --no-daemonize --trace ... Error: Failed when searching for node bastion: Could not retrieve facts for bastion: undefined method `sanitize' for #<Hash:0x000000017c7e68> /usr/share/ruby/vendor_ruby/puppet/node.rb:103:in `fact_merge' /usr/share/ruby/vendor_ruby/puppet/indirector/node/plain.rb:17:in `find' /usr/share/ruby/vendor_ruby/puppet/indirector/indirection.rb:194:in `find' /usr/share/ruby/vendor_ruby/puppet/indirector/catalog/compiler.rb:109:in `block in find_node' /usr/share/ruby/vendor_ruby/puppet/util/profiler/around_profiler.rb:58:in `profile' /usr/share/ruby/vendor_ruby/puppet/util/profiler.rb:51:in `profile' /usr/share/ruby/vendor_ruby/puppet/indirector/catalog/compiler.rb:106:in `find_node' /usr/share/ruby/vendor_ruby/puppet/indirector/catalog/compiler.rb:145:in `node_from_request' /usr/share/ruby/vendor_ruby/puppet/indirector/catalog/compiler.rb:47:in `find' /usr/share/ruby/vendor_ruby/puppet/indirector/indirection.rb:194:in `find' /usr/share/ruby/vendor_ruby/puppet/network/http/api/indirected_routes.rb:134:in `do_find' /usr/share/ruby/vendor_ruby/puppet/network/http/api/indirected_routes.rb:48:in `block in call' /usr/share/ruby/vendor_ruby/puppet/context.rb:64:in `override' /usr/share/ruby/vendor_ruby/puppet.rb:223:in `override' /usr/share/ruby/vendor_ruby/puppet/network/http/api/indirected_routes.rb:47:in `call' /usr/share/ruby/vendor_ruby/puppet/network/http/route.rb:82:in `block in process' /usr/share/ruby/vendor_ruby/puppet/network/http/route.rb:81:in `each' /usr/share/ruby/vendor_ruby/puppet/network/http/route.rb:81:in `process' /usr/share/ruby/vendor_ruby/puppet/network/http/route.rb:87:in `process' /usr/share/ruby/vendor_ruby/puppet/network/http/route.rb:87:in `process' /usr/share/ruby/vendor_ruby/puppet/network/http/handler.rb:60:in `block in process' /usr/share/ruby/vendor_ruby/puppet/util/profiler/around_profiler.rb:58:in `profile' /usr/share/ruby/vendor_ruby/puppet/util/profiler.rb:51:in `profile' /usr/share/ruby/vendor_ruby/puppet/network/http/handler.rb:58:in `process' /usr/share/ruby/vendor_ruby/puppet/network/http/webrick/rest.rb:49:in `block in service' /usr/share/ruby/vendor_ruby/puppet/network/http/webrick/rest.rb:48:in `synchronize' /usr/share/ruby/vendor_ruby/puppet/network/http/webrick/rest.rb:48:in `service' /usr/share/ruby/webrick/httpserver.rb:138:in `service' /usr/share/ruby/webrick/httpserver.rb:94:in `run' /usr/share/ruby/vendor_ruby/puppet/network/http/webrick.rb:33:in `block (2 levels) in listen' /usr/share/ruby/webrick/server.rb:294:in `call' /usr/share/ruby/webrick/server.rb:294:in `block in start_thread' It turns out that puppet requires SafeYAML::OPTIONS[:default_mode] = :unsafe this warning tipped me off: Called 'load_file' without the :safe option -- defaulting to safe mode. You can avoid this warning in the future by setting the SafeYAML::OPTIONS[:default_mode] option (to :safe or :unsafe). My very temporary solution: Modify /usr/share/ruby/vendor_ruby/puppet/indirector/yaml.rb directly and added "SafeYAML::OPTIONS[:default_mode] = :unsafe" to the top of the file. That temporary override does fix the issue here too. maybe rubygem-safe_yaml shouldn't be a prereq for puppet/puppet-server. That does indeed fix the issue. I am still seeing this warning on the agent: # puppet agent --no-daemonize --onetime --logdest console Called 'load_file' without the :safe option -- defaulting to safe mode. You can avoid this warning in the future by setting the SafeYAML::OPTIONS[:default_mode] option (to :safe or :unsafe). Notice: Applied catalog in 0.35 seconds However it appears to work nontheless. That workaround sort of fixed the issue, but not completely. For instance "puppet cert list" still has the same problem. It seems unfortunate to make puppet depend on safe_yaml only to effectively disable it right away by putting it in unsafe mode. Anyway, I now completely disabled it by commenting out the one line in /usr/share/ruby/vendor_ruby/puppet/vendor/require_vendored.rb (this is where safe_yaml is pulled in). It would be great if upstream could make puppet work with safe_yaml in safe mode, but in the mean time disabling safe_yaml is the way to make puppet work in Fedora. I have started to see the error with the latest version of Fedora. These manifests ran fine a couple of weeks ago and still run correctly on RHEL 6.4 and RHEL 7. They ran correctly on the Fedora22 nodes until last week's dnf update. matt@aslan:54% uname -a Linux aslan.campbell.littlelionstudios.com 4.1.6-201.fc22.x86_64 #1 SMP Fri Sep 4 17:49:24 UTC 2015 x86_64 x86_64 x86_64 GNU/Linux matt@aslan:55% cat /etc/redhat-release Fedora release 22 (Twenty Two) matt@aslan:56% rpm -qa puppet puppet-4.1.0-4.fc22.noarch matt@aslan:57% rpm -qa ruby ruby-2.2.3-44.fc22.x86_64 matt@aslan:58% sudo puppet agent -t Called 'load_file' without the :safe option -- defaulting to safe mode. You can avoid this warning in the future by setting the SafeYAML::OPTIONS[:default_mode] option (to :safe or :unsafe). Warning: Unable to fetch my node definition, but the agent run will continue: Warning: Error 400 on SERVER: Could not retrieve facts for aslan.campbell.littlelionstudios.com: undefined method `sanitize' for #<Hash:0x007f5c5c65b5e8> Info: Retrieving pluginfacts Info: Retrieving plugin Info: Loading facts Error: Could not retrieve catalog from remote server: Error 400 on SERVER: Failed when searching for node aslan.campbell.littlelionstudios.com: Could not retrieve facts for aslan.campbell.littlelionstudios.com: undefined method `sanitize' for #<Hash:0x007f5c5c4d0638> Warning: Not using cache on failed catalog Error: Could not retrieve catalog; skipping run Fedora 22 changed to end-of-life (EOL) status on 2016-07-19. Fedora 22 is no longer maintained, which means that it will not receive any further security or bug fix updates. As a result we are closing this bug. If you can reproduce this bug against a currently maintained version of Fedora please feel free to reopen this bug against that version. If you are unable to reopen this bug, please file a new report against the current release. If you experience problems, please add a comment to this bug. Thank you for reporting this bug and we are sorry it could not be fixed. |