Puppet 4.0: Evaluation Error: Error while evaluating a Function Call, Could not find data item classes in any Hiera data file and no default supplied

3,446 views
Skip to first unread message

Danny Roberts

unread,
May 20, 2015, 4:31:14 AM5/20/15
to puppet...@googlegroups.com
I have built a new Puppet master to test Puppet 4. I have installed the server itself and used r10k to put my code on the server but when doing a puppet client run on the master I get this error:

root@puppet:~# puppet agent -t
Info: Retrieving pluginfacts
Info: Retrieving plugin
Info: Loading facts
Error: Could not retrieve catalog from remote server: Error 400 on SERVER: Evaluation Error: Error while evaluating a Function Call, Could not find data item classes in any Hiera data file and no default supplied at /etc/puppetlabs/code/environments/production/site.pp:2:1 on node puppet.thefallenphoenix.net
Warning: Not using cache on failed catalog

The Hiera config file is at /etc/puppetlabs/code/hiera.yaml as per the Hiera 2.0 release announcement (https://docs.puppetlabs.com/hiera/2.0/release_notes.html#break-new-default-locations-for-config-file-and-data-directory) so I'm not sure why it cannot be found (assuming that is the issue).

The site.pp referred to has code to pull in the classes tag from Hiera files which looks like this:

hiera_include('classes', undef)

This works on Puppet 3.x series OK.

Thomas Müller

unread,
May 20, 2015, 7:27:40 AM5/20/15
to puppet...@googlegroups.com


Am Mittwoch, 20. Mai 2015 10:31:14 UTC+2 schrieb Danny Roberts:
I have built a new Puppet master to test Puppet 4. I have installed the server itself and used r10k to put my code on the server but when doing a puppet client run on the master I get this error:

root@puppet:~# puppet agent -t
Info: Retrieving pluginfacts
Info: Retrieving plugin
Info: Loading facts
Error: Could not retrieve catalog from remote server: Error 400 on SERVER: Evaluation Error: Error while evaluating a Function Call, Could not find data item classes in any Hiera data file and no default supplied at /etc/puppetlabs/code/environments/production/site.pp:2:1 on node puppet.thefallenphoenix.net
Warning: Not using cache on failed catalog


IMHO it can't find any "classes" keys and as "undef" handling changed in 4.0 it now throws an error. 

If  it should return values: what if you run the hiera command from command line ? something like:

 
hiera --debug --array classes undef topscopevar1=value  topscopevar2=value


where topscopevar* are variables used in hiera.yaml.


- Thomas

Danny Roberts

unread,
May 20, 2015, 12:15:15 PM5/20/15
to puppet...@googlegroups.com

IMHO it can't find any "classes" keys and as "undef" handling changed in 4.0 it now throws an error. 

If  it should return values: what if you run the hiera command from command line ? something like:

 
hiera --debug --array classes undef topscopevar1=value  topscopevar2=value


where topscopevar* are variables used in hiera.yaml.


- Thomas

It returns undef, even our production 3.x system returns undef when running that command.

If I go back to:

hiera_include('classes')

everything works. So what I guess I need to know is: what's the equivalent of my original code in Puppet 4 (I don't see any documentation on the subject at all) to give me back the conditional aspect?

Thomas Müller

unread,
May 21, 2015, 1:52:43 AM5/21/15
to puppet...@googlegroups.com
Reading the puppet 4.1.0 releasenotes there is some bugfix for hiera_include included: https://tickets.puppetlabs.com/plugins/servlet/mobile#issue/PUP-4334

Danny Roberts

unread,
May 22, 2015, 8:26:14 AM5/22/15
to puppet...@googlegroups.com
Looks like I need some slight code re-work but Puppet 4.1.0 seems to have fixed the error, many thanks!
Reply all
Reply to author
Forward
0 new messages