Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.
RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 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 "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". 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 "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-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 1337105

Summary: Yum should handle correctly package checksum mismatch with proxy enabled
Product: Red Hat Enterprise Linux 7 Reporter: Vadim Rutkovsky <vrutkovs>
Component: yumAssignee: Michal Domonkos <mdomonko>
Status: CLOSED ERRATA QA Contact: Karel Srot <ksrot>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 7.2CC: james.antill, mdomonko, twaugh, vmukhame, vrutkovs
Target Milestone: rcKeywords: Patch
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: yum-3.4.3-148.el7 Doc Type: Enhancement
Doc Text:
Feature: The "http_caching" option has been extended with the new possible value "lazy:packages". Reason: Sometimes, packages may change their content on the server after they have been published. This usually happens when packages are first pushed to the repository unsigned and are only signed at a later time. If the user is behind a proxy cache, they may experience checksum verification errors when attempting to install such packages. This could be worked around by using the "none" value, however that disallows HTTP caching unconditionally, which is not optimal. Result: When the new value is used in the yum configuration file, yum will behave the same way as with "packages" but improve the RPM download logic to prevent such false checksum errors. As package caching will still be allowed under normal circumstances, the users may consider using the new value rather than "none" if they experience the above issues.
Story Points: ---
Clone Of:
: 1342179 (view as bug list) Environment:
Last Closed: 2016-11-04 05:32:14 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:
Bug Depends On:    
Bug Blocks: 1342179    

Description Vadim Rutkovsky 2016-05-18 10:08:50 UTC
Description of problem:
Yum currently doesn't handle the situation when package is updated without changing its name (e.g. package was signed) with proxy enabled:

As discussed at https://www.redhat.com/archives/rhl-devel-list/2008-January/msg02361.html:
----------
Yum and "X-Cache: HIT"
======================
If you use wget --server-response and a target file, you see the raw
HTTP headers of that request.  If the file is already cached, you see a
HTTP header like below:

X-Cache: HIT from proxyserver.example.com

Proposal:
Improve yum with the following download logic:

IF (a downloaded repodata/* file doesn't match the repomd.xml checksum
    OR a downloaded RPM doesn't match the expected checksum)
   AND "X-Cache: HIT from" was in its HTTP header
THEN download it again with URLGrabber option: http_headers =
(('Pragma', 'no-cache')

This should solve the case where RPM files legitimately change contents
without changing filenames, like RPM signing.
-------

This feature is required for OSBS team to cache rpms used to build Docker containers, as the packages might be signed while being cached.



Steps to Reproduce:
1. Setup squid cache for a yum repo
2. Set 'yum_proxy' address for the repo on client machine
3. Make sure the package hits the cache - e.g. install the package on client machine using squid proxy
4. Sign the package with a new key
5. Install a package on different machine using squid as a proxy

Actual results:
Old package is fetched - yum will complain about mismatched checksum

Expected results:
Yum should be aware that proxy is used when checksums don't match and fetch the package avoiding proxy (using Pragma = no-cache header in request)

Comment 25 errata-xmlrpc 2016-11-04 05:32:14 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://rhn.redhat.com/errata/RHBA-2016-2397.html