Hi all,

We've come across a rather strange problem where the parameters of some 
resources in PuppetDB are now empty.

We have a Nagios server collecting resources from PuppetDB and we've 
started to get failures like this for one resource type:

Error: Could not retrieve catalog from remote server: Error 400 on SERVER: 
Must pass host_alias to Nagios::Config::Host[hostname] on node nagiosserver

The Puppet manifest that defines that resources is this, it is impossible 
to not populate host_alias:

*******************************
define nagios::host::host($host = $::fqdn, $tag = undef) {
  @@nagios::config::host { $host:
    host_alias => $host,
    address    => $host,
    tag        => $use_tag,
  }
}
*******************************

If we query PuppetDB directly (redacted), there are indeed no parameters at 
all on this resource:

*******************************
# curl -H 'Accept: application/json' -X GET 
'https://puppet:8081/v2/resources' --cacert 
/var/lib/puppet/ssl/ca/ca_crt.pem --cert 
/var/lib/puppet/ssl/certs/puppet.pem  --key 
/var/lib/puppet/ssl/private_keys/puppet.pem --data-urlencode 'query=["=", 
"type", "Nagios::Config::Host"]' | jgrep "certname=hostname"
[
  {
    "resource": "8ba4379c364b9dba9d18836ef52ce5f4f82d0468",
    "parameters": {
    },
    "title": "hostname",
    "exported": true,
    "certname": "hostname",
    "type": "Nagios::Config::Host",
    "sourceline": 27,
    "sourcefile": 
"/etc/puppet/environments/production/modules/nagios/manifests/host/host.pp",
    "tags": [
    ]
  }
]
*******************************

After a Puppet run and a new catalog, this resource now looks normal:

*******************************
# curl -H 'Accept: application/json' -X GET 
'https://puppet:8081/v2/resources' --cacert 
/var/lib/puppet/ssl/ca/ca_crt.pem --cert 
/var/lib/puppet/ssl/certs/puppet.pem  --key 
/var/lib/puppet/ssl/private_keys/puppet.pem --data-urlencode 'query=["=", 
"type", "Nagios::Config::Host"]' | jgrep "certname=hostname"
[
  {
    "type": "Nagios::Config::Host",
    "sourceline": 27,
    "title": "hostname",
    "certname": "hostname",
    "resource": "8ba4379c364b9dba9d18836ef52ce5f4f82d0468",
    "parameters": {
      "address": "hostname",
      "tag": "tag",
      "host_alias": "hostname"
    },
    "exported": true,
    "sourcefile": 
"/etc/puppet/environments/production/modules/nagios/manifests/host/host.pp",
    "tags": [
    ]
  }
]
*******************************

These nodes do not have Puppet run on them regularly. We did upgrade from 
PuppetDB 1.0.1-1.el6.noarch to 1.3.2-1.el6.noarch about 3 weeks ago. We 
don't do any automatic report or node expiry.

This started happening back on 2nd August, just halfway through the day the 
Puppet runs on the Nagios server start failing with this error. Now if I 
think back, at this time I think I had a broken Nagios module and a lot of 
manifests were failing to compile, but I fixed this and re-ran the 
failures, and everything was ok. PuppetDB only stores the last catalog, so 
there's no way a broken catalog could have stayed there, right?

I've fixed this by refreshing the catalog of all nodes in PuppetDB, but 
I've got no idea how it got into this state. Any ideas?

Thanks,

-Luke

-- 
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+unsubscr...@googlegroups.com.
To post to this group, send email to puppet-users@googlegroups.com.
Visit this group at http://groups.google.com/group/puppet-users.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to