When trying to list All hosts through the API with the ‘full_results’ attribute set to ‘true’, fails with Katello::Resources::Candlepin::Consumer: 410 Gone

Solution Unverified - Updated -

Environment

  • Red Hat Satellite 6

Issue

  • When trying to list All hosts through the API with the full_results attribute set to true, fails with :
{u'displayMessage': u'Katello::Resources::Candlepin::Consumer: 410 Gone {"displayMessage":"Unit 11609729-d6d3-40f6-93d2-182b2c22946b has been deleted","requestUuid":"09266649-46ee-4f93-bce9-3e691255347f","deletedId":"11609729-d6d3-40f6-93d2-182b2c22946b"} (GET /candlepin/consumers/11609729-d6d3-40f6-93d2-182b2c22946b)', u'errors': [u'Katello::Resources::Candlepin::Consumer: 410 Gone {"displayMessage":"Unit 11609729-d6d3-40f6-93d2-182b2c22946b has been deleted","requestUuid":"09266649-46ee-4f93-bce9-3e691255347f","deletedId":"11609729-d6d3-40f6-93d2-182b2c22946b"} (GET /candlepin/consumers/11609729-d6d3-40f6-93d2-182b2c22946b)']}
  • When trying to list All hosts through the API with the full_results attribute set to true, fails with error Katello::Resources::Candlepin::Consumer: 410 Gone

Resolution

  • Execute the below command which will clean the stale objcet from foreman database :
# foreman-rake katello:clean_backend_objects
  • Then rebuild the UI cache:
# foreman-rake katello:reindex 

(since Sat6.2.7, use foreman-rake katello:reimport instead)

Root Cause

  • System count from foreman and candlepin database was different .
  • How to chcek system count from foreman and candlepin database :
  • For foreman
# su - postgres
postgres=# \c foreman
psql (8.4.20)
You are now connected to database "foreman".
foreman=# select count(*) from katello_systems;
  • For candlepin
foreman=# \c candlepin
psql (8.4.20)
You are now connected to database "candlepin".
candlepin=# select count(*) from cp_consumer;

This solution is part of Red Hat’s fast-track publication program, providing a huge library of solutions that Red Hat engineers have created while supporting our customers. To give you the knowledge you need the instant it becomes available, these articles may be presented in a raw and unedited form.

Close

Welcome! Check out the Getting Started with Red Hat page for quick tours and guides for common tasks.