Quantcast
Channel: Ask Puppet: Puppet DevOps Q&A Community - RSS feed
Viewing all articles
Browse latest Browse all 95

Why is $facts is not a hash or array when accessing it

$
0
0
I get the following error: Error: Could not retrieve catalog from remote server: Error 400 on SERVER: $facts["nrpe_plugins"] is not a hash or array when accessing it with CheckSystemErrors at /etc/puppet/environments/development/modules/site_custom/manifests/nagios_nrpe_plugin.pp:27 on node test.example.com The line of code that throws this is > if( !$facts['nrpe_plugins'] or ! $facts['nrpe_plugins']["$plugin_name"]) ... So I access the $facts hash as described on [puppetlabs doc](https://docs.puppetlabs.com/puppet/latest/reference/lang_facts_and_builtin_vars.html#the-factsfactname-hash) I have a puppet master that is newer than 3.5 [root@puppet]# puppet master --version 3.6.2 and I have configured the master to use (and trust) the client facts: [root@iipc-unet02 puppet]# puppet config print --section master | grep "string\|trust" ldapstring = (&(objectclass=puppetClient)(cn=%s)) trusted_node_data = true stringify_facts = false I am using puppet community edition I thought I finally found the culprit. I had the config parameter immutable_node_data set to true. It was in the [doc](https://docs.puppetlabs.com/puppet/latest/reference/lang_facts_and_builtin_vars.html#the-factsfactname-hash) . Now I changed it to false but now it looks like no fact is set at all. (My facts are on the agent node in /etc/facter/facts.d/nagios_nrpe_plugins.yaml and I can see them using facter). However in a puppet run it looks like they are not sent to the master.

Viewing all articles
Browse latest Browse all 95

Trending Articles