We often see this error: 2018-05-30 03:17:06 71ef6e3c [app] [E] RestClient::Gone: Katello::Resources::Candlepin::Consumer: 410 Gone {"displayMessage":"Unit 1ab7b861-bf5c-447d-8527-71b936314c76 has been deleted","requestUuid":"40a90ae6-e92c-4387-a7a7-05a43fc63f11","deletedId":"1ab7b861-bf5c-447d-8527-71b936314c76"} (GET /candlepin/consumers/1ab7b861-bf5c-447d-8527-71b936314c76) | Body: {"displayMessage":"Unit 1ab7b861-bf5c-447d-8527-71b936314c76 has been deleted","requestUuid":"40a90ae6-e92c-4387-a7a7-05a43fc63f11","deletedId":"1ab7b861-bf5c-447d-8527-71b936314c76"} | /opt/theforeman/tfm/root/usr/share/gems/gems/rest-client-1.8.0/lib/restclient/abstract_response.rb:74:in `return!' | /opt/theforeman/tfm/root/usr/share/gems/gems/rest-client-1.8.0/lib/restclient/request.rb:495:in `process_result' | /opt/theforeman/tfm/root/usr/share/gems/gems/rest-client-1.8.0/lib/restclient/request.rb:421:in `block in transmit' It is because katello and candlepin somehow got misaligned. To fix this issue, people need to delete the host in foreman-rake console. In some cases, it is quite risky to ask customers to perform this. Ideally, there should be a script like foreman-rake katello:correct_repositories to correct products in a safe manner: foreman-rake katello:correct_products
This is handled in foreman-rake katello:clean_backend_objects
# foreman-rake katello:clean_backend_objects The following changes will not actually be performed. Rerun with COMMIT=true to apply the changes 0 orphaned consumer id(s) found in candlepin. 0 orphaned consumer id(s) found in pulp.
Hi Mike, It seems like katello:clean_backend_objects only cleans up hosts and other stuff like orphaned consumers, but not orphaned products in foreman. By looking at /home/mjia/katello/app/models/katello/glue/provider.rb L160-163 product_to_remove_ids = (product_in_katello_ids - products_in_candlepin_ids).uniq product_to_remove_ids.each do |cp_id| product = Product.find_by_cp_id(cp_id, self.organization) Rails.logger.warn "Orphaned Product id #{product.id} found while refreshing/importing manifest." end end Why a warning message is logged instead of deleting the orphaned product?