The Puppet Labs Issue Tracker has Moved: https://tickets.puppetlabs.com

Bug #14722

Purging resources that were exported resources sometimes fails

Added by Jason Hancock almost 2 years ago. Updated 5 months ago.

Status:AcceptedStart date:05/29/2012
Priority:NormalDue date:
Assignee:Ken Barber% Done:

0%

Category:-
Target version:-
Keywords: Affected PuppetDB version:1.1.1
Branch:

We've Moved!

Ticket tracking is now hosted in JIRA: https://tickets.puppetlabs.com

This ticket is now tracked at: https://tickets.puppetlabs.com/browse/PDB-134


Description

I’m seeing an issue where sometimes I have an exported resource that is failing to be removed from the node that is collecting them after the node has been cleaned up by running a “puppet node clean <hostname>” on the puppetmaster. For example, I’m exporting both nagios_host and nagios_service resources from my nodes and collecting them on my nagios server. On the nagios server, I’ve set up resources of these types to be purged:

resources { ['nagios_service', 'nagios_host']:
  purge  => true,
  notify => Service['nagios'],
}

If I purge a node on the puppetmaster:

puppet node clean node.example.com

On the next puppet run on the nagios server, I might get the following error message:

warning: /Nagios_service[node.example.com SSH]: Whit[Completed_stage[post]],Whit[Admissible_stage[post]],Whit[Admissible_stage[puppetcomplete]],Whit[Completed_stage[puppetcomplete]],
Whit[Completed_stage[main]],Whit[Completed_class[Nagios]],Service[nagios] still depend on me -- not purging

This doesn’t happen all of the time, nor does it happen for all of the nagios_service resources for this node (other nagios_service resources get cleaned up just fine). I’ve seen this with both the nagios_host and the nagios_service type of resources. It will continue to occur for the same resource on any subsequent run of puppet on the nagios server. To remedy this, I have to manually remove the resource it is complaining about from the nagios configuration and restart the service (something I would like to avoid).

Not sure if it matters or not, but I’m using PuppetDB as the stored configurations backend.


Related issues

Duplicates PuppetDB - Bug #14721: "puppet node clean" complains about missing sqlite3 lib w... Accepted 05/29/2012

History

#1 Updated by Deepak Giridharagopal almost 2 years ago

  • Project changed from Puppet to PuppetDB
  • Category deleted (stored configuration)
  • Status changed from Unreviewed to Accepted

#2 Updated by Chris Montanaro almost 2 years ago

I am seeing the same results. I am was able to purge 3 hosts today before getting the same error, I had also run puppet node clean mynode.example.com before the purge to no avail.

warning: /Nagios_host[mynode.example.com]: Whit[Admissible_stage[post]],Whit[Completed_stage[main]],Whit[Admissible_class[Nagios::Service]],Whit[Completed_stage[post]],Service[nagios3],Whit[Completed_class[Nagios::Service]] still depend on me -- not purging

#3 Updated by Deepak Giridharagopal almost 2 years ago

I believe the root cause of this is the same as that of #14721.

#4 Updated by Deepak Giridharagopal over 1 year ago

  • Status changed from Accepted to Duplicate

#5 Updated by Ken Barber about 1 year ago

  • Status changed from Duplicate to Unreviewed

I can replicate this, using puppet node deactivate doesn’t clear it. Nor does removing the catalogue from Puppetdb, but I need more time to investigate why. I think this is not a duplicate. Re-opening.

Export:

node 'puppetdbclient1.vm' {
  @@nagios_host { "$::fqdn":
    ensure => present,
    address => '1.1.1.1',
    alias => 'foobar',
    hostgroups => 'foobarbaz',
    use => 'generic-host',
  }
}

Collection:

node 'puppetdb1.vm' {
  service { 'nagios':
    ensure => running,
  }

  file { '/etc/nagios': ensure => directory }
  Nagios_host <<||>> {
    require => File['/etc/nagios'],
    notify => Service['nagios'],
  }

  resources { 'nagios_host':
    purge => true,
    notify => Service['nagios'],
  }
}

#6 Updated by Ken Barber about 1 year ago

  • Assignee changed from Deepak Giridharagopal to Ken Barber
  • Affected PuppetDB version set to 1.1.1

#7 Updated by Ignasi Blanco about 1 year ago

Annoying work-around to prevent de error message:

 Warning: /Nagios_host[foohost]: Service[nagios],Whit[Completed_stage[main]],Whit[Completed_class[Nagios::Base]] still depend on me -- not purging

Is remove manually all defined host and defined service from “foohost”. And then the next puppet run can continue removing and adding automatically the other nodes deactivated and new hosts exported.

Note: I purge Nagios resources using the “resources” type, but it only applies in the default file locations (/etc/nagios/nagios_host.cfg), but my files are in (/etc/nagios/conf.d/*). so I use a symlink, and I obtain this messages:

 Debug: /Stage[main]/Nagios::Base/File[/etc/nagios3/nagios_host.cfg]/mode: Not managing symlink mode
 Debug: /Stage[main]/Nagios::Base/File[/etc/nagios3/nagios_service.cfg]/mode: Not managing symlink mode

#8 Updated by Ken Barber about 1 year ago

  • Status changed from Unreviewed to Accepted

Also available in: Atom PDF