Puppet hiera error

28 views
Skip to first unread message

Jagga Soorma

unread,
Sep 23, 2016, 6:51:39 PM9/23/16
to puppet...@googlegroups.com
Hi Guys,

I am trying to setup a new puppet environment using hiera and have
everything setup. However, when I do a puppet agent run I get the
following error:

--
Error: Could not retrieve catalog from remote server: Error 400 on
SERVER: Could not find data item classes in any Hiera data file and no
default supplied at
/etc/puppet/environments/production/manifests/site.pp:26 on node
resmesostst01.gene.com
Warning: Not using cache on failed catalog
Error: Could not retrieve catalog; skipping run
--

I am running puppet version 3.8.7. Here is my site.pp:

--
# cat /etc/puppet/environments/production/manifests/site.pp | grep -v
'#' | sed '/^$/d'
filebucket { 'main':
server => 'resforetst01.gene.com',
path => false,
}
File { backup => 'true' }
Package { allow_virtual => true }
node default {
hiera_include('classes')
}
notify { 'debug_location': name => "THE NODE LOCATION IS: ${location}" }
notify { 'debug_environment': name => "THE NODE ENVIRONMENT IS:
${environment}" }
notify { 'debug_ype': name => "THE NODE TYPE IS: ${pr_type}" }
notify { 'debug_hostgroup': name => "THE NODE HOST GROUP IS: ${hostgroup}" }
--

Here is my hiera.yaml:

--
[root@resforetst01 production]# cat /etc/puppet/hiera.yaml | grep -v '#'
---
:backends:
- yaml
:hierarchy:
- "node/%{::fqdn}"
- "role/%{::hostgroup}"
- "type/%{::pr_type}"
- "site/%{::domain}"
- common
:yaml:
:datadir: "/etc/puppet/environments/%{::environment}/hieradata"
:logger: console
--

Any clues on what I seem to be missing?

Thanks!

Peter Faller

unread,
Sep 26, 2016, 4:21:19 AM9/26/16
to Puppet Users
Have you created any of the Hiera data files (common.yaml, site/*.yaml, etc.)? There does not appear to be a definition of which classes to include. If you change hiera_include('classes') to hiera_include('classes', []) the error message should go away (because [] provides a default empty array of classes); but you should also have something like this in your Hiera YAML files:

common.yaml:
---
classes:
  - ntp

Arnau

unread,
Sep 26, 2016, 6:51:31 AM9/26/16
to puppet...@googlegroups.com
You could try to debug it from the server side. I usually run:

hiera -c /etc/puppet/hiera.yaml -d classes environment=your_env  ::fqdn=hostname

soemtimes this is useful.

Best,
Arnau


--
You received this message because you are subscribed to the Google Groups "Puppet Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to puppet-users+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/puppet-users/CAKyjK51g9opXvj0UpVEs8owG7V3kn5v%3DjJb7s4j%2B%2Ba9iwGvwdg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages