Knife search returns stale data until chef-client runs. Is this avoidable?


Example: devjmxpx03/4 are preexisting nodes with the jmx-proxy-service-tmbveg1 role applied to them. After applying the role to a new node (devjmxpx05), the new node is not immediately available in searches.

[~/chef/roles/jmx-proxy-service]$ knife search roles:jmx-proxy-service-tmbveg1 -i
2 items found

Once chef-client runs on devjmxpx05, it shows up in searches as expected.

Is there any way around this behavior so that the node will show up in role searches as soon as the role is applied? Perhaps some additional search parameters?

We are running Chef server v 11.0.8.


As far as I can tell, this behavior is by design. The idea is that your new node should only show up in the search after the role has actually been applied.

If you need to, you should be able to manually update the node with knife node edit so the node shows up immediately in your search.

Kevin Keane
Whom the IT Pros Call
The NetTech
Our values: Privacy, Liberty, Justice


IIRC, if the role is directly in the runlist and not included by another, searching on role (singular) should return the node. The roles (plural) search in extended runlist which is available only when the node has run (and using chef-client > 11.16 if I remember correctly here also)


Using role was exactly the change needed – thanks @Tensibai