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 2160264 - delete orphans task does not remove pulp3 remotes from capsules when removing repositories
Summary: delete orphans task does not remove pulp3 remotes from capsules when removing...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Satellite
Classification: Red Hat
Component: Capsule - Content
Version: 6.10.7
Hardware: Unspecified
OS: Unspecified
high
medium
Target Milestone: 6.13.0
Assignee: Ian Ballou
QA Contact: Vladimír Sedmík
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2023-01-11 22:08 UTC by Joniel Pasqualetto
Modified: 2023-05-03 13:25 UTC (History)
3 users (show)

Fixed In Version: tfm-rubygem-katello-4.7.0.8-1
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2023-05-03 13:24:04 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Foreman Issue Tracker 35965 0 High Closed delete orphans task does not remove pulp3 remotes from capsules when removing repositories 2023-01-28 00:32:36 UTC
Red Hat Issue Tracker SAT-14892 0 None None None 2023-01-12 15:09:05 UTC
Red Hat Product Errata RHSA-2023:2097 0 None None None 2023-05-03 13:25:03 UTC

Description Joniel Pasqualetto 2023-01-11 22:08:49 UTC
Description of problem:

When repositories are to be removed from a capsule, the remotes used to sync the repositories are left behind.


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


How reproducible:

Always

Steps to Reproduce:
1. Sync some repositories to a capsule
2. Dissociate the environments that are being synced to the capsule
3. Run a delete_orphans task against the capsule
4. Check pulp API to ensure the repositories are gone (endpoint /pulp/api/v3/repositories/)
5. Check pulp API remotes and you'll see they are still around (endpoint pulp/api/v3/remotes/rpm/rpm/)

Actual results:
Remotes are left behind

Expected results:
Remotes would be delete together with the repository it's in charge of syncing.

Additional info:

Comment 1 Ian Ballou 2023-01-16 14:24:49 UTC
Joniel, are there any error that are stopping the orphan deletion? Do you see that the 'Actions::Pulp3::OrphanCleanup::DeleteOrphanRemotes' action is planned and runs as part of orphan cleanup?

Comment 2 Joniel Pasqualetto 2023-01-16 14:43:59 UTC
Hello @iballou

Yes, I see the action "Actions::Pulp3::OrphanCleanup::DeleteOrphanRemotes (success) [ 0.33s / 0.33s ]", but the remotes are not gone.

Looking at capsule logs, no requests to DELETE the remotes get there, so no errors appear to be happening. 

This is also easily reproducible and appears to always happen. 

Didn't test in newer versions. 

Let me know if you want to have a look at a reproducer.

Comment 5 Ian Ballou 2023-01-17 21:05:49 UTC
Created redmine issue https://projects.theforeman.org/issues/35965 from this bug

Comment 6 Bryan Kearney 2023-01-28 04:03:14 UTC
Moving this bug to POST for triage into Satellite since the upstream issue https://projects.theforeman.org/issues/35965 has been resolved.

Comment 8 Vladimír Sedmík 2023-02-13 20:57:35 UTC
Verified in 6.13.0 snap 10 (rubygem-katello-4.7.0.9-1.el8sat.noarch):

Steps:
1) Have a Satellite with registered external Capsule.

2) Sync several repositories (rpm, KS, file, docker) to the Capsule (via Library LCE).

3) Check the repos and remotes are there:
# pulp --profile caps rpm repository list
...
# pulp --profile caps rpm remote list
...

4) Disassociate the Library LCE from the Capsule.

5) Run orphan cleanup:
[root@sat ~]# foreman-rake katello:delete_orphaned_content RAILS_ENV=production SMART_PROXY_ID=2
Orphaned content deletion started in background.

6) Check the repo and remote was cleaned:
[root@sat ~]# pulp --profile caps rpm repository list
[]
[root@sat ~]# pulp --profile caps rpm remote list
[]

[root@sat ~]# pulp --profile caps file repository list
[]
[root@sat ~]# pulp --profile caps file remote list
[]

[root@sat ~]# pulp --profile caps container repository list
[]
[root@sat ~]# pulp --profile caps container remote list
[]

Remotes were removed together with repositories after cleanup, checked also by curling API.

Comment 11 errata-xmlrpc 2023-05-03 13:24:04 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


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