Description of problem: Satellite 6.11 has introduced a very nice feature where if "Allow deleting repositories in published content views" is enabled in settinfs, that allows to *delete* (not disable) any repos ( Redhat\Custom ) from Satellite even if they are part of any CVs i.e. if we delete any repos using Content --> Products --> <Repo> --> Select Action --> Remove Repository , Then It will delete all reference of the repo from all related CVs and will work fine. It sounds dengerous but It works great and does not breaks the CVs at all. Now this feature works great if we are only expecting the CV to be present in Component Content Views i.e. normal CVs. But if the same repo is present in a CCV as well, Then one of the deletion attempts at the backend will fail with error: ~~ Task 9e9edf11-ecd0-4fc5-9b71-936fb3b68f9c: RuntimeError: 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 delete it. ~~ Version-Release number of selected component (if applicable): Satellite 6.12 ( I never tested on 6.11 but Hopefully it is reproducible there as well ) How reproducible: Always Steps to Reproduce: 1. Install a Satellite 6.12 2. Import a manifest 3. Enable any three rhel repos and sync them ( take satellite-clients i guess ) 4. Create an environment path by name "Test" after "Library" lifecycle. 5. Create a CV by name TCV1, include any two out of three repos there and Publish it to Library 6. Create another CV by name TCV2, include the last remaining repos in that CV and Publish it to Library 7. Create a CCV by name TCCV, include the latest versions of TCV1 and TCV2 in the TCCV and Publish to Library. 8. Republish a new version of the TCCV and force publish+promote it to Library as well as "Test" environment. 9. Go to Content --> Products --> Click open a product --> Click open one of the repos --> Select Action --> Remove Repository Actual results: Three tasks will be generated. Out of all, two will be successful ( which are related to repo instances from CV ) but one task will go to Paused state ( which is related to the main repo ) and throw the error: Task 9e9edf11-ecd0-4fc5-9b71-936fb3b68f9c: RuntimeError: 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 delete it. I believe this is happening as the CCV-related instance of the repo never got deleted i.e. The action only deleted the Pulp IDs from CVs and then straightaway tried to delete the main repo but It left the CCV untouched. Expected results: The feature should properly work when the repos are part of CCV as well. Additional info: Logs will be attached later.
Created redmine issue https://projects.theforeman.org/issues/35549 from this bug
Moving this bug to POST for triage into Satellite since the upstream issue https://projects.theforeman.org/issues/35549 has been resolved.
Steps I followed: Create and sync a repo Add repo to a component content view and publish Create a composite content view and add the component content view from above with latest version. Publish the composite content view. Verify you see the repository in version details of the newly published version. Go to the repository's details page and click Select Action > Remove Repository * The composite content view now shows in the confirmation modal. * The Delete task succeeds with no errors. * After removing the repository, the composite CV version remains, but does not have the content. * The associated Red Hat repository now shows as disabled on the RH Repos page. Verified in 6.13.0 snap 6
Since the problem described in this bug report should be resolved in a recent advisory, it has been closed with a resolution of ERRATA. For information on the advisory (Important: Satellite 6.13 Release), and where to find the updated files, follow the link below. If the solution does not work for you, open a new bug report. https://access.redhat.com/errata/RHSA-2023:2097