Bug 2175226

Summary: Cannot force delete repositories that are included in export content view versions
Product: Red Hat Satellite Reporter: Samir Jha <sajha>
Component: Content ViewsAssignee: Samir Jha <sajha>
Status: CLOSED ERRATA QA Contact: Sam Bible <sbible>
Severity: medium Docs Contact:
Priority: unspecified    
Version: 6.13.0CC: ahumbe, paji, pcreech
Target Milestone: 6.13.0Keywords: Triaged
Target Release: Unused   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: rubygem-katello-4.7.0.19-1 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2023-05-03 13:25:13 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Samir Jha 2023-03-03 15:40:21 UTC
To reproduce:

1) Create a CVV with a repository and export it (I used the syncable format, not sure if it matters).
2) Export the repository and library in two other exports.
3) Try to delete the repository from its details page. After the delete modal pops up, delete it, and it will fail. I believe in the finalize step.

The error will complain about library_instances_inverse.

Normal, non-generated content views do work with forced repo deletion.

Comment 1 Samir Jha 2023-03-03 15:40:24 UTC
Created from redmine issue https://projects.theforeman.org/issues/36123

Comment 2 Samir Jha 2023-03-03 15:40:25 UTC
Upstream bug assigned to None

Comment 3 Bryan Kearney 2023-03-03 20:03:32 UTC
Moving this bug to POST for triage into Satellite since the upstream issue https://projects.theforeman.org/issues/36123 has been resolved.

Comment 5 Sam Bible 2023-03-14 18:22:42 UTC
Verified on 6.13 - Snap 14

Steps to Verify (From https://github.com/Katello/katello/pull/10474, thanks Samir):
1. Create a yum repo (repo_to_export) and sync.
2. Create a CV, add the repo and publish
3. Run the following exports for library, the repo and content view version in hammer:
   hammer content-export complete library --organization="Default Organization"
   hammer content-export complete library --organization="Default Organization" --format=syncable   
   hammer content-export complete repository --name="repo_to_export" --product="product_name" --organization="Default Organization"
   hammer content-export complete repository --name="repo_to_export" --product="prod" --organization="Default Organization" --format=syncable
   hammer content-export complete version --content-view="cv_to_export" --version=1.0 --organization="Default Organization"
   hammer content-export complete version --content-view="cv_to_export" --version=1.0 --organization="Default Organization" --format=syncable
4. Navigate to the repo's Details page and click Remove Repository, checking the box in the modal.

Expected Results:
The repo is correctly forcibly deleted.

Actual Results
The repo was correctly forcibly deleted.

Comment 8 errata-xmlrpc 2023-05-03 13:25:13 UTC
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