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

Invalid parser function breaks catalog compilation in all environments

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Accepted
    • Priority: Normal
    • Resolution: Unresolved
    • Affects Version/s: PUP 6.15.0
    • Fix Version/s: None
    • Component/s: Compiler
    • Labels:
      None
    • Template:
      PUP Bug Template
    • Team:
      Night's Watch
    • Method Found:
      Needs Assessment
    • QA Risk Assessment:
      Needs Assessment

      Description

      Puppet Version: 6.20.0
      Puppet Server Version: 6.15.0
      OS Name/Version: CentOS Linux 7.9

      Crafting a parser function file in a particular way causes most future catalog compilations to fail across all environments after the function is executed once, until puppetserver is restarted. 

       

      To reproduce, create a file in lib/puppet/parser/functions/bork.rb with the following contents:

      module Puppet
        module Parser
          module Functions
            newfunction(
              :bork,
              type: :rvalue,
              doc: 'B0rks the puppetserver'
            ) do |args|
              return true
            end
          end
        end
      end

      Then have an agent manifest call the `bork()` function. 

       

      Observe most future puppet runs fail, even for other nodes in other environments that previously worked before.  

       

      The error frequently seen is:

      Error 500 on SERVER: Server Error: Evaluation Error: Error while evaluating a Function Call, undefined method `[]' for Puppet::Pops::Loader::RubyLegacyFunctionInstantiator::Puppet:Module

      Desired Behavior:

      Catalog fails for the invalid parser function, and other catalogs work fine. 

      Actual Behavior:

      Most future catalog compilations fail, even for unrelated nodes in other environments that previously worked before the `bork()` function was called.

       

      The following simple catalog is known to fail, where it previous works:

      include stdlib

      $test = pick($puppetmaster, $::fqdn)

        Attachments

          Activity

            People

            Assignee:
            Unassigned Unassigned
            Reporter:
            ncstate-mafields Matt Fields
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

              Dates

              Created:
              Updated:

                Zendesk Support