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

Accessing a required parameter that is unassigned causes bad error message

    Details

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

      If a parameter default expression references an earlier parameter and that referenced parameter is not given a value, the error message should state that the required parameter has not been given a value.

      Show
      If a parameter default expression references an earlier parameter and that referenced parameter is not given a value, the error message should state that the required parameter has not been given a value.
    • Epic Link:
    • Story Points:
      1
    • Sprint:
      Language 2016-07-13
    • Release Notes Summary:
      Hide
      If a parameter default expression referenced an earlier parameter and that referenced parameter was not given a value, a bad error message would state that this reference was illegal. Now it correctly reports the actual error of a required parameter not having been given a value.
      Show
      If a parameter default expression referenced an earlier parameter and that referenced parameter was not given a value, a bad error message would state that this reference was illegal. Now it correctly reports the actual error of a required parameter not having been given a value.

      Description

      I ran into this error trying to include a PE profile class that happened to inherit a class that was already defined in the PE console. This is the minimal repro of the root issue.

      Given the following site.pp:

      class breaking (
          String $first,
          String $second = $first,
      ){}
       
      node default {
        include breaking
      }
      

      The expected error would be that the required parameter is missing. But instead the following error happens:

      Error: Could not retrieve catalog from remote server: Error 400 on SERVER: Evaluation Error: Error while evaluating a Resource Statement, default expression for $second tries to illegally access not yet evaluated $first at /etc/puppetlabs/code/environments/production/manifests/site.pp:31:3 on node master.puppetlabs.vm
      

      To repro the original issue, start with a stock PE master and add `include puppet_enterprise::profile::mcollective::peadmin` to the default node group. The unnecessary inheritance caused that issue, but the error message pointed to the root issue in puppet with the parameter evaluation order.

        Attachments

          Issue Links

            Activity

              jsd-sla-details-panel

                People

                • Assignee:
                  Unassigned
                  Reporter:
                  js Josh Samuelson
                • Votes:
                  0 Vote for this issue
                  Watchers:
                  4 Start watching this issue

                  Dates

                  • Created:
                    Updated:
                    Resolved: