This bug has been migrated to another issue tracking site. It has been closed here and may no longer be being monitored.

If you would like to get updates for this issue, or to participate in it, you may do so at Red Hat Issue Tracker .
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 2128080 - Repository Sync status API is broken on Satellite 6
Summary: Repository Sync status API is broken on Satellite 6
Keywords:
Status: CLOSED MIGRATED
Alias: None
Product: Red Hat Satellite
Classification: Red Hat
Component: Repositories
Version: 6.10.4
Hardware: Unspecified
OS: All
high
high
Target Milestone: Unspecified
Assignee: satellite6-bugs
QA Contact: Satellite QE Team
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2022-09-19 19:22 UTC by Karnvir Singh
Modified: 2024-10-05 04:25 UTC (History)
8 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2024-06-06 12:34:38 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Issue Tracker   SAT-25419 0 None Migrated None 2024-06-06 12:34:37 UTC

Description Karnvir Singh 2022-09-19 19:22:25 UTC
Description of problem:

Repository Sync status API is broken on Satellite 6 - /katello/api/repositories/:repository_id/sync

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

6.10

How reproducible:

100%

Steps to Reproduce:

1. Run below API, provide ID of any repository. You can also initiate the sync of repository before running below API, it would still fail.

GET /katello/api/repositories/:repository_id/sync

2. API fails with 404 error.

Actual results:

API not showing the status and failing with 404 error.

Expected results:

It should show the sync status of repository.

Comment 5 Sayan Das 2023-01-20 17:15:43 UTC
This is the last way I found out to get Similar Results as what is displayed in Content --> Sync Status page


# curl -ksu admin:RedHat1! "https://`hostname -f`/foreman_tasks/api/tasks?search=label=Actions::Katello::Repository::Sync&&per_page=1000" | json_reformat | egrep "^                            \"text\": \"repository|                \"output\":"  | awk -F'":' '{print $NF"|"}' | paste - - | column -s"|" -t

 "repository 'Red Hat Enterprise Linux 7 Server - Extras RPMs x86_64'"                        	 "New packages: 26 (41.1 MB)."   
 "repository 'Red Hat Ansible Engine 2.9 RPMs for Red Hat Enterprise Linux 7 Server x86_64'"  	 "No new packages."   
 "repository 'Red Hat Satellite Tools 6.10 for RHEL 6 Server - ELS RPMs x86_64'"              	 "No new packages."   
 "repository 'Red Hat Ansible Engine 2.9 RPMs for Red Hat Enterprise Linux 7 Server x86_64'"  	 "No new packages."   
 "repository 'Red Hat Ansible Engine 2.9 RPMs for Red Hat Enterprise Linux 7 Server x86_64'"  	 "No new packages."   
 "repository 'Red Hat Enterprise Linux 6 Server - Extended Life Cycle Support RPMs x86_64'"   	 "No new packages."   
 "repository 'Red Hat Ansible Engine 2.9 RPMs for Red Hat Enterprise Linux 7 Server x86_64'"  	 "No new packages."   
 "repository 'Red Hat Enterprise Linux 7 Server RPMs x86_64 7Server'"                         	 "No new packages."   
 "repository 'ubi8/ubi-minimal'"                                                              	 "No JSON object could be decoded"   
 "repository 'ubi8/ubi-minimal'"                                                              	 "No JSON object could be decoded"   
 "repository 'ubi8/ubi-minimal'"                                                              	 "No JSON object could be decoded"   
 "repository 'Red Hat Enterprise Linux 6 Server - Extended Life Cycle Support RPMs x86_64'"   	 "Processing metadata"   


Basically, I target all the "Actions::Katello::Repository::Sync" tasks , get their results and then grep for the repo name and results printed for each. But I limit the output to 1000 only. 

The output after "json_reformat" can be parsed much better with Python script instead of shell hacks.

The above output is for Pulp 2, For Pulp 3, We do have results but It's a bit messy due to the way 

 "repository 'Red Hat Software Collections RPMs for Red Hat Enterprise Linux 7 Server x86_64 7Server'",  	 "Added Rpms: 30, Errata: 1\nTotal steps: 16234/16234\n--------------------------------\nAssociating Content: 598/598\nDownloading Artifacts: 0/0\nDownloading Metadata Files: 10/10\nParsed Advisories: 690/690\nParsed Comps: 0/0\nParsed Packages: 14369/14369\nSkipping Packages: 0/0\nUn-Associating Content: 567/567",

 "repository 'Red Hat Ansible Engine 2.9 RPMs for Red Hat Enterprise Linux 7 Server x86_64'",            	 "No content added.\nTotal steps: 1/1\n--------------------------------\nSkipping Sync (no change from previous sync): 1/1",


If we use jq utility instead of json_reformat, we can get this for Pulp3 specific satellites

curl -ksu admin:RedHat1! "https://`hostname -f`/foreman_tasks/api/tasks?search=label=Actions::Katello::Repository::Sync&&per_page=1000" | jq '.results | .[] | [.input.repository.name,.humanized.output]'


[
  "Red Hat Software Collections RPMs for Red Hat Enterprise Linux 7 Server x86_64 7Server",
  "Added Rpms: 30, Errata: 1\nTotal steps: 16234/16234\n--------------------------------\nAssociating Content: 598/598\nDownloading Artifacts: 0/0\nDownloading Metadata Files: 10/10\nParsed Advisories: 690/690\nParsed Comps: 0/0\nParsed Packages: 14369/14369\nSkipping Packages: 0/0\nUn-Associating Content: 567/567"
]
[
  "Red Hat Ansible Engine 2.9 RPMs for Red Hat Enterprise Linux 7 Server x86_64",
  "No content added.\nTotal steps: 1/1\n--------------------------------\nSkipping Sync (no change from previous sync): 1/1"
]

Comment 6 Eric Helms 2024-06-06 12:34:38 UTC
This BZ has been automatically migrated to the issues.redhat.com Red Hat Issue Tracker. All future work related to this report will be managed there.

Due to differences in account names between systems, some fields were not replicated.  Be sure to add yourself to Jira issue's "Watchers" field to continue receiving updates and add others to the "Need Info From" field to continue requesting information.

To find the migrated issue, look in the "Links" section for a direct link to the new issue location. The issue key will have an icon of 2 footprints next to it, and begin with "SAT-" followed by an integer.  You can also find this issue by visiting https://issues.redhat.com/issues/?jql= and searching the "Bugzilla Bug" field for this BZ's number, e.g. a search like:

"Bugzilla Bug" = 1234567

In the event you have trouble locating or viewing this issue, you can file an issue by sending mail to rh-issues. You can also visit https://access.redhat.com/articles/7032570 for general account information.

Comment 7 Red Hat Bugzilla 2024-10-05 04:25:29 UTC
The needinfo request[s] on this closed bug have been removed as they have been unresolved for 120 days


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