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

premature loading of module-provided facts under `-p`

    XMLWordPrintable

Details

    • Bug
    • Status: Resolved
    • Normal
    • Resolution: Fixed
    • PUP 6.4.0, PUP 6.10.1
    • PUP 6.4.5, PUP 6.12.0
    • None
    • ciscopuppet module, facter 3.13.2 (commit a34181878), windows 2016 x64 (gnocchi.platform9.puppet.net)

    • Night's Watch
    • 5
    • NW - 2019-10-30, NW - 2019-11-13, 2019-11-27
    • Needs Assessment
    • Bug Fix
    • Hide
      When running facter -p on windows, if there are custom facts or module
      facts that require some additional files that that are not yet present
      in $LOAD_PATH, it will cause an error.

      This error is caused by the way base modules/vendor paths are generated.
      When running facter -p, puppet needs to set $LOAD_PATH so that facter
      will know where to check for module facts. When loading the module path,
      puppet will call Facter.value of a non core fact, and this will start
      the re-evaluation of all custom/plugin facts without setting the
      $LOAD_PATH. This step fails if a fact requires some additional file not
      yet in $LOAD_PATH.

      Now the $LOAD_PATH will be set without using Facter, getting it
      directly from the system environment.
      Show
      When running facter -p on windows, if there are custom facts or module facts that require some additional files that that are not yet present in $LOAD_PATH, it will cause an error. This error is caused by the way base modules/vendor paths are generated. When running facter -p, puppet needs to set $LOAD_PATH so that facter will know where to check for module facts. When loading the module path, puppet will call Facter.value of a non core fact, and this will start the re-evaluation of all custom/plugin facts without setting the $LOAD_PATH. This step fails if a fact requires some additional file not yet in $LOAD_PATH. Now the $LOAD_PATH will be set without using Facter, getting it directly from the system environment.
    • Needs Assessment

    Description

      When running facter -p on windows with the puppetlabs/ciscopuppet module pluginsynced to the agent, facter is loading facter/cisco.rb from C:/ProgramData/PuppetLabs/puppet/cache/lib before setting up the $LOAD_PATH to load that file's dependencies from there. Please see the attached screenshot for the debug modifications I did and the results on the machine showing the issue.

      To make sure there is nothing wonky with the facter/cisco_nexus file itself, a require within a setcode worked fine.

      Regular agent runs work fine and do not show any errors.

      Desired Behaviour

      facter -p loads files from puppet's cache only once, after $LOAD_PATH has been properly initialised.

      Attachments

        Issue Links

          Activity

            People

              dorin.pleava Dorin Pleava
              david.schmitt David Schmitt
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Zendesk Support