puppetlabs / puppetdb

Centralized Puppet Storage
http://docs.puppetlabs.com/puppetdb
Apache License 2.0
301 stars 226 forks source link

deactivating a non-existent node leaves inconsistent state #4008

Open traylenator opened 1 month ago

traylenator commented 1 month ago

Describe the Bug

Deactivating a not existing node .e.g

puppet node deactivate notexisting.example.ch

Create an entry in the nodes table:

/pdb/query/v4/nodes/notexisting.example.ch                                                                                                
{                                                                                                                                                                                           
  "deactivated" : "2024-10-02T12:57:22.565Z",                                                                                                                                               
  "latest_report_hash" : null,
  "facts_environment" : null,
  "cached_catalog_status" : null,

however the entry never appears in the inventory.

i.e

inventory[certname] { node_state = "inactive" }

never contains the node notexisting.example.ch.

Expected Behavior

It seems inconsistent that you can have a node that is nor present in the inventory.

Environment

Additional Context

As highlighted on slack:

It is likely not showing up in inventory because all three of fact, catalog, and report are null.