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 2207867 - Getting "[Errno -1] Package does not match intended download" error when install rpm
Summary: Getting "[Errno -1] Package does not match intended download" error when inst...
Keywords:
Status: CLOSED MIGRATED
Alias: None
Product: Red Hat Satellite
Classification: Red Hat
Component: Pulp
Version: 6.11.5
Hardware: Unspecified
OS: Unspecified
unspecified
medium
Target Milestone: Unspecified
Assignee: satellite6-bugs
QA Contact: Satellite QE Team
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2023-05-17 07:09 UTC by Hao Chang Yu
Modified: 2024-06-06 16:14 UTC (History)
5 users (show)

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


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Issue Tracker   SAT-17783 0 None Migrated None 2024-06-06 16:14:17 UTC
Red Hat Knowledge Base (Solution) 7026555 0 None None None 2023-08-02 06:37:41 UTC

Description Hao Chang Yu 2023-05-17 07:09:15 UTC
Description of problem:

In the case of "on demand" download policy, if there are multiple remote URL for the similar rpms (same NVERA but have different checksum), Pulp may pick the wrong remote URL to download the rpm.

This can happen when some third party repositories re-signed Red Hat rpm without changing the rpm name. Customer syncs both Red Hat repository and the third party repository containing the same rpm.


Steps to Reproduce:
1. Prepare any unsigned rpm, such as foo-1.0-1.noarch.rpm
2. Make a copy of the unsigned rpm and then sign it with a gpg key.
3. In the Satellite "/var/www/html/pub" directory, create the following 2 directories.
~~~
/var/www/html/pub/test_repo_redhat
/var/www/html/pub/test_repo_custom
~~~

4. Copy the signed rpm to both directories.
5. Run createrepo command in both directory.
6. In Satellite web ui, create the following 2 custom repositories:
~~~
name: test_repo_redhat
Upstream_url: http://your.satellite.fqdn/pub/test_repo_redhat/
Download policy: On demand

name: test_repo_custom
Upstream_url: http://your.satellite.fqdn/pub/test_repo_custom/
Download policy: On demand
~~~

7. Sync both repositories.
8. If you run the following sql query, you should get something like below:
~~~
Example:

Pulpcore=# select url, sha256 from core_remoteartifact where url ilike '%foo-1.0-1%';
                                                     url              |                              sha256                              
--------------------------------------------------------------------- +-----------------------------------------------------------------
 http://your.satellite.fqdn/pub/test_repo_redhat/foo-1.0-1.noarch.rpm | 6c3d14090ee0efdd7dba9fbabb5fb54bf403e76000e1137652dd62162ce3aa17
 http://your.satellite.fqdn/pub/test_repo_custom/foo-1.0-1.noarch.rpm | 6c3d14090ee0efdd7dba9fbabb5fb54bf403e76000e1137652dd62162ce3aa17
~~~

9. Remove everything in the "/var/www/html/pub/test_repo_custom" directory.
10. Copy the unsigned 'foo-1.0-1.noarch.rpm" to "/var/www/html/pub/test_repo_custom" directory and run createrepo.
11. Now sync the "test_repo_custom" repository again.
12. If you run the following sql query now, you should see the duplicate remote URL with new checksum (checksum of the unsigned rpm).
~~~
Example:

Pulpcore=# select url,sha256 from core_remoteartifact where url ilike '%foo-1.0-1%';
                                                     url              |                              sha256                              
--------------------------------------------------------------------- +-----------------------------------------------------------------
 http://your.satellite.fqdn/pub/test_repo_redhat/foo-1.0-1.noarch.rpm | 6c3d14090ee0efdd7dba9fbabb5fb54bf403e76000e1137652dd62162ce3aa17
 http://your.satellite.fqdn/pub/test_repo_custom/foo-1.0-1.noarch.rpm | 6c3d14090ee0efdd7dba9fbabb5fb54bf403e76000e1137652dd62162ce3aa17
 http://your.satellite.fqdn/pub/test_repo_custom/foo-1.0-1.noarch.rpm | ebebedda75647f51ef52499040d72ea704677ab0bc2f73bb312e9133b4a32f70
~~~


Actual results:
Download the rpm in "test_repo_redhat" repository will get the wrong rpm. Expected "6c3d14090ee0efdd7dba9fbabb5fb54bf403e76000e1137652dd62162ce3aa17"(signed rpm) but got "ebebedda75647f51ef52499040d72ea704677ab0bc2f73bb312e9133b4a32f70"(unsigned rpm)
~~~
Example:

# curl -k https://your.satellite.fqdn/pulp/content/org/Library/custom/custom/test_repo_redhat/Packages/f/foo-1.0-1.noarch.rpm | sha256sum
ebebedda75647f51ef52499040d72ea704677ab0bc2f73bb312e9133b4a32f70

# curl -k https://your.satellite.fqdn/pulp/content/org/Library/custom/custom/test_repo_redhat/repodata/xxxxxxx-primary.xml.gz | gunzip | grep "checksum"
<checksum type="sha256" pkgid="YES">6c3d14090ee0efdd7dba9fbabb5fb54bf403e76000e1137652dd62162ce3aa17</checksum>
~~~


Expected results:
Downloaded rpm match the repo metadata.

Comment 11 Eric Helms 2024-06-06 16:14:19 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.


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