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 2060531 - Instructions to upload content via API don't work on Satellite 6.10
Summary: Instructions to upload content via API don't work on Satellite 6.10
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Red Hat Satellite
Classification: Red Hat
Component: Documentation
Version: 6.10.2
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: Unspecified
Assignee: Ian Fowler
QA Contact:
URL:
Whiteboard:
: 1961195 2068453 (view as bug list)
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2022-03-03 17:30 UTC by Joniel Pasqualetto
Modified: 2022-05-09 12:28 UTC (History)
5 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2022-05-09 12:28:11 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Issue Tracker SATDOC-648 0 None None None 2022-03-03 17:34:56 UTC

Description Joniel Pasqualetto 2022-03-03 17:30:17 UTC
Document URL: 

https://access.redhat.com/documentation/en-us/red_hat_satellite/6.10/html-single/api_guide/index#sect-API_Guide-Uploading_Content_to_the_Satellite_Server

Section Number and Name: 

5.3. Uploading Content to the Satellite Server

Describe the issue: 

The instructions in this section worked fine until Satellite 6.9. With the change to pulp3 in Satellite 6.10 they are no longer working and need adjustments. 

Suggestions for improvement: 

We need the sha256sum of the package for this to work and to specify the name of the package as a parameter later on the process:

Example:
 
The package I'm uploading is /root/ssl-build.bkp/import-export-sat.usersys.redhat.com/import-export-sat.usersys.redhat.com-foreman-proxy-client-1.0-1.noarch.rpm
 
Checksum:
 
# sha256sum /root/ssl-build.bkp/import-export-sat.usersys.redhat.com/import-export-sat.usersys.redhat.com-foreman-proxy-client-1.0-1.noarch.rpm
1f21412545e82715c7c795455cf201334dbde950ff31037867f33007b26430c9  /root/ssl-build.bkp/import-export-sat.usersys.redhat.com/import-export-sat.usersys.redhat.com-foreman-proxy-client-1.0-1.noarch.rpm
 
Size
 
# ls -l /root/ssl-build.bkp/import-export-sat.usersys.redhat.com/import-export-sat.usersys.redhat.com-foreman-proxy-client-1.0-1.noarch.rpm
-rw-------. 1 root root 12542 Jan 11 13:55 /root/ssl-build.bkp/import-export-sat.usersys.redhat.com/import-export-sat.usersys.redhat.com-foreman-proxy-client-1.0-1.noarch.rpm
[root@import-export-sat ~]#
 
Get the upload_id (using size + checksum):
 
# curl -H 'Content-Type: application/json' -X POST -k -u admin:password  -d '{"size": 12542, "checksum": "1f21412545e82715c7c795455cf201334dbde950ff31037867f33007b26430c9"}' https://$(hostname -f)/katello/api/repositories/76/content_uploads
{"upload_id":"f0a5882e-b76e-4813-b4ab-f8880fcb9138"}
 
Upload the file itself:
 
#  curl -u admin:redhat -H Accept:application/json -H Content-Type:multipart/form-data -X PUT --data-urlencode size=12542 --data-urlencode offset=0 --data-urlencode content@/root/ssl-build.bkp/import-export-sat.usersys.redhat.com/import-export-sat.usersys.redhat.com-foreman-proxy-client-1.0-1.noarch.rpm https://$(hostname -f)/katello/api/v2/repositories/76/content_uploads/f0a5882e-b76e-4813-b4ab-f8880fcb9138
 
Finish the import (also using size + checksum + name):
 
# curl -H "Content-Type:application/json" -X PUT -u admin:password -k -d '{"uploads":[{"id": "f0a5882e-b76e-4813-b4ab-f8880fcb9138", "name": "import-export-sat.usersys.redhat.com-foreman-proxy-client-1.0-1.noarch.rpm", "checksum": "1f21412545e82715c7c795455cf201334dbde950ff31037867f33007b26430c9" }]}' https://$(hostname -f)/katello/api/v2/repositories/76/import_uploads


Additional information:

Comment 1 Marie Hornickova 2022-03-03 17:39:50 UTC
Hi  Joniel,
Thank you very much for reporting this doc issue.
The BZ is now assigned, and we'll share all updates here.
Thank you!

Comment 11 Pavel Moravec 2022-04-01 20:46:34 UTC
I realized I opened a duplicate bug:

Bug 2068453 - "Uploading Content to the Satellite Server" has multiple issues in commands

I will close the mine as it is a newer one, but I think it has more precise steps what & how to change in docs.

Comment 12 Pavel Moravec 2022-04-01 20:47:12 UTC
*** Bug 2068453 has been marked as a duplicate of this bug. ***

Comment 17 Ian Fowler 2022-04-07 08:16:32 UTC
*** Bug 1961195 has been marked as a duplicate of this bug. ***


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