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

Prefetch eats most exceptions (those derived from StandardError), there is no way to fail out.


    • Template:
    • Story Points:
    • Sprint:
      Platform Client 2015-01-21, Client 2015-02-04



      This bug still exists in the master branch as of today and was introduced in 2.7.8 with this commit:


      The rescue condition means that any exception raised by providers during prefetch gets logged but then swallowed by Puppet. As a result of this, any provider which relies only on prefetch to find all instances will end up running the resource creation regardless of whether the resource exists or not.

      In order to negate this behaviour, provider authors would need to create checks for instance existence which run during the creation phase as well, which defeats the point of having prefetch in the first place.

      Note to docs: module authors who use the prefetch method may want to be aware of the changes in this fix. Two things to consider:

      1. previously, the prefetch method could throw any exception and puppet would carry on. As discussed above this is the wrong behavior in general, however some module authors may have stumbled across this, allowed/encouraged prefetch to throw exceptions, and let puppet runs succeed. So modules should be examined for this assumption.
      2. the only two legitimate causes for prefetch to throw an exception now are LoadError and (added in this puppet 4.0) Puppet::MissingCommand

      This is a breaking change in 4.0.


          Issue Links



              • Assignee:
                peter.huene Peter Huene
                oholiab Matt Carroll
              • Votes:
                4 Vote for this issue
                12 Start watching this issue


                • Created:

                  Zendesk Support