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 2163457 - Remove orphan fails
Summary: Remove orphan fails
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Satellite
Classification: Red Hat
Component: Repositories
Version: 6.13.0
Hardware: Unspecified
OS: Unspecified
unspecified
medium
Target Milestone: 6.13.0
Assignee: Samir Jha
QA Contact: Vladimír Sedmík
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2023-01-23 14:44 UTC by Samir Jha
Modified: 2024-02-15 08:10 UTC (History)
5 users (show)

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


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Foreman Issue Tracker 35657 0 Normal Closed Remove orphan fails 2023-01-23 14:44:32 UTC
Red Hat Issue Tracker SAT-15101 0 None None None 2023-01-25 00:20:59 UTC
Red Hat Knowledge Base (Solution) 7027549 0 None None None 2023-10-13 08:47:23 UTC
Red Hat Product Errata RHSA-2023:2097 0 None None None 2023-05-03 13:24:42 UTC

Description Samir Jha 2023-01-23 14:44:31 UTC
reported in https://community.theforeman.org/t/remove-orphan-fails/30807

when i run manually foreman-rake katello:delete_orphaned_content RAILS_ENV=production
i see 2 tasks getting created
the first run is fine
the second one fails with the error:

undefined method `all?’ for :_created:Symbol
“/usr/share/gems/gems/pulp_rpm_client-3.17.12/lib/pulp_rpm_client/api/repositories_rpm_versions_api.rb:146:in
`list_with_http_info’”
“/usr/share/gems/gems/pulp_rpm_client-3.17.12/lib/pulp_rpm_client/api/repositories_rpm_versions_api.rb:109:in
`list’”
“/usr/share/gems/gems/katello-4.6.0/app/services/katello/pulp3/api/core.rb:194:in
`block in versions_list_for_repository’”
“/usr/share/gems/gems/katello-4.6.0/app/services/katello/pulp3/api/core.rb:245:in
`block in fetch_from_list’”
“/usr/share/gems/gems/katello-4.6.0/app/services/katello/pulp3/api/core.rb:240:in
`loop’”
“/usr/share/gems/gems/katello-4.6.0/app/services/katello/pulp3/api/core.rb:240:in
`fetch_from_list’”
“/usr/share/gems/gems/katello-4.6.0/app/services/katello/pulp3/api/core.rb:194:in
`versions_list_for_repository’”
“/usr/share/gems/gems/katello-4.6.0/app/services/katello/pulp3/smart_proxy_mirror_repository.rb:29:in
`block (2 levels) in orphan_repository_versions’”
“/usr/share/gems/gems/katello-4.6.0/app/services/katello/pulp3/smart_proxy_mirror_repository.rb:28:in
`collect’”
“/usr/share/gems/gems/katello-4.6.0/app/services/katello/pulp3/smart_proxy_mirror_repository.rb:28:in
`block in orphan_repository_versions’”
“/usr/share/gems/gems/katello-4.6.0/app/services/katello/pulp3/smart_proxy_mirror_repository.rb:25:in
`each’”
“/usr/share/gems/gems/katello-4.6.0/app/services/katello/pulp3/smart_proxy_mirror_repository.rb:25:in
`orphan_repository_versions’”
“/usr/share/gems/gems/katello-4.6.0/app/services/katello/pulp3/smart_proxy_repository.rb:39:in
`delete_orphan_repository_versions’”
“/usr/share/gems/gems/katello-4.6.0/app/lib/actions/pulp3/orphan_cleanup/delete_orphan_repository_versions.rb:10:in
`run’”
.....

Comment 1 Samir Jha 2023-01-23 14:44:35 UTC
Created from redmine issue https://projects.theforeman.org/issues/35657

Comment 2 Samir Jha 2023-01-23 14:44:36 UTC
Upstream bug assigned to None

Comment 4 Bryan Kearney 2023-01-24 15:09:10 UTC
Moving this bug to POST for triage into Satellite since the upstream issue https://projects.theforeman.org/issues/35657 has been resolved.

Comment 7 Vladimír Sedmík 2023-02-07 13:55:07 UTC
Verified in 6.13.0 snap 8.0 (rubygem-katello-4.7.0.5-1.el8sat.noarch)

Steps:
1) Create repos of all types (AC, files, docker, custom rpm, RH rpm, KS), sync to Capsules in Library LCE.
2) Move the Capsules to another LCE and resync them.
3) Run the orphan cleanup and check the results:

[root@sat ~]# foreman-rake katello:delete_orphaned_content RAILS_ENV=production
Orphaned content deletion started in background.
Orphaned content deletion started in background.
Orphaned content deletion started in background.
[root@sat ~]# 
[root@sat ~]# hammer task list --search "orphans"
-------------------------------------|-----------------|---------|---------|---------------------|---------------------|-----------|---------------|------------
ID                                   | ACTION          | STATE   | RESULT  | STARTED AT          | ENDED AT            | DURATION  | OWNER         | TASK ERRORS
-------------------------------------|-----------------|---------|---------|---------------------|---------------------|-----------|---------------|------------
11deac93-6346-45ea-953b-85930cde29ad | Remove orphans  | stopped | success | 2023/02/07 13:43:17 | 2023/02/07 13:43:39 | 22.08375  | foreman_admin |            
36f926fd-0c90-4138-aea7-12a5afd4c710 | Remove orphans  | stopped | success | 2023/02/07 13:43:16 | 2023/02/07 13:43:32 | 15.417211 | foreman_admin |            
90537944-60f3-410d-8503-8864a0f8391c | Remove orphans  | stopped | success | 2023/02/07 13:43:16 | 2023/02/07 13:43:20 | 3.648096  | foreman_admin |  -------------------------------------|-----------------|---------|---------|---------------------|---------------------|-----------|---------------|------------

Comment 10 errata-xmlrpc 2023-05-03 13:24:34 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.