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

Keep getting "undefined method" errors when using parser=future.

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Normal
    • Resolution: Cannot Reproduce
    • Affects Version/s: PUP 3.5.0
    • Fix Version/s: None
    • Component/s: Compiler
    • Labels:
    • Template:

      Description

      Here's the error I receive when running "puppet agent -t" with parser=future:

      Error: Could not retrieve catalog from remote server: Error 400 on SERVER: Failed to parse template zabbix/zbx-postgresql.xml.erb:
        Filepath: /etc/puppet/modules/zabbix/templates/zbx-postgresql.xml.erb
        Line: 226
        Detail: undefined method `each' for nil:NilClass
       on node fw.domain
      Warning: Not using cache on failed catalog
      Error: Could not retrieve catalog; skipping run
      

      I think it might have something to do with the fact that the class that contains this file resource is parameterized. Here's the entirety of the class:

      class zabbix::postgres::import_template (
        $server=hiera("zabbix_server", $::servername), 
        $db_list
      ) {
        $template_postgres = "Template Postgresql"
       
        zabbix::configure::template { "zbx-postgresql.xml":
          server     => $server,
          template_name => $template_postgres,
          template_file_name => "zbx-postgresql.xml",
          content => "zabbix/zbx-postgresql.xml.erb",
        }
      }
      

      Line 226 (where the error occurs) of the ERB file is this:

      <%@db_list.each do |db| -%>
      

      Here is the class declaration:

        class { 'zabbix::postgres::import_template' :
          db_list => ["db1", "zabbix"],
        }
      

      Commenting parser=future out of my puppet.conf and restarting the master makes this problem go away.

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                asedge Sean Edge
                Reporter:
                asedge Sean Edge
              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:

                  Zendesk Support