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 2060531

Summary: Instructions to upload content via API don't work on Satellite 6.10
Product: Red Hat Satellite Reporter: Joniel Pasqualetto <jpasqual>
Component: DocumentationAssignee: Ian Fowler <ifowler>
Status: CLOSED CURRENTRELEASE QA Contact:
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 6.10.2CC: casl, ifowler, jsenkyri, mdolezel, pmoravec
Target Milestone: Unspecified   
Target Release: Unused   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2022-05-09 12:28:11 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:

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. ***