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

Puppet lookup always includes classes from the ENC

    Details

    • Template:
      PUP Bug Template
    • Acceptance Criteria:
      Hide

      Puppet lookup should not include the catalog unless --compile is specified. 

      Show
      Puppet lookup should not include the catalog unless --compile is specified. 
    • Sub-team:
    • Team:
      Platform Core
    • Sprint:
      Platform Core KANBAN
    • Method Found:
      Customer Feedback
    • CS Priority:
      Major
    • CS Frequency:
      3 - 25-50% of Customers
    • CS Severity:
      3 - Serious
    • CS Business Value:
      5 - $$$$$$
    • CS Impact:
      Hide
      Lookup is very helpful but this is one of a number of issues with it related to how it interacts with the PE Node Classifier or other ENCs. A workaround exists as mentioned in this ticket but it's not intuitive and so most customers are likely to put in a support ticket about this.

      We should probably document a known issue around this which includes the workaround.
      Show
      Lookup is very helpful but this is one of a number of issues with it related to how it interacts with the PE Node Classifier or other ENCs. A workaround exists as mentioned in this ticket but it's not intuitive and so most customers are likely to put in a support ticket about this. We should probably document a known issue around this which includes the workaround.
    • Release Notes:
      Bug Fix
    • Release Notes Summary:
      Hide
      The lookup CLI tool called the ENC (node terminus) even if {{\--compile}} was not in effect. This could cause errors as classes indicated by the ENC would get loaded without a full and proper setup (could also error if loaded code was had parse errors). Now the configured ENC is only used if {{\--compile}} is in effect.
      Show
      The lookup CLI tool called the ENC (node terminus) even if {{\--compile}} was not in effect. This could cause errors as classes indicated by the ENC would get loaded without a full and proper setup (could also error if loaded code was had parse errors). Now the configured ENC is only used if {{\--compile}} is in effect.

      Description

      The puppet lookup command evaluates classes that are returned from the ENC when the --compile flag is not specified. This results in failures of the lookup command if the catalog cannot be compiled. 

       

      Reproduction Steps 

      1. Install PE or Puppetserver
      2. Create a class like the one below.
      3. Classify a node with the class in the classifier
      4. Run puppet lookup anyhierakey --node <nodename>

      A simple class to cause a failure in the lookup is below. 

       

      class test (
        String $myparam,
      ) {
        file {$myparam:
          ensure => absent,
        }
      }
      

      Logs

      Using the steps above, we see this output from a lookup.

      # puppet lookup anything --node pe-201735-agent.puppetdebug.vlan --debug 
      ...
      Debug: importing '/etc/puppetlabs/code/environments/production/modules/test/manifests/init.pp' in environment production
      Debug: Automatically imported test from test into production
      ...
      Error: Could not run: Evaluation Error: Error while evaluating a Resource Statement, Class[Test]: expects a value for parameter 'myparam'
      

      Workaround

      Add the --node_terminus plain to the command.

      # puppet lookup anything --node pe-201735-agent.puppetdebug.vlan --node_terminus plain
      --- "test"
      

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              jarret.lavallee Jarret Lavallee
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Zendesk Support