Bug #11436

Disabling used repository_set removes repo already from candlepin and pulp before chcking it is used

Added by Brad Buckingham almost 5 years ago. Updated almost 2 years ago.

Web UI
Target version:
Bugzilla link:
Fixed in Releases:
Found in Releases:


Cloned from
Description of problem:
Disabling a repository set does the check if it is used in the finalize() step. That means even used repository set will be already be removed from candlepin and pulp. Only the removal from Katello in the finalize step will then not be done

Below the successful Run steps:

sequence         concurrence
6: Actions::Pulp::Repository::Destroy (success) [ 68.70s / 5.42s ]
9: Actions::ElasticSearch::Repository::Destroy (success) [ 61.92s / 61.92s ]
12: Actions::Candlepin::Environment::SetContent (success) [ 0.19s / 0.19s

See below the failing Finalize step:

3: Actions::ElasticSearch::Reindex (success) [ 3127.81s / 0.15s ]
14: Actions::Katello::Repository::Destroy (error) [ 3127.93s / 0.24s ] Skip

Started at: 2015-07-17 17:17:28 UTC
Ended at: 2015-07-17 18:09:35 UTC
Real time: 3127.93s
Execution time (excluding suspended state): 0.24s

id: 21
name: Red Hat Enterprise Linux 6 Server - Extended Update Support RPMs x86_64 6.5
label: Red_Hat_Enterprise_Linux_6_Server_-_Extended_Update_Support_RPMs_x86_64_6_5
id: 19
name: Red Hat Enterprise Linux Server - Extended Update Support
label: Red_Hat_Enterprise_Linux_Server_-_Extended_Update_Support
cp_id: '70'
id: 4
name: Red Hat
id: 3
name: Hilti
label: Hilti
user_id: 4
finalize_destroy: true
remote_user: hoici-3a181dcb
locale: en


--- {}



Repository cannot be deleted since it has already been included in a published Content View. Please delete all Content View versions containing this repository before attempting to deleting it.

- /opt/rh/ruby193/root/usr/share/gems/gems/katello-1.5.0/app/models/katello/model.rb:22:in
- /opt/rh/ruby193/root/usr/share/gems/gems/katello-1.5.0/app/lib/actions/katello/repository/destroy.rb:48:in
- /opt/rh/ruby193/root/usr/share/gems/gems/dynflow-0.7.3/lib/dynflow/action.rb:465:in
`block (2 levels) in execute_finalize'

After this the Sat6 is unstable as it cannot find the Repo anymore, e.g. listing /products does not work, because of candlepin returns 404-NotFound:

Processing by Katello::Api::Rhsm::CandlepinProxiesController#get as JSON
Parameters: {"id"=>"f7be3be2-b8eb-44e8-817c-67c577b0e0d3"}
[ERROR 2015-07-17 18:10:35 pulp_rest #12086] RestClient.get "
se_Linux_Server_-_Extended_Update_Support-Red_Hat_Enterprise_Linux_6_Server_-_Extended_Update_Support_RPMs_x86_64_6_5//history/sync/", "Accept
"=>"*/*; q=0.5, application/xml", "Accept-Encoding"=>"gzip, deflate", "Authorization"=>"OAuth oauth_consumer_key=\"katello\", oauth_nonce=\"CJ
b8bA2QmBNEQ20uFIID1YLOabMZ0CPTdHVRo\", oauth_signature=\"wIEjIJATYTxk1FYdCkNQdhQ0gUY%3D\", oauth_signature_method=\"HMAC-SHA1\", oauth_timesta
mp=\"1437156635\", oauth_version=\"1.0\"", "accept"=>"application/json", "content_type"=>"application/json", "pulp-user"=>"hoici-3a181dcb" | \n# => 404 NotFound | application/json 1068 bytes

Version-Release number of selected component (if applicable):

How reproducible:

Steps to Reproduce:
1. Enable a RedHat repository
2. Create and Publish Content View using the RedHat repo
3. Disable the RedHat repository
4. List products

Actual results:
Disable task fails in Finalize step
List products does not work

Expected results:
Disable task fails in Plan step
List products works

Additional info:

Associated revisions

Revision 501e4288 (diff)
Added by Brad Buckingham almost 5 years ago

fixes #11436 - update repo destroy action to check if repo is deletable, in plan phase

This small commit is to ensure that if a user attempts to delete a repository
(e.g. as a result of 'hammer repository-set disable') that the request
is immediately denied in the action plan phase; otherwise, other backend
actions (e.g. pulp/candlepin) will get executed on a repo that is not

Revision 61ed9fec
Added by Brad Buckingham almost 5 years ago

Merge pull request #5428 from bbuckingham/issue-11436

fixes #11436 - update repo destroy action to check if repo is deletable, in plan phase


#1 Updated by Eric Helms almost 5 years ago

  • Legacy Backlogs Release (now unused) set to 70
  • Triaged changed from No to Yes

#2 Updated by The Foreman Bot almost 5 years ago

  • Status changed from New to Ready For Testing
  • Pull request added
  • Pull request deleted ()

#3 Updated by Brad Buckingham almost 5 years ago

  • Status changed from Ready For Testing to Closed
  • % Done changed from 0 to 100

Also available in: Atom PDF