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

'puppet facts diff' logs error when apt module is installed

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Normal
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: PUP 6.22.0
    • Component/s: None
    • Labels:
    • Template:
      PUP Bug Template
    • Acceptance Criteria:
      Hide

      puppet facts diff does not log any error

      Show
      puppet facts diff does not log any error
    • Team:
      Night's Watch
    • Story Points:
      0
    • Sprint:
      NW - 2021-03-03
    • Method Found:
      Needs Assessment
    • Release Notes:
      Bug Fix
    • Release Notes Summary:
      Hide
      Before this commit, `puppet facts diff` which is comparing facter 3 and facter 4 facts, didn't run facter 4 in a clean environment, leading to undefined behavior for custom facts resolving

      With this commit, puppet 4 facts are read running `puppet facts` in a new shell and the custom facts should be correctly resolved
      Show
      Before this commit, `puppet facts diff` which is comparing facter 3 and facter 4 facts, didn't run facter 4 in a clean environment, leading to undefined behavior for custom facts resolving With this commit, puppet 4 facts are read running `puppet facts` in a new shell and the custom facts should be correctly resolved
    • QA Risk Assessment:
      Needs Assessment

      Description

      Platforms: OS X, Centos 7 (as tested by me), might be on all
      pupptlabs-apt: 7.7.1(latest)

      Step to reproduce:

      • install latest puppet 6
      • install puppetlabs-apt module
      • run `puppet facts diff`

      ❯ puppet --version
      6.21.1
      ❯ puppet facts diff
      {"hypervisors.vmware.version":{"new_value":"ESXi 6.7","old_value":""}}
       
      ❯ puppet module install puppetlabs-stdlib
      Notice: Preparing to install into /etc/puppetlabs/code/environments/production/modules ...
      Notice: Downloading from https://forgeapi.puppet.com ...
      Notice: Installing -- do not interrupt ...
      /etc/puppetlabs/code/environments/production/modules
      └── puppetlabs-stdlib (v6.6.0)
       
      ❯ puppet facts diff
      {"hypervisors.vmware.version":{"new_value":"ESXi 6.7","old_value":""}}
       
      ❯ puppet module install puppetlabs-apt
      Notice: Preparing to install into /etc/puppetlabs/code/environments/production/modules ...
      Notice: Downloading from https://forgeapi.puppet.com ...
      Notice: Installing -- do not interrupt ...
      /etc/puppetlabs/code/environments/production/modules
      └─┬ puppetlabs-apt (v7.7.1)
        ├── puppetlabs-stdlib (v6.6.0)
        └── puppetlabs-translate (v2.2.0)
       
      ❯ puppet facts diff
      E, [2021-02-17T07:14:34.049701 #1797] ERROR -- : Facter - Error while resolving custom fact fact='apt_package_updates', resolution='<anonymous>': undefined method `[]' for nil:NilClass
      E, [2021-02-17T07:14:34.051667 #1797] ERROR -- : Facter - Error while resolving custom fact fact='apt_package_dist_updates', resolution='<anonymous>': undefined method `[]' for nil:NilClass
      E, [2021-02-17T07:14:34.053433 #1797] ERROR -- : Facter - Error while resolving custom fact fact='apt_package_security_updates', resolution='<anonymous>': undefined method `[]' for nil:NilClass
      E, [2021-02-17T07:14:34.055293 #1797] ERROR -- : Facter - Error while resolving custom fact fact='apt_package_security_dist_updates', resolution='<anonymous>': undefined method `[]' for nil:NilClass
      E, [2021-02-17T07:14:34.057133 #1797] ERROR -- : Facter - Error while resolving custom fact fact='apt_updates', resolution='<anonymous>': undefined method `[]' for nil:NilClass
      E, [2021-02-17T07:14:34.058807 #1797] ERROR -- : Facter - Error while resolving custom fact fact='apt_dist_updates', resolution='<anonymous>': undefined method `[]' for nil:NilClass
      E, [2021-02-17T07:14:34.060489 #1797] ERROR -- : Facter - Error while resolving custom fact fact='apt_security_updates', resolution='<anonymous>': undefined method `[]' for nil:NilClass
      E, [2021-02-17T07:14:34.062122 #1797] ERROR -- : Facter - Error while resolving custom fact fact='apt_security_dist_updates', resolution='<anonymous>': undefined method `[]' for nil:NilClass
      {"hypervisors.vmware.version":{"new_value":"ESXi 6.7","old_value":""}}
      
      

      /opt/puppetlabs/puppet/bin/facter-ng does not log any error so most likely it happens when resolving the facts added in puppet form modules.

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              ciprian.badescu Ciprian Badescu
              Reporter:
              ciprian.badescu Ciprian Badescu
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:

                  Zendesk Support