Problem: Foreman is removing random hosts on its own , i am trying to understand why and how to stop it as this is causing the hosts to be unsubscribed from important updates.
Expected outcome: Hosts registered should stay registered
Foreman and Proxy versions: Version 3.10.0
Foreman and Proxy plugin versions: Version 3.10.0
Distribution and version:
Other relevant data:
I am adding the hosts when they are unsubscribed however every few hours the host is getting removed from foreman on its own.
Below is audit log of one of the host, could some one help me understand the possible cause for this and what can be done to stop foreman removing hosts
I did some more digging and found that a delete call gets issued on multiple servers
Client host Consumer profile "6f9b5eb3-14ed-499f-849d-XXXXX" has been deleted from the server. You can use command clean or unregister to remove local profile.
Foreman Server 2024-11-07 12:03:29,583 [thread=https-openssl-nio-127.0.0.1-23443-exec-180] [req=ee927e31-4f7d-4071-90cc-XXXXX, org=, csid=] INFO org.candlepin.servlet.filter.logging.LoggingFilter - Request: verb=DELETE, uri=/candlepin/consumers/6f9b5eb3-14ed-499f-849d-XXXXXX
I am not able to determine the reason why this is happening or / and if this is expected behaviour
The host is getting created again but has no subscription and i have register the host again with activation key manually
Katello has a clean_backend_objects rake task that runs automatically during Foreman upgrades. It removes hosts whose Candlepin consumers have no corresponding subscription facet in Foreman (determined by its Subscription UUID), or whose subscription facets have a nil UUID. Is it possible it’s this? I don’t believe that task runs regularly, unless you’ve got a cron job set up or something.
You can search the logs for phrases like
is partially missing subscription information
orphaned consumer id(s) found in candlepin
Appreciate your response, i dont see a log similar to what you mentioned. How can i list all jobs to check if i have similar job running in background ?
2024-11-07T07:45:49 [I|app|e40f3ac0] Started GET "/settings/auto_complete_search?search=unregister_delete_host" for XXXXX at 2024-11-07 07:45:49 -0500
2024-11-07T07:45:49 [I|app|e40f3ac0] Parameters: {"search"=>"unregister_delete_host"}
2024-11-07T07:46:30 [I|app|e599d14a] Started PUT "/api/settings/unregister_delete_host" for XXXX at 2024-11-07 07:46:30 -0500
2024-11-07T07:46:30 [I|app|e599d14a] Parameters: {"setting"=>{"value"=>"[FILTERED]"}, "apiv"=>"v2", "id"=>"unregister_delete_host"}
One question is, what has access to run DELETE /candlepin/consumers/:uuid? Is there a way we can see from the logs if the call is originating from the Foreman server or from the host?
I found something weird , the hosts are getting registered however subscription is not getting consumed. I read somewhere that hosts may be deleted if they are no longer subscribed
Could this cause issues we are seeing ? I have tried to register the hosts and they seem to be registered and getting updates however under subscriptions i see “0” as consumed
Found that on registering the host subscription-manager behaves differently
OLD FMN SYSTEM ( 1.20.3 )
Nov 8 03:50:47 xxxxx subscription-manager[1499869]: Registered system with identity: xxxx-1bdb-4779-xxxx-xxxxx
Nov 8 03:50:47 xxxxx subscription-manager[1499869]: Added subscription for 'rocky_linux_9' contract 'None'
Nov 8 03:50:47 xxxxx subscription-manager[1499869]: Added subscription for product 'rocky_linux_9'
Nov 8 03:50:47 xxxxx subscription-manager[1499869]: Added subscription for 'Content Access' contract 'None'
Nov 8 03:50:47 xxxxx subscription-manager[1499869]: Added subscription for product ' Content Access'
NEW FMN SYSTEM
Nov 8 01:07:52 xxxxx subscription-manager[1461154]: Added subscription for 'Content Access' contract 'None'
Nov 8 01:07:52 xxxxx subscription-manager[1461154]: Added subscription for product ' Content Access'
Nov 8 01:07:52 xxxxx subscription-manager[1461154]: Removed subscription for 'Content Access' contract 'None'
Nov 8 01:07:52 xxxxx subscription-manager[1461154]: Removed subscription for product ' Content Access'