hiera_include('classes') fails with "undefined method `downcase' for nil:NilClass"

1,186 views
Skip to first unread message

Peter K

unread,
Apr 20, 2017, 12:35:12 PM4/20/17
to Puppet Users
I'm missing something. I've never been able to include classes via hiera via the hiera_include('classes') command. Any insight?

If I call :
# /opt/puppetlabs/bin/puppet agent -t --debug > /tmp/debug
Yields:
Error: Could not retrieve catalog from remote server: Error 500 on SERVER: Server Error: Evaluation Error: Error while evaluating a Function Call, undefined method `downcase' for nil:NilClass at /etc/puppetlabs/code/environments/development/manifests/site.pp:1:1 on node mycomputer.domain.com
Warning: Not using cache on failed catalog
Error: Could not retrieve catalog; skipping run

I've never had any trouble with putting "include ::ntp" inside the default node class.

When site.pp looks like this:
hiera_include('classes')


node
default {
}

cat /etc/puppetlabs/code/environments/development/hieradata/common.yaml
---
magic_word
: '%{::environment}/hieradata/common.yaml'
magic_word_common
: 'common.yaml was consulted'
magic_word_environment
: '%{::environment}'


classes
:
 
- ntp

...[etc]



Thx in advance.

puppetserver 4.9.4
puppet agent on mycomputer:  4.10.0

Peter Faller

unread,
Apr 21, 2017, 4:49:35 AM4/21/17
to Puppet Users
First step would be to find where you're using 'downcase' ...

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

... and work from there.

Peter K

unread,
Apr 21, 2017, 5:40:39 PM4/21/17
to Puppet Users
Well...I had never called 'downcase' myself but it appears to be a function defined in in the puppet stdlib module.

But I seem to have narrowed down the cause to having an unused 'classes:' line in my hostname.domain.com.yaml when there is also a 'classes:' line in my common.yaml
It seems as soon as I add a class, ie ntp, to mycomputer.domain.com.yaml the error disappears.
-peter

Reply all
Reply to author
Forward
0 new messages