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

Change in Puppet type management breaks defined class checks

    XMLWordPrintable

Details

    • Bug
    • Status: Closed
    • Normal
    • Resolution: Cannot Reproduce
    • PUP 5.1.0
    • None
    • Type System
    • Hide

      Puppet should run cleanly on a very standard design pattern that includes checking if a class is defined as per examples giving in core puppetlabs modules.

      Show
      Puppet should run cleanly on a very standard design pattern that includes checking if a class is defined as per examples giving in core puppetlabs modules.
    • Needs Assessment
    • Needs Assessment

    Description

      After upgrading the puppet version on a puppet server from 5.0.1 to 5.1.0 puppet runs on all nodes referencing that master now fail with the same type of error. Downgrading the server's puppet version back to 5.0.1 results in no errors again.

      The bug appear to be related to PUP-7670.

      [root@puppet ~]# puppet agent -t
      Info: Using configured environment 'infrastructure'
      Info: Retrieving pluginfacts
      Info: Retrieving plugin
      Info: Loading facts
      Error: Could not retrieve catalog from remote server: Error 500 on SERVER: Server Error: Evaluation Error: Error while evaluating a Function Call, uninitialized constant Puppet::Pops::Types::PClassType at /etc/puppetlabs/code/environments/infrastructure/modules/puppetdb/manifests/master/config.pp:4:34 on node puppet.mydomain}}
       
      When looking at the code referenced, it appears that it is choking on a very common template
      {{class puppetdb::master::config (
        $puppetdb_server             = $::fqdn,
        $puppetdb_port               = defined(Class['puppetdb']) ? {
      

      ie - the defined(Class['foo']) is what causes the problem. On playing on other nodes, not the puppet master, I see the same error in various different modules, depending on what the node requires. For example, on a webserver node using Apache the line that trips this up is:

      [root@mezabaan1 ~]# puppet agent -t
      Info: Using configured environment 'application'
      Info: Retrieving pluginfacts
      Info: Retrieving plugin
      Info: Loading facts
      Error: Could not retrieve catalog from remote server: Error 500 on SERVER: Server Error: Evaluation Error: Error while evaluating a Resource Statement, Evaluation Error: Error while evaluating a Function Call, uninitialized constant Puppet::Pops::Types::PClassType at /etc/puppetlabs/code/environments/application/modules/apache/manifests/service.pp:27:8 at /etc/puppetlabs/code/environments/application/modules/webserver/manifests/static.pp:77 on node mezabaan1.mydomain
      

      if ! defined(Class\['apache::params'])
      

      I can replicate the exact same error in my own modules using the same code pattern.

      Info: Loading facts
      Error: Could not retrieve catalog from remote server: Error 500 on SERVER: Server Error: Evaluation Error: Error while evaluating a Resource Statement, Evaluation Error: Error while evaluating a Function Call, uninitialized constant Puppet::Pops::Types::PClassType at /etc/puppetlabs/code/environments/application/modules/ntpd/manifests/config.pp:5:8 on node mezabaan1.mydomain
      

      define ntpd::config (
        Array[String] $local_servers = [],
      ) {
       
      if ! defined( Class['ntpd::master'])
      

      etc etc.

      Attachments

        Activity

          People

            Unassigned Unassigned
            WetHippie Justin Couch
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Zendesk Support