Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.
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 1957464

Summary: Foreman Task: Remove Orphans, results in pulp3 errors
Product: Red Hat Satellite Reporter: Jason Dickerson <jdickers>
Component: RepositoriesAssignee: satellite6-bugs <satellite6-bugs>
Status: CLOSED DUPLICATE QA Contact: Tasos Papaioannou <tpapaioa>
Severity: medium Docs Contact:
Priority: high    
Version: 6.9.0CC: ahumbe, apatel, iballou, mmccune, rcavalca
Target Milestone: UnspecifiedKeywords: PrioBumpGSS, Regression, Triaged
Target Release: Unused   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2021-05-20 15:38:24 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
prodution log errors none

Description Jason Dickerson 2021-05-05 19:58:14 UTC
Created attachment 1779963 [details]
prodution log errors

Description of problem:
Remove Orphans Task encounters pulp3 Service down error

Version-Release number of selected component (if applicable):
6.9.1 (upgraded from 6.8.3, had to re-run installer multiple times due to errors caused by /tmp/bundler)

How reproducible:
consistently

Steps to Reproduce:
1.  Run: foreman-rake katello:delete_orphaned_content RAILS_ENV=production
2.  Find Orphan Remove task in the Task list in Satellite


Actual results:
Error:  

There was an issue with the backend service pulp3: 503 Service Unavailable
There was an issue with the backend service pulp3: 503 Service Unavailable
There was an issue with the backend service pulp3: 503 Service Unavailable

Expected results:
Job runs

Additional info:
Attaching production.log errors

Comment 1 Jason Dickerson 2021-05-05 21:52:21 UTC
pulp3 references in the production log entries attached.  

$ grep pulp3 production_log_RemoveOrphans_error.txt 
 | /opt/theforeman/tfm/root/usr/share/gems/gems/katello-3.18.1.27/app/models/katello/ping.rb:185:in `pulp3_without_auth'
 | /opt/theforeman/tfm/root/usr/share/gems/gems/katello-3.18.1.27/app/models/katello/ping.rb:75:in `block in ping_pulp3_without_auth'
 | /opt/theforeman/tfm/root/usr/share/gems/gems/katello-3.18.1.27/app/models/katello/ping.rb:74:in `ping_pulp3_without_auth'
 | /opt/theforeman/tfm/root/usr/share/gems/gems/katello-3.18.1.27/app/lib/actions/pulp3/orchestration/orphan_cleanup/remove_orphans.rb:9:in `block in plan'
 | /opt/theforeman/tfm/root/usr/share/gems/gems/katello-3.18.1.27/app/lib/actions/pulp3/orchestration/orphan_cleanup/remove_orphans.rb:8:in `plan'
2021-05-05T14:39:24 [E|bac|] There was an issue with the backend service pulp3: 503 Service Unavailable (RuntimeError)
 | /opt/theforeman/tfm/root/usr/share/gems/gems/katello-3.18.1.27/app/lib/actions/pulp3/orchestration/orphan_cleanup/remove_orphans.rb:9:in `block in plan'
 | /opt/theforeman/tfm/root/usr/share/gems/gems/katello-3.18.1.27/app/lib/actions/pulp3/orchestration/orphan_cleanup/remove_orphans.rb:8:in `plan'
2021-05-05T14:39:24 [E|bac|] There was an issue with the backend service pulp3: 503 Service Unavailable (RuntimeError)
 | /opt/theforeman/tfm/root/usr/share/gems/gems/katello-3.18.1.27/app/lib/actions/pulp3/orchestration/orphan_cleanup/remove_orphans.rb:9:in `block in plan'
 | /opt/theforeman/tfm/root/usr/share/gems/gems/katello-3.18.1.27/app/lib/actions/pulp3/orchestration/orphan_cleanup/remove_orphans.rb:8:in `plan'
2021-05-05T14:39:24 [E|bac|] There was an issue with the backend service pulp3: 503 Service Unavailable (RuntimeError)
 | /opt/theforeman/tfm/root/usr/share/gems/gems/katello-3.18.1.27/app/lib/actions/pulp3/orchestration/orphan_cleanup/remove_orphans.rb:9:in `block in plan'
 | /opt/theforeman/tfm/root/usr/share/gems/gems/katello-3.18.1.27/app/lib/actions/pulp3/orchestration/orphan_cleanup/remove_orphans.rb:8:in `plan'
2021-05-05T14:39:25 [E|app|] Smart proxy with ID 1 may be down: There was an issue with the backend service pulp3: 503 Service Unavailable

katello ping is attempting to ping the pulp3 api.  Notice:  

$ systemctl list-unit-files
...
pulp_celerybeat.service                       enabled 
pulp_resource_manager.service                 enabled 
pulp_streamer.service                         enabled 
pulp_worker-0.service                         static  
pulp_worker-1.service                         static  
pulp_worker-2.service                         static  
pulp_worker-3.service                         static  
pulp_workers.service                          enabled 
pulpcore-api.service                          disabled
pulpcore-content.service                      disabled
pulpcore-resource-manager.service             disabled
pulpcore-worker@.service                      disabled
...

I believe the intent is that pulp3 is at least partly installed in preparation for migration activities, but no code in katello should be referencing it as yet.  Unfortunately, it seems some pulp3 code slipped into katello.  I have not noticed anything else affected so far, other than this code.

Comment 2 Jason Dickerson 2021-05-05 21:54:44 UTC
You can work around the issue by running 

pulp-admin orphan remove --all --bg

on the satellite and each capsule, instead of using the foreman-rake command in cron.d/katello on the satellite.

Comment 3 Brad Buckingham 2021-05-12 20:50:55 UTC
Not certain the appropriate component for this rake task; however, Repositories may be a better fit.

Comment 4 Brad Buckingham 2021-05-12 20:52:02 UTC
Solution for this one may be same as for bug 1959640.

Comment 5 Ian Ballou 2021-05-20 15:38:24 UTC
Closing this as a duplicate of https://bugzilla.redhat.com/show_bug.cgi?id=1959640.  Please reopen this bug if the fix for that issue doesn't resolve the issue here.

*** This bug has been marked as a duplicate of bug 1959640 ***