从 Puppet Labs YUM 存储库将节点升级到 Puppet 3.0.0 后,升级后的节点会抛出混合错误:
[ashinn@dis1 ~]$ sudo puppet agent--test--trace 错误:无法创建用于管理 Puppet 在 [:main、:agent、:ssl] 部分中的文件和目录的资源:文件 [/var/lib/puppet/state/graphs] 上的参数路径失败:类路径中的值“/var/lib/puppet/state/graphs”的混合失败:未初始化的常量 Puppet::FileCollection /usr/lib/ruby/gems/1.8/gems/puppet-2.7.19/lib/puppet/type/file.rb:62:in munge'unsafe_munge' /usr/lib/ruby/site_ruby/1.8/puppet/parameter.rb:209:in
/usr/lib/ruby/site_ruby/1.8/puppet/parameter.rb:252:in []='value=' /usr/lib/ruby/site_ruby/1.8/puppet/type.rb:414:in
/usr/lib/ruby/site_ruby/1.8/puppet/type.rb:1660 :在初始化中'set_name' /usr/lib/ruby/site_ruby/1.8/puppet/type.rb:1647:in
/usr/lib/ruby/gems/1.8/gems/puppet-2.7.19/lib/puppet/type/file.rb:434:in new'initialize' /usr/lib/ruby/site_ruby/1.8/puppet/resource.rb:290:in
/usr/lib/ruby/site_ruby/1.8/puppet/resource.rb:290 :发送'to_ral' /usr/lib/ruby/site_ruby/1.8/puppet/resource/catalog.rb:570:in
/usr/lib/ruby/site_ruby/1.8/puppet/resource/catalog.rb:570:在每个'to_catalog' /usr/lib/ruby/site_ruby/1.8/puppet/resource/catalog.rb:551:in
/usr/lib/ruby/site_ruby/1.8/puppet/resource/catalog.rb:551:in to_ral'to_catalog' /usr/lib/ruby/site_ruby/1.8/puppet/resource/catalog.rb:475:in
/usr/lib/ruby/site_ruby/1.8/puppet/settings.rb:891 :同步'use' /usr/lib/ruby/1.8/sync.rb:230:in
/usr/lib/ruby/site_ruby/1.8/puppet/settings.rb:885 :在设置中'use' /usr/lib/ruby/site_ruby/1.8/puppet/application/agent.rb:450:in
/usr/lib/ruby/site_ruby/1.8/puppet/application.rb:344:in plugin_hook'run' /usr/lib/ruby/site_ruby/1.8/puppet/application.rb:438:in
/usr/lib/ruby/site_ruby/1.8/puppet/application.rb:344:in exit_on_fail'run' /usr/lib/ruby/site_ruby/1.8/puppet/util.rb:500:in
/usr/lib/ruby/site_ruby/1.8/puppet/application.rb:344 :在执行'run' /usr/lib/ruby/site_ruby/1.8/puppet/util/command_line.rb:76:in
/usr/bin/puppet:10 错误:无法准备执行:无法创建用于管理 Puppet 在 [:main、:agent、:ssl] 部分中的文件和目录的资源:文件 [/var/lib/puppet/state/graphs] 上的参数路径失败:类路径中的值“/var/lib/puppet/state/graphs”的混合失败:未初始化的常量 Puppet::FileCollection 文件[/var/lib/puppet/state/graphs] 上的参数路径失败:类路径中的值“/var/lib/puppet/state/graphs”的混合失败:未初始化的常量 Puppet::FileCollection /usr/lib/ruby/gems/1.8/gems/puppet-2.7.19/lib/puppet/type/file.rb:62:in munge'unsafe_munge' /usr/lib/ruby/site_ruby/1.8/puppet/parameter.rb:209:in
/usr/lib/ruby/site_ruby/1.8/puppet/parameter.rb:252:in []='value=' /usr/lib/ruby/site_ruby/1.8/puppet/type.rb:414:in
/usr/lib/ruby/site_ruby/1.8/puppet/type.rb:1660 :在初始化中'set_name' /usr/lib/ruby/site_ruby/1.8/puppet/type.rb:1647:in
/usr/lib/ruby/gems/1.8/gems/puppet-2.7.19/lib/puppet/type/file.rb:434:in new'initialize' /usr/lib/ruby/site_ruby/1.8/puppet/resource.rb:290:in
/usr/lib/ruby/site_ruby/1.8/puppet/resource.rb:290 :发送'to_ral' /usr/lib/ruby/site_ruby/1.8/puppet/resource/catalog.rb:570:in
/usr/lib/ruby/site_ruby/1.8/puppet/resource/catalog.rb:570:在每个'to_catalog' /usr/lib/ruby/site_ruby/1.8/puppet/resource/catalog.rb:551:in
/usr/lib/ruby/site_ruby/1.8/puppet/resource/catalog.rb:551:in to_ral'to_catalog' /usr/lib/ruby/site_ruby/1.8/puppet/resource/catalog.rb:475:in
/usr/lib/ruby/site_ruby/1.8/puppet/settings.rb:891 :同步'use' /usr/lib/ruby/1.8/sync.rb:230:in
/usr/lib/ruby/site_ruby/1.8/puppet/settings.rb:885 :在设置中'use' /usr/lib/ruby/site_ruby/1.8/puppet/application/agent.rb:450:in
/usr/lib/ruby/site_ruby/1.8/puppet/application.rb:344:in plugin_hook'run' /usr/lib/ruby/site_ruby/1.8/puppet/application.rb:438:in
/usr/lib/ruby/site_ruby/1.8/puppet/application.rb:344:in exit_on_fail'run' /usr/lib/ruby/site_ruby/1.8/puppet/util.rb:500:in
/usr/lib/ruby/site_ruby/1.8/puppet/application.rb:344 :在执行'run' /usr/lib/ruby/site_ruby/1.8/puppet/util/command_line.rb:76:in
/usr/bin/puppet:10
我注意到报告的文件(在此错误中/var/lib/puppet/state/graphs
)每次尝试时都会发生变化。它似乎始终是 /var/lib/puppet 中的一个随机文件。知道这里可能发生了什么吗?
答案1
看起来您正在 RPM 旁边挑选一个 2.7.19 宝石——“sudo gem list”是否显示已安装的 Puppet 宝石?
造成这种情况的根本原因是 puppet 现在支持从 gem 加载扩展,请参阅https://projects.puppetlabs.com/issues/7788