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

Evaluation Error: Error while evaluating a Function Call, undefined method `length' for nil:NilClass

    XMLWordPrintable

Details

    • Split
    • CentOS 7
    • Needs Assessment
    • Needs Assessment

    Description

      Puppet Version: puppet-agent-6.26
      Puppet Server Version: puppetserver-6.18
      OS Name/Version: CentOS 7

      After executing the command of puppet agent -t we get the following error:

      Info: Using environment 'production'
      Info: Retrieving pluginfacts
      Info: Retrieving plugin
      Info: Retrieving locales
      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, undefined method `length' for nil:NilClass (file: /etc/puppetlabs/code/modules/yum/manifests/init.pp, line: 202, column: 20) on node XXX
      Warning: Not using cache on failed catalog
      Error: Could not retrieve catalog; skipping run

       

      We change the configuration of the init.pp with a solution that we encounter somewhere, and was to change this code:

       

      $_pc_cmd = delete_undef_values([
          '/usr/bin/package-cleanup',
          '--oldkernels',
          "--count=${_real_installonly_limit}",
          '-y',
          $keep_kernel_devel ? {
            true    => '--keepdevel',
            default => undef,
          },
        ]) 

       

      to this other one:

       

      $_pc_cmd = [
          '/usr/bin/package-cleanup',
          '--oldkernels',
          "--count=${_real_installonly_limit}",
          '-y',
          $keep_kernel_devel ? {
            true    => '--keepdevel',
            default => undef,
          },
        ].filter |$val| { $val =~ NotUndef } 

       

      There is a way of solving this issue whithout making any changes on the code?

       

      Desired Behavior: No puppet errors

      Actual Behavior: Execution getting errors

      Attachments

        Activity

          People

            henrik.lindberg Henrik Lindberg
            Lorita Manuel Lora Roman
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Zendesk Support