Red Hat Satellite engineering is moving the tracking of its product development work on Satellite to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "Satellite project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs will be migrated starting at the end of May. If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "Satellite project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/SAT-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 2109254 - Remove orphans task going to the paused state with error "Cannot delete some instances of model 'Repository' because they are referenced through protected foreign keys" on Red Hat Satellite 6.11
Summary: Remove orphans task going to the paused state with error "Cannot delete some ...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Satellite
Classification: Red Hat
Component: Pulp
Version: 6.11.0
Hardware: Unspecified
OS: Unspecified
medium
medium
Target Milestone: 6.12.0
Assignee: satellite6-bugs
QA Contact:
URL:
Whiteboard:
: 2104736 (view as bug list)
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2022-07-20 18:52 UTC by Dhaval Joshi
Modified: 2023-01-23 16:34 UTC (History)
15 users (show)

Fixed In Version: pulp_rpm-3.14.16-1, pulp_rpm-3.17.7-1
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
: 2112368 (view as bug list)
Environment:
Last Closed: 2022-11-16 13:34:39 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Github pulp pulp_rpm issues 2459 0 None closed Katello 4.3.0 rake katello:delete_orphaned_content fails with error 2022-07-20 18:55:29 UTC
Github pulp pulp_rpm pull 2619 0 None Merged Fix a bug preventing orphan cleanup for some subrepos 2022-07-20 18:55:29 UTC
Red Hat Issue Tracker SAT-12253 0 None None None 2022-08-17 15:14:38 UTC
Red Hat Knowledge Base (Solution) 6986277 0 None None None 2022-11-17 18:39:50 UTC
Red Hat Product Errata RHSA-2022:8506 0 None None None 2022-11-16 13:34:54 UTC

Description Dhaval Joshi 2022-07-20 18:52:52 UTC
Description of problem:

The task 'Actions::Katello::OrphanCleanup::RemoveOrphans' is going to the paused state instead of finishing successfully.


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

How reproducible:
100%

Steps to Reproduce:
1. Enable and sync repositories on the Satellite server.
2. Sync Library env with Capsule server.
2. Remove some of the synced repositories.
3. Run orphan cleanup command foreman-rake katello:delete_orphaned_content RAILS_ENV=production

Actual results:
The task goes to the paused state with error message:

Katello::Errors::Pulp3Error

("Cannot delete some instances of model 'Repository' because they are referenced through protected foreign keys: 'Addon.repository', 'RpmRepository.repository_ptr'.", {})

Expected results:
The task should complete successfully without any issues.

Additional info:
https://community.theforeman.org/t/katello-4-3-0-rake-katello-delete-orphaned-content-error/27898

Comment 1 Sayan Das 2022-07-20 18:58:25 UTC
The issue seems to have been addressed in pulp_rpm  via:

Katello 4.3.0 rake katello:delete_orphaned_content fails with error · Issue #2459 · pulp/pulp_rpm
https://github.com/pulp/pulp_rpm/issues/2459

Fix a bug preventing orphan cleanup for some subrepos by dralley · Pull Request #2619 · pulp/pulp_rpm
https://github.com/pulp/pulp_rpm/pull/2619


Going through the PR, It seems like the issue is supposed to be fixed in  pulp_rpm 3.17.7 and 3.14.16


Looping @dalley here ..

Comment 5 Daniel Alley 2022-08-09 14:08:08 UTC
*** Bug 2104736 has been marked as a duplicate of this bug. ***

Comment 6 Lai 2022-08-15 15:56:02 UTC
Steps to retest:
1. Enable and sync repositories on the Satellite server.
2. Sync Library env with Capsule server.
2. Remove some of the synced repositories.
3. Run orphan cleanup command foreman-rake katello:delete_orphaned_content RAILS_ENV=production

Expected:
Orphan cleanup should finish successfully

Actual:
Orphan cleanup finishes successfully

verified on 6.12 snap 6.1

Comment 14 errata-xmlrpc 2022-11-16 13:34:39 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.12 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-2022:8506


Note You need to log in before you can comment on or make changes to this bug.