Uploaded image for project: 'Puppet'
  1. Puppet
  2. PUP-4359

puppetversion fact is missing

    XMLWordPrintable

Details

    • Bug
    • Status: Closed
    • Normal
    • Resolution: Done
    • None
    • PUP 4.1.0
    • None
    • None
    • 1
    • Client 2015-04-29

    Description

      Executing puppet with cfacter and stdlib generates an error every time puppet runs:

      [root@jaiuwwlivqmy8by ~]# puppet --version
      4.0.0-rc1
      [root@jaiuwwlivqmy8by ~]# facter --version
      2.4.2
      [root@jaiuwwlivqmy8by ~]# cfacter --version
      0.4.0 (commit f4eecdfa9ff69c801bfedba3fc0fd5285e86b3c5)
      [root@jaiuwwlivqmy8by ~]# facter puppetversion
      4.0.0-rc1
      [root@jaiuwwlivqmy8by ~]# cfacter puppetversion
       
      [root@jaiuwwlivqmy8by ~]# time puppet agent -t --server $(facter fqdn) --cfacter --trace
      Info: Retrieving pluginfacts
      Info: Retrieving plugin
      Info: Loading facts
      Error: Facter: error while resolving custom fact "pe_version": undefined method `match' for nil:NilClass
      backtrace:
      /opt/puppetlabs/puppet/cache/lib/facter/pe_version.rb:13:in `block (2 levels) in <top (required)>'
      /opt/puppetlabs/puppet/cache/lib/facter/pe_version.rb:20:in `call'
      /opt/puppetlabs/puppet/cache/lib/facter/pe_version.rb:20:in `value'
      /opt/puppetlabs/puppet/cache/lib/facter/pe_version.rb:20:in `block (2 levels) in <top (required)>'
      /opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/indirector/facts/facter.rb:27:in `call'
      /opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/indirector/facts/facter.rb:27:in `to_hash'
      /opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/indirector/facts/facter.rb:27:in `find'
      /opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/indirector/indirection.rb:194:in `find'
      /opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/configurer/fact_handler.rb:15:in `find_facts'
      /opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/configurer/fact_handler.rb:31:in `facts_for_uploading'
      /opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/configurer.rb:97:in `get_facts'
      

      The error occurs because cfacter doesn't define the puppetversion fact, which causes stdlib issues:

          pe_ver = Facter.value("puppetversion").match(/Puppet Enterprise (\d+\.\d+\.\d+)/)
      

      It makes sense for cfacter to not generate the puppetversion fact when run standalone (because we don't want a cyclic dependency). But I would think puppet would inject its puppetversion into facter (whichever implementation is being used), so that the fact is present during fact resolution and later compilation. So arguably this is a puppet issue, but may affect the facter/cfacter interface?

      risk assessment: high
      probability: high (PE requires)
      severity: high
      test layer: unit

      Resolution:

      Puppet now adds the puppetversion fact if it's using cfacter.

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              josh Josh Cooper
              Votes:
              0 Vote for this issue
              Watchers:
              6 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Zendesk Support