Ask Your Question

undefined method `empty?' for nil:NilClass

asked 2016-01-30 12:59:25 -0500

Red Cricket gravatar image

updated 2016-01-30 19:59:59 -0500


I am using ...

# puppet -V
3.7.4 (Puppet Enterprise 3.7.2)

... on my puppet master and nodes.

I am getting this error when I run puppet agent -t on my nodes:

Error: Could not retrieve catalog from remote server: Error 400 on SERVER: undefined method `empty?' for nil:NilClass at /etc/puppetlabs/puppet/environments/production/manifests/site.pp:47 on node

Line 47 on my site.pp is this:

 44 # Add Fix For allow_virtual Warning
 45 if versioncmp($::puppetversion,'3.6.1') >= 0 {
 47   $allow_virtual_packages = hiera('allow_virtual_packages',false)
 49   Package {
 50     allow_virtual => $allow_virtual_packages,
 51   }
 52 }
 53 #END Add Fix For allow_virtual Warning

I added this bit to my site.pp because I use to get these warning messages ...

Warning: The package type's allow_virtual parameter will be changing its default value from false to true in a future release. If you do not want to allow virtual packages, please explicitly set allow_virtual to false.    (at /opt/puppet/lib/ruby/site_ruby/1.9.1/puppet/type.rb:816:in `set_default')

Can someone point out what I am doing wrong here?


edit retag flag offensive close merge delete


Have you tried running the hiera command line to test your hiera lookup?

Alex Harvey gravatar imageAlex Harvey ( 2016-01-31 03:03:10 -0500 )edit

Thanks Alex. Turns out that my co's infosec team wanted my hiera yaml data files to be readonly and since the file was owned by root I got permission errors. Once I did `chmod 644` the problem went away. What owner user own should I use so I can make them non-world readable?

Red Cricket gravatar imageRed Cricket ( 2016-02-01 11:01:51 -0500 )edit

it's good to answer your own question showing the troubleshooting steps for others who may find this in the archive.

Alex Harvey gravatar imageAlex Harvey ( 2016-02-01 18:23:31 -0500 )edit

1 Answer

Sort by ยป oldest newest most voted

answered 2016-02-01 18:18:38 -0500

Puppet on the puppet master typically runs as the user puppet, see e.g. here.

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower


Asked: 2016-01-30 12:59:25 -0500

Seen: 796 times

Last updated: Feb 01 '16