Actions
Bug #11051
closedOS host counters inaccurate after host deletion
Description
If you remove hosts from Foreman, you will have resynchronization of data:

Actions
Added by Oleg Obleukhov almost 11 years ago. Updated over 10 years ago.
Description
If you remove hosts from Foreman, you will have resynchronization of data:

Which version of Foreman is this? There are some fixes for counters in 1.8.
I wonder if the previous fix, #5692, only covers the case when the OS changes on a host and not when the host is deleted. Thanks for the report.
Could you check if running foreman-rake fix_cached_counters temporarily fixes/resets the counters here?
Dominic Cleal wrote:
I wonder if the previous fix, #5692, only covers the case when the OS changes on a host and not when the host is deleted. Thanks for the report.
Could you check if running
foreman-rake fix_cached_counterstemporarily fixes/resets the counters here?
Yes, this command fixed it.
I could not reproduce this, tried adding and removing hosts to no avail.
Is it possible you had a corrupted DB somehow that had leftovers from before the fix?
If you manage to reproduce this, please let us know the steps to reproduce that lead to mistaken counts.
You can close the ticket. I found 1 place where it was modified directly in database. So periodical run of foreman-rake fix_cached_counters fixed the problem.
Bug was due to direct modification in database. Closing.