-
Bug
-
Resolution: Done
-
Undefined
-
None
-
None
-
None
-
None
Description of problem:
Re-registering a system after `subscription-manager clean` fails with error 410 Gone.
How reproducible:
100%
Is this issue a regression from an earlier version:
YES; regression from 6.15 (not affected) to 6.16 (affected)
Steps to Reproduce:
1. register a system (with AK or without, e.g. use Global Registration feature)
2. subscription-manager clean
3. subscription-manager register (optionally with any arguments, like AK or credentials, --force,..)
Actual behavior:
3. always fails. Subsequent attempt to register succeeds, though. "Just" the first one fails.
Expected behavior:
Even the 1st attempt from 3. succeeds.
Business Impact / Additional info:
relevant snippet from `production.log`:
2024-12-18T10:01:01 [I|app|589d3e36] Started POST "/rhsm/consumers?owner=RedHat&activation_keys=ak_all" for 1.2.3.4 at 2024-12-18 10:01:01 +0100 2024-12-18T10:01:01 [I|app|589d3e36] Processing by Katello::Api::Rhsm::CandlepinProxiesController#consumer_activate as JSON 2024-12-18T10:01:01 [I|app|589d3e36] Parameters: {"type"=>"system", "name"=>"pmoravec-rhel8.subdomain.redhat.com", "facts"=>"[FILTERED]", "installedProducts"=>[{"productId"=>"479", "productName"=>"Red Hat Enterprise Linux for x86_64", "version"=>"8.10", "arch"=>"x86_64"}], "contentTags"=>["rhel-8-x86_64", "rhel-8"], "role"=>"", "addOns"=>[], "usage"=>"", "serviceLevel"=>"", "owner"=>"RedHat", "activation_keys"=>"ak_all"} 2024-12-18T10:01:01 [I|aud|589d3e36] Katello::Host::SubscriptionFacet (24) destroy event on host_id 6 2024-12-18T10:01:01 [I|aud|589d3e36] Katello::Host::SubscriptionFacet (24) destroy event on uuid 90a2eda4-4e57-4bc1-aa76-4d42c9026a37 2024-12-18T10:01:01 [I|aud|589d3e36] Katello::Host::SubscriptionFacet (24) destroy event on service_level 2024-12-18T10:01:01 [I|aud|589d3e36] Katello::Host::SubscriptionFacet (24) destroy event on release_version 2024-12-18T10:01:01 [I|aud|589d3e36] Katello::Host::SubscriptionFacet (24) destroy event on autoheal true 2024-12-18T10:01:01 [I|aud|589d3e36] Katello::Host::SubscriptionFacet (24) destroy event on registered_at 2024-12-18 08:57:30 UTC 2024-12-18T10:01:01 [I|aud|589d3e36] Katello::Host::SubscriptionFacet (24) destroy event on registered_through pmoravec-sat616.gsslab.brq2.redhat.com 2024-12-18T10:01:01 [I|aud|589d3e36] Katello::Host::SubscriptionFacet (24) destroy event on user_id 2024-12-18T10:01:01 [I|aud|589d3e36] Katello::Host::SubscriptionFacet (24) destroy event on hypervisor false 2024-12-18T10:01:01 [I|aud|589d3e36] Katello::Host::SubscriptionFacet (24) destroy event on hypervisor_host_id 2024-12-18T10:01:01 [I|aud|589d3e36] Katello::Host::SubscriptionFacet (24) destroy event on purpose_usage 2024-12-18T10:01:01 [I|aud|589d3e36] Katello::Host::SubscriptionFacet (24) destroy event on purpose_role 2024-12-18T10:01:01 [I|aud|589d3e36] Katello::Host::SubscriptionFacet (24) destroy event on dmi_uuid 242a5bf9-af0a-423e-9d28-a89e931240e7 2024-12-18T10:01:01 [I|aud|589d3e36] Katello::Host::SubscriptionFacet (24) destroy event on convert2rhel_through_foreman 2024-12-18T10:01:01 [I|aud|589d3e36] Katello::Host::SubscriptionFacet (24) destroy event on pool_ids [] 2024-12-18T10:01:01 [I|aud|589d3e36] Katello::Host::ContentFacet (5) update event on uuid 90a2eda4-4e57-4bc1-aa76-4d42c9026a37, 2024-12-18T10:01:01 [E|app|589d3e36] RestClient::Gone: Katello::Resources::Candlepin::Consumer: 410 Gone {"displayMessage":"Unit 90a2eda4-4e57-4bc1-aa76-4d42c9026a37 has been deleted","requestUuid":"95672bd5-3645-4877-8684-74ded1a5f023","deletedId":"90a2eda4-4e57-4bc1-aa76-4d42c9026a37"} (PUT /candlepin/consumers/90a2eda4-4e57-4bc1-aa76-4d42c9026a37) 589d3e36 | Body: {"displayMessage":"Unit 90a2eda4-4e57-4bc1-aa76-4d42c9026a37 has been deleted","requestUuid":"95672bd5-3645-4877-8684-74ded1a5f023","deletedId":"90a2eda4-4e57-4bc1-aa76-4d42c9026a37"} 589d3e36 | 2024-12-18T10:01:01 [E|app|589d3e36] /usr/share/gems/gems/katello-4.14.0.3/app/controllers/katello/api/rhsm/candlepin_proxies_controller.rb:242:in `consumer_activate' 2024-12-18T10:01:01 [I|app|589d3e36] Rendered text template (Duration: 0.0ms | Allocations: 1) 2024-12-18T10:01:01 [I|app|589d3e36] Completed 410 Gone in 392ms (Views: 0.6ms | ActiveRecord: 32.7ms | Allocations: 62546)
Some very similar problem exists internally in katello when doing re-register without the `sub-man clean`, where katello (on DELETE request from sub-man) does delete the candlepin consumer:
2024-12-18T09:57:29 [I|app|439a28c5] Started DELETE "/rhsm/consumers/55bc414e-7e88-48fc-b830-8e521cbbeaf7" for 1.2.3.4 at 2024-12-18 09:57:29 +0100 .. 2024-12-18T09:57:29 [I|aud|439a28c5] Katello::Host::SubscriptionFacet (23) destroy event on uuid 55bc414e-7e88-48fc-b830-8e521cbbeaf7
but then it attempts to update the consumer:
2024-12-18T09:57:29 [I|aud|439a28c5] Katello::Host::ContentFacet (5) update event on uuid 55bc414e-7e88-48fc-b830-8e521cbbeaf7, 2024-12-18T09:57:29 [E|app|439a28c5] RestClient::Gone: Katello::Resources::Candlepin::Consumer: 410 Gone {"displayMessage":"Unit 55bc414e-7e88-48fc-b830-8e521cbbeaf7 has been deleted","requestUuid":"b0395897-ebf7-4354-88aa-c552f087e74d","deletedId":"55bc414e-7e88-48fc-b830-8e521cbbeaf7"} (PUT /candlepin/consumers/55bc414e-7e88-48fc-b830-8e521cbbeaf7) 439a28c5 | Body: {"displayMessage":"Unit 55bc414e-7e88-48fc-b830-8e521cbbeaf7 has been deleted","requestUuid":"b0395897-ebf7-4354-88aa-c552f087e74d","deletedId":"55bc414e-7e88-48fc-b830-8e521cbbeaf7"}
Already this is fishy (and new since 6.16), though this alone does not cause any visible impact to registration / subscription-manager.